30 #ifndef EXOTICA_CORE_KINEMATIC_ELEMENT_H_
31 #define EXOTICA_CORE_KINEMATIC_ELEMENT_H_
35 #include <kdl/frames.hpp>
36 #include <kdl/segment.hpp>
44 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
49 KDL::Frame
frame = KDL::Frame::Identity();
50 Eigen::Vector3d
scale = Eigen::Vector3d::Ones();
51 Eigen::Vector4d
color = Eigen::Vector4d(1.0, 1.0, 1.0, 1.0);
57 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
70 std::shared_ptr<KinematicElement> my_parent =
parent.lock();
73 my_parent->RemoveExpiredChildren();
79 std::shared_ptr<KinematicElement> element =
parent.lock();
81 while (element && element->id > 0)
83 if (element->is_robot_link)
88 element = element->parent.lock();
93 inline KDL::Frame
GetPose(
const double& x = 0.0)
111 for (
size_t i = 0; i <
children.size(); ++i)
125 std::vector<std::weak_ptr<KinematicElement>>
children;
128 KDL::Frame
frame = KDL::Frame::Identity();
140 Eigen::Vector3d
scale = Eigen::Vector3d::Ones();
142 Eigen::Vector4d
color = Eigen::Vector4d(0.5, 0.5, 0.5, 1.0);
148 std::stack<std::shared_ptr<KinematicElement>> elements;
149 for (
auto child :
children) elements.push(child.lock());
150 while (!elements.empty())
152 auto parent = elements.top();
155 for (
auto child :
parent->children) elements.push(child.lock());
161 #endif // EXOTICA_CORE_KINEMATIC_ELEMENT_H_