KDL
1.4.0
|
This class encapsulates a tree kinematic interconnection structure. More...
#include <src/tree.hpp>
Public Member Functions | |
Tree (const std::string &root_name="root") | |
The constructor of a tree, a new tree is always empty. More... | |
Tree (const Tree &in) | |
Tree & | operator= (const Tree &arg) |
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. More... | |
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. More... | |
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. More... | |
unsigned int | getNrOfJoints () const |
Request the total number of joints in the tree. More... | |
unsigned int | getNrOfSegments () const |
Request the total number of segments in the tree. More... | |
SegmentMap::const_iterator | getSegment (const std::string &segment_name) const |
Request the segment of the tree with name segment_name. More... | |
SegmentMap::const_iterator | getRootSegment () const |
Request the root segment of the tree. More... | |
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. More... | |
const SegmentMap & | getSegments () const |
virtual | ~Tree () |
Private Member Functions | |
bool | addTreeRecursive (SegmentMap::const_iterator root, const std::string &hook_name) |
Private Attributes | |
SegmentMap | segments |
unsigned int | nrOfJoints |
unsigned int | nrOfSegments |
std::string | root_name |
This class encapsulates a tree kinematic interconnection structure.
It is built out of segments.
|
explicit |
The constructor of a tree, a new tree is always empty.
References KDL::TreeElement::Root(), root_name, and segments.
KDL::Tree::Tree | ( | const Tree & | in | ) |
References addTree(), nrOfJoints, nrOfSegments, KDL::TreeElement::Root(), root_name, and segments.
|
inlinevirtual |
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.
hook_name | name of the segment to connect the chain with. |
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.
segment | new segment to add |
hook_name | name of the segment to connect this segment with. |
References KDL::Segment::getJoint(), KDL::Segment::getName(), GetTreeElementChildren, KDL::Joint::getType(), KDL::Joint::None, nrOfJoints, nrOfSegments, and segments.
Referenced by addChain(), and addTreeRecursive().
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.
tree | Tree to add |
hook_name | name of the segment to connect the tree with |
References addTreeRecursive(), and getRootSegment().
Referenced by operator=(), and Tree().
|
private |
References addSegment(), GetTreeElementChildren, and GetTreeElementSegment.
Referenced by addTree().
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 and chain_tip can be in different branches of the tree, the chain_root can be an ancestor of chain_tip, and chain_tip can be an ancestor of chain_root.
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 |
References KDL::Chain::addSegment(), KDL::Segment::getJoint(), KDL::Joint::getName(), getSegment(), GetTreeElementParent, GetTreeElementSegment, KDL::Joint::getType(), KDL::Frame::Inverse(), KDL::Joint::JointAxis(), KDL::Joint::JointOrigin(), KDL::Frame::M, KDL::Segment::pose(), root_name, KDL::Joint::RotAxis, KDL::Joint::RotX, KDL::Joint::RotY, KDL::Joint::RotZ, segments, KDL::Joint::TransAxis, KDL::Joint::TransX, KDL::Joint::TransY, and KDL::Joint::TransZ.
|
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.
Referenced by KDL::TreeIkSolverVel_wdls::CartToJnt(), KDL::TreeFkSolverPos_recursive::JntToCart(), KDL::TreeJntToJacSolver::JntToJac(), and KDL::TreeIkSolverVel_wdls::TreeIkSolverVel_wdls().
|
inline |
Request the total number of segments in the tree.
|
inline |
Request the root segment of the tree.
Referenced by addTree(), KDL::TreeJntToJacSolver::JntToJac(), KDL::operator<<(), and KDL::TreeFkSolverPos_recursive::recursiveFk().
|
inline |
Request the segment of the tree with name segment_name.
segment_name | the name of the requested segment |
Referenced by getChain(), and KDL::TreeFkSolverPos_recursive::JntToCart().
|
inline |
Referenced by KDL::TreeFkSolverPos_recursive::JntToCart(), and KDL::TreeJntToJacSolver::JntToJac().
References addTree(), nrOfJoints, nrOfSegments, KDL::TreeElement::Root(), root_name, and segments.
|
private |
Referenced by addSegment(), operator=(), and Tree().
|
private |
Referenced by addSegment(), operator=(), and Tree().
|
private |
Referenced by getChain(), operator=(), and Tree().
|
private |
Referenced by addSegment(), getChain(), operator=(), and Tree().