Go to the documentation of this file.
30 #ifndef EXOTICA_CORE_KINEMATIC_ELEMENT_H_
31 #define EXOTICA_CORE_KINEMATIC_ELEMENT_H_
34 #include <geometric_shapes/shapes.h>
35 #include <kdl/frames.hpp>
36 #include <kdl/segment.hpp>
44 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
47 shapes::ShapePtr
shape =
nullptr;
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
66 std::shared_ptr<KinematicElement> my_parent =
parent.lock();
69 my_parent->RemoveExpiredChildren();
75 std::shared_ptr<KinematicElement> element =
parent.lock();
77 while (element && element->id > 0)
79 if (element->is_robot_link)
84 element = element->parent.lock();
89 inline KDL::Frame
GetPose(
const double& x = 0.0)
103 for (
size_t i = 0; i <
children.size(); ++i)
117 std::vector<std::weak_ptr<KinematicElement>>
children;
120 KDL::Frame
frame = KDL::Frame::Identity();
126 shapes::ShapeConstPtr
shape =
nullptr;
128 Eigen::Vector3d
scale = Eigen::Vector3d::Ones();
130 Eigen::Vector4d
color = Eigen::Vector4d(0.5, 0.5, 0.5, 1.0);
136 std::stack<std::shared_ptr<KinematicElement>> elements;
137 for (
auto child :
children) elements.push(child.lock());
138 while (!elements.empty())
140 auto parent = elements.top();
143 for (
auto child :
parent->children) elements.push(child.lock());
149 #endif // EXOTICA_CORE_KINEMATIC_ELEMENT_H_
EIGEN_MAKE_ALIGNED_OPERATOR_NEW KinematicElement(int _id, std::shared_ptr< KinematicElement > _parent, const KDL::Segment &_segment)
Definition: kinematic_element.h:59
~KinematicElement()
Definition: kinematic_element.h:63
bool is_trajectory_generated
Definition: kinematic_element.h:122
std::string shape_resource_path
Definition: kinematic_element.h:127
EIGEN_MAKE_ALIGNED_OPERATOR_NEW std::string name
Definition: kinematic_element.h:46
bool is_controlled
Definition: kinematic_element.h:114
double velocity_limit
Definition: kinematic_element.h:124
Eigen::Vector4d color
Definition: kinematic_element.h:130
void SetChildrenClosestRobotLink()
Definition: kinematic_element.h:134
std::weak_ptr< KinematicElement > closest_robot_link
Definition: kinematic_element.h:118
std::weak_ptr< KinematicElement > parent
Definition: kinematic_element.h:115
std::string parent_name
Definition: kinematic_element.h:116
Definition: cartpole_dynamics_solver.h:38
KDL::Frame generated_offset
Definition: kinematic_element.h:121
std::string shape_resource_path
Definition: kinematic_element.h:48
std::vector< double > joint_limits
Definition: kinematic_element.h:123
std::vector< VisualElement > visual
Definition: kinematic_element.h:131
Definition: kinematic_element.h:54
Eigen::Vector3d scale
Definition: kinematic_element.h:50
void UpdateClosestRobotLink()
Definition: kinematic_element.h:73
Definition: kinematic_element.h:41
void RemoveExpiredChildren()
Definition: kinematic_element.h:101
KDL::Segment segment
Definition: kinematic_element.h:119
int control_id
Definition: kinematic_element.h:113
KDL::Frame frame
Definition: kinematic_element.h:120
shapes::ShapeConstPtr shape
Definition: kinematic_element.h:126
std::vector< std::weak_ptr< KinematicElement > > children
Definition: kinematic_element.h:117
bool is_robot_link
Definition: kinematic_element.h:129
KDL::Frame frame
Definition: kinematic_element.h:49
int id
Definition: kinematic_element.h:112
Eigen::Vector3d scale
Definition: kinematic_element.h:128
double acceleration_limit
Definition: kinematic_element.h:125
shapes::ShapePtr shape
Definition: kinematic_element.h:47
KDL::Frame GetPose(const double &x=0.0)
Definition: kinematic_element.h:89
Eigen::Vector4d color
Definition: kinematic_element.h:51