Go to the documentation of this file.
33 #ifdef KDL_USE_NEW_TREE_INTERFACE
34 #include <boost/shared_ptr.hpp>
35 #endif //#ifdef KDL_USE_NEW_TREE_INTERFACE
41 #ifdef KDL_USE_NEW_TREE_INTERFACE
44 typedef boost::shared_ptr<TreeElement> TreeElementPtr;
45 typedef boost::shared_ptr<const TreeElement> TreeElementConstPtr;
46 typedef std::map<std::string, TreeElementPtr>
SegmentMap;
49 #define GetTreeElementChildren(tree_element) (tree_element)->children
50 #define GetTreeElementParent(tree_element) (tree_element)->parent
51 #define GetTreeElementQNr(tree_element) (tree_element)->q_nr
52 #define GetTreeElementSegment(tree_element) (tree_element)->segment
54 #else //#ifdef KDL_USE_NEW_TREE_INTERFACE
56 typedef std::map<std::string,TreeElement>
SegmentMap;
59 #define GetTreeElementChildren(tree_element) (tree_element).children
60 #define GetTreeElementParent(tree_element) (tree_element).parent
61 #define GetTreeElementQNr(tree_element) (tree_element).q_nr
62 #define GetTreeElementSegment(tree_element) (tree_element).segment
64 #endif //#ifdef KDL_USE_NEW_TREE_INTERFACE
69 TreeElement(
const Segment& segment_in,
const SegmentMap::const_iterator& parent_in,
unsigned int q_nr_in):
77 #ifdef KDL_USE_NEW_TREE_INTERFACE
79 #else //#define KDL_USE_NEW_TREE_INTERFACE
87 std::vector<SegmentMap::const_iterator >
children;
108 bool addTreeRecursive(SegmentMap::const_iterator root,
const std::string& hook_name);
138 bool addChain(
const Chain& chain,
const std::string& hook_name);
149 bool addTree(
const Tree& tree,
const std::string& hook_name);
177 SegmentMap::const_iterator
getSegment(
const std::string& segment_name)
const
202 bool getChain(
const std::string& chain_root,
const std::string& chain_tip,
Chain& chain)
const;
unsigned int nrOfJoints
Definition: tree.hpp:103
Tree(const std::string &root_name="root")
The constructor of a tree, a new tree is always empty.
Definition: tree.cpp:28
unsigned int getNrOfJoints() const
Request the total number of joints in the tree.
Definition: tree.hpp:159
@ RotZ
Definition: joint.hpp:47
Frame Inverse() const
Gives back inverse transformation of a Frame.
Definition: frames.inl:422
SegmentMap::const_iterator getRootSegment() const
Request the root segment of the tree.
Definition: tree.hpp:186
@ RotY
Definition: joint.hpp:47
bool addTreeRecursive(SegmentMap::const_iterator root, const std::string &hook_name)
Definition: tree.cpp:98
SegmentMap::const_iterator parent
Definition: tree.hpp:86
const Joint & getJoint() const
Request the joint of the segment.
Definition: segment.hpp:118
@ TransZ
Definition: joint.hpp:47
Vector JointOrigin() const
Request the Vector corresponding to the origin of a revolute joint.
Definition: joint.cpp:157
#define GetTreeElementParent(tree_element)
Definition: tree.hpp:60
#define GetTreeElementChildren(tree_element)
Definition: tree.hpp:59
Definition: articulatedbodyinertia.cpp:28
const std::string & getName() const
Request the name of the joint.
Definition: joint.hpp:150
unsigned int getNrOfSegments() const
Request the total number of segments in the chain.
Definition: chain.hpp:76
std::string root_name
Definition: tree.hpp:106
@ TransAxis
Definition: joint.hpp:47
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.
Definition: tree.cpp:83
const SegmentMap & getSegments() const
Definition: tree.hpp:205
unsigned int getNrOfSegments() const
Request the total number of segments in the tree.
Definition: tree.hpp:168
std::vector< SegmentMap::const_iterator > children
Definition: tree.hpp:87
const Segment & getSegment(unsigned int nr) const
Request the nr'd segment of the chain.
Definition: chain.cpp:68
@ RotX
Definition: joint.hpp:47
Frame pose(const double &q) const
Request the pose of the segment, given the joint position q.
Definition: segment.cpp:57
virtual ~Tree()
Definition: tree.hpp:210
Definition: frames.hpp:570
TreeElement TreeElementType
Definition: tree.hpp:57
@ TransX
Definition: joint.hpp:47
This class encapsulates a tree kinematic interconnection structure.
Definition: tree.hpp:99
@ None
Definition: joint.hpp:47
TreeElement(const std::string &name)
Definition: tree.hpp:90
std::map< std::string, TreeElement > SegmentMap
Definition: tree.hpp:39
Definition: segment.hpp:46
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.
Definition: tree.cpp:55
@ RotAxis
Definition: joint.hpp:47
TreeElement(const Segment &segment_in, const SegmentMap::const_iterator &parent_in, unsigned int q_nr_in)
Definition: tree.hpp:69
void addSegment(const Segment &segment)
Adds a new segment to the end of the chain.
Definition: chain.cpp:54
unsigned int q_nr
Definition: tree.hpp:85
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.
Definition: tree.cpp:94
Rotation M
Orientation of the Frame.
Definition: frames.hpp:573
const std::string & getName() const
Request the name of the segment.
Definition: segment.hpp:108
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.
Definition: tree.cpp:117
@ TransY
Definition: joint.hpp:47
const JointType & getType() const
Request the type of the joint.
Definition: joint.hpp:159
SegmentMap segments
Definition: tree.hpp:102
#define GetTreeElementSegment(tree_element)
Definition: tree.hpp:62
unsigned int nrOfSegments
Definition: tree.hpp:104
static TreeElementType Root(const std::string &root_name)
Definition: tree.hpp:75
SegmentMap::const_iterator getSegment(const std::string &segment_name) const
Request the segment of the tree with name segment_name.
Definition: tree.hpp:177
Segment segment
Definition: tree.hpp:84
Tree & operator=(const Tree &arg)
Definition: tree.cpp:44
Vector JointAxis() const
Request the Vector corresponding to the axis of a revolute joint.
Definition: joint.cpp:131