33#ifdef KDL_USE_NEW_TREE_INTERFACE
34#include <boost/shared_ptr.hpp>
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
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
69 TreeElement(
const Segment& segment_in,
const SegmentMap::const_iterator& parent_in,
unsigned int q_nr_in):
77#ifdef KDL_USE_NEW_TREE_INTERFACE
87 std::vector<SegmentMap::const_iterator >
children;
103 unsigned int nrOfJoints;
104 unsigned int nrOfSegments;
106 std::string root_name;
108 bool addTreeRecursive(SegmentMap::const_iterator root,
const std::string& hook_name);
114 explicit Tree(
const std::string& root_name=
"root");
177 SegmentMap::const_iterator
getSegment(
const std::string& segment_name)
const
179 return segments.find(segment_name);
188 return segments.find(root_name);
202 bool getChain(
const std::string& chain_root,
const std::string& chain_tip,
Chain& chain)
const;
This class encapsulates a serial kinematic interconnection structure. It is built out of segments.
Definition chain.hpp:35
This class encapsulates a simple segment, that is a "rigid body" (i.e., a frame and a rigid body iner...
Definition segment.hpp:46
unsigned int q_nr
Definition tree.hpp:85
TreeElement(const Segment &segment_in, const SegmentMap::const_iterator &parent_in, unsigned int q_nr_in)
Definition tree.hpp:69
SegmentMap::const_iterator parent
Definition tree.hpp:86
Segment segment
Definition tree.hpp:84
std::vector< SegmentMap::const_iterator > children
Definition tree.hpp:87
static TreeElementType Root(const std::string &root_name)
Definition tree.hpp:75
Tree & operator=(const Tree &arg)
SegmentMap::const_iterator getSegment(const std::string &segment_name) const
Definition tree.hpp:177
SegmentMap::const_iterator getRootSegment() const
Definition tree.hpp:186
bool addChain(const Chain &chain, const std::string &hook_name)
unsigned int getNrOfSegments() const
Definition tree.hpp:168
bool addSegment(const Segment &segment, const std::string &hook_name)
const SegmentMap & getSegments() const
Definition tree.hpp:218
bool addTree(const Tree &tree, const std::string &hook_name)
bool getChain(const std::string &chain_root, const std::string &chain_tip, Chain &chain) const
virtual ~Tree()
Definition tree.hpp:223
Tree(const std::string &root_name="root")
bool getSubTree(const std::string &segment_name, Tree &tree) const
unsigned int getNrOfJoints() const
Definition tree.hpp:159
Definition articulatedbodyinertia.hpp:32
TreeElement TreeElementType
Definition tree.hpp:57
std::map< std::string, TreeElement > SegmentMap
Definition tree.hpp:56