KDL::Tree Class Reference

This class encapsulates a tree kinematic interconnection structure. More...

#include <tree.hpp>

List of all members.

Public Member Functions

bool addChain (const Chain &chain, const std::string &hook_name)
 Adds a complete chain to the end of the segment with hook_name as segment_name.
bool addSegment (const Segment &segment, const std::string &hook_name)
 Adds a new segment to the end of the segment with hook_name as segment_name.
bool addTree (const Tree &tree, const std::string &hook_name)
 Adds a complete tree to the end of the segment with hookname as segment_name.
bool getChain (const std::string &chain_root, const std::string &chain_tip, Chain &chain) const
 Request the chain of the tree between chain_root and chain_tip.
unsigned int getNrOfJoints () const
 Request the total number of joints in the tree.
unsigned int getNrOfSegments () const
 Request the total number of segments in the tree.
SegmentMap::const_iterator getRootSegment () const
 Request the root segment of the tree.
SegmentMap::const_iterator getSegment (const std::string &segment_name) const
 Request the segment of the tree with name segment_name.
const SegmentMapgetSegments () const
Treeoperator= (const Tree &arg)
 Tree (const Tree &in)
 Tree (const std::string &root_name="root")
 The constructor of a tree, a new tree is always empty.
virtual ~Tree ()

Detailed Description

This class encapsulates a tree kinematic interconnection structure.

It is build out of segments.

Definition at line 65 of file tree.hpp.


Constructor & Destructor Documentation

KDL::Tree::Tree ( const std::string &  root_name = "root"  ) 

The constructor of a tree, a new tree is always empty.

Definition at line 28 of file Mod/Robot/App/kdl_cp/Tree.cpp.

References KDL::TreeElement::Root().

KDL::Tree::Tree ( const Tree in  ) 

Definition at line 33 of file Mod/Robot/App/kdl_cp/Tree.cpp.

References addTree(), and KDL::TreeElement::Root().

virtual KDL::Tree::~Tree (  )  [inline, virtual]

Definition at line 175 of file tree.hpp.


Member Function Documentation

bool KDL::Tree::addChain ( const Chain chain,
const std::string &  hook_name 
)

Adds a complete chain to the end of the segment with hook_name as segment_name.

Parameters:
chain the chain.
hook_name name of the segment to connect the chain with.
Returns:
false if hook_name could not be found.

Definition at line 76 of file Mod/Robot/App/kdl_cp/Tree.cpp.

References addSegment(), KDL::Segment::getName(), KDL::Chain::getNrOfSegments(), and KDL::Chain::getSegment().

bool KDL::Tree::addSegment ( const Segment segment,
const std::string &  hook_name 
)

Adds a new segment to the end of the segment with hook_name as segment_name.

Parameters:
segment new segment to add
hook_name name of the segment to connect this segment with.
Returns:
false if hook_name could not be found.

Definition at line 54 of file Mod/Robot/App/kdl_cp/Tree.cpp.

References KDL::Segment::getJoint(), KDL::Segment::getName(), KDL::Joint::getType(), and KDL::Joint::None.

Referenced by addChain().

bool KDL::Tree::addTree ( const Tree tree,
const std::string &  hook_name 
)

Adds a complete tree to the end of the segment with hookname as segment_name.

Parameters:
tree Tree to add
hook_name name of the segment to connect the tree with
Returns:
false if hook_name could not be found

Definition at line 87 of file Mod/Robot/App/kdl_cp/Tree.cpp.

References getRootSegment().

Referenced by operator=(), and Tree().

bool KDL::Tree::getChain ( const std::string &  chain_root,
const std::string &  chain_tip,
Chain chain 
) const

Request the chain of the tree between chain_root and chain_tip.

The chain_root must be an ancester from chain_tip

Parameters:
chain_root the name of the root segment of the chain
chain_tip the name of the tip segment of the chain
chain the resulting chain
Returns:
success or failure

Definition at line 110 of file Mod/Robot/App/kdl_cp/Tree.cpp.

References KDL::Chain::addSegment(), KDL::Segment::getJoint(), KDL::Joint::getName(), getSegment(), KDL::Joint::getType(), KDL::Frame::Inverse(), KDL::Joint::JointAxis(), KDL::Joint::JointOrigin(), KDL::Frame::M, KDL::Segment::pose(), KDL::Joint::RotAxis, KDL::Joint::RotX, KDL::Joint::RotY, KDL::Joint::RotZ, KDL::Joint::TransAxis, KDL::Joint::TransX, KDL::Joint::TransY, and KDL::Joint::TransZ.

unsigned int KDL::Tree::getNrOfJoints (  )  const [inline]

Request the total number of joints in the tree.


Important: It is not the same as the total number of segments since a segment does not need to have a joint.

Returns:
total nr of joints

Definition at line 126 of file tree.hpp.

Referenced by KDL::TreeIkSolverVel_wdls::CartToJnt(), KDL::TreeFkSolverPos_recursive::JntToCart(), KDL::TreeJntToJacSolver::JntToJac(), and KDL::TreeIkSolverVel_wdls::TreeIkSolverVel_wdls().

unsigned int KDL::Tree::getNrOfSegments (  )  const [inline]

Request the total number of segments in the tree.

Returns:
total number of segments

Definition at line 135 of file tree.hpp.

SegmentMap::const_iterator KDL::Tree::getRootSegment (  )  const [inline]

Request the root segment of the tree.

Returns:
constant iterator pointing to the root segment

Definition at line 153 of file tree.hpp.

Referenced by addTree().

SegmentMap::const_iterator KDL::Tree::getSegment ( const std::string &  segment_name  )  const [inline]

Request the segment of the tree with name segment_name.

Parameters:
segment_name the name of the requested segment
Returns:
constant iterator pointing to the requested segment

Definition at line 144 of file tree.hpp.

Referenced by getChain(), and KDL::TreeFkSolverPos_recursive::JntToCart().

const SegmentMap& KDL::Tree::getSegments (  )  const [inline]
Tree & KDL::Tree::operator= ( const Tree arg  ) 

Definition at line 43 of file Mod/Robot/App/kdl_cp/Tree.cpp.

References addTree(), and KDL::TreeElement::Root().


The documentation for this class was generated from the following files:

Generated on Wed Nov 23 19:02:19 2011 for FreeCAD by  doxygen 1.6.1