29 nrOfJoints(0), nrOfSegments(0), root_name(_root_name)
56 SegmentMap::iterator parent =
segments.find(hook_name);
60 pair<SegmentMap::iterator, bool> retval;
64 #ifdef KDL_USE_NEW_TREE_INTERFACE 66 #else //#ifdef KDL_USE_NEW_TREE_INTERFACE 68 #endif //#ifdef KDL_USE_NEW_TREE_INTERFACE 84 string parent_name = hook_name;
100 SegmentMap::const_iterator child;
123 vector<SegmentMap::key_type> parents_chain_root, parents_chain_tip;
125 parents_chain_root.push_back(s->first);
128 if (parents_chain_root.empty() || parents_chain_root.back() !=
root_name)
return false;
130 parents_chain_tip.push_back(s->first);
133 if (parents_chain_tip.empty() || parents_chain_tip.back() !=
root_name)
return false;
136 SegmentMap::key_type last_segment =
root_name;
137 while (!parents_chain_root.empty() && !parents_chain_tip.empty() &&
138 parents_chain_root.back() == parents_chain_tip.back()){
139 last_segment = parents_chain_root.back();
140 parents_chain_root.pop_back();
141 parents_chain_tip.pop_back();
143 parents_chain_root.push_back(last_segment);
147 for (
unsigned int s=0; s<parents_chain_root.size()-1; s++){
160 for (
int s=parents_chain_tip.size()-1; s>-1; s--){
169 SegmentMap::const_iterator root =
segments.find(segment_name);
173 tree =
Tree(root->first);
unsigned int nrOfSegments
#define GetTreeElementSegment(tree_element)
Tree & operator=(const Tree &arg)
SegmentMap::const_iterator getSegment(const std::string &segment_name) const
bool addTreeRecursive(SegmentMap::const_iterator root, const std::string &hook_name)
const Segment & getSegment(unsigned int nr) const
This class encapsulates a simple segment, that is a "rigid body" (i.e., a frame and a rigid body...
TreeElement TreeElementType
This class encapsulates a serial kinematic interconnection structure. It is built out of segments...
unsigned int getNrOfSegments() const
bool getSubTree(const std::string &segment_name, Tree &tree) const
void addSegment(const Segment &segment)
#define GetTreeElementChildren(tree_element)
#define GetTreeElementParent(tree_element)
Vector JointOrigin() const
Rotation M
Orientation of the Frame.
Frame pose(const double &q) const
const std::string & getName() const
const std::string & getName() const
bool addChain(const Chain &chain, const std::string &hook_name)
const Joint & getJoint() const
bool addTree(const Tree &tree, const std::string &hook_name)
Frame Inverse() const
Gives back inverse transformation of a Frame.
SegmentMap::const_iterator getRootSegment() const
bool getChain(const std::string &chain_root, const std::string &chain_tip, Chain &chain) const
static TreeElementType Root(const std::string &root_name)
represents a frame transformation in 3D space (rotation + translation)
This class encapsulates a simple joint, that is with one parameterized degree of freedom and with sca...
bool addSegment(const Segment &segment, const std::string &hook_name)
Tree(const std::string &root_name="root")
This class encapsulates a tree kinematic interconnection structure. It is built out of segments...
const JointType & getType() const