ofkt_nodes.h
Go to the documentation of this file.
1 
31 #ifndef TESSERACT_STATE_SOLVER_OFKT_NODES_H
32 #define TESSERACT_STATE_SOLVER_OFKT_NODES_H
33 
35 
36 namespace tesseract_scene_graph
37 {
38 /*********************************************************************/
39 /*************************** BASE NODE *******************************/
40 /*********************************************************************/
41 class OFKTBaseNode : public OFKTNode
42 {
43 public:
44  // LCOV_EXCL_START
45  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
46  // LCOV_EXCL_STOP
47 
48  OFKTBaseNode(JointType type, OFKTNode* parent, std::string link_name);
49 
51  OFKTNode* parent,
52  std::string link_name,
53  std::string joint_name,
54  const Eigen::Isometry3d& static_tf);
55 
56  JointType getType() const override;
57 
58  void setParent(OFKTNode* parent) override;
59  OFKTNode* getParent() override;
60  const OFKTNode* getParent() const override;
61 
62  const std::string& getLinkName() const override;
63  const std::string& getJointName() const override;
64 
65  void storeJointValue(double joint_value) override;
66 
67  double getJointValue() const override;
68 
69  bool hasJointValueChanged() const override;
70 
71  void setStaticTransformation(const Eigen::Isometry3d& static_tf) override;
72 
73  const Eigen::Isometry3d& getStaticTransformation() const override;
74  const Eigen::Isometry3d& getLocalTransformation() const override;
75  Eigen::Isometry3d computeLocalTransformation(double joint_value) const override;
76 
77  void computeAndStoreWorldTransformation() override;
78  const Eigen::Isometry3d& getWorldTransformation() const override;
79  bool updateWorldTransformationRequired() const override;
80 
81  Eigen::Matrix<double, 6, 1> getLocalTwist() const override;
82 
83  void addChild(OFKTNode* node) override;
84  void removeChild(const OFKTNode* node) override;
85  std::vector<OFKTNode*>& getChildren() override;
86  const std::vector<const OFKTNode*>& getChildren() const override;
87 
88 protected:
90  OFKTNode* parent_{ nullptr };
91  std::string link_name_;
92  std::string joint_name_;
93  Eigen::Isometry3d static_tf_{ Eigen::Isometry3d::Identity() };
94  Eigen::Isometry3d joint_tf_{ Eigen::Isometry3d::Identity() };
95  Eigen::Isometry3d local_tf_{ Eigen::Isometry3d::Identity() };
96  Eigen::Isometry3d world_tf_{ Eigen::Isometry3d::Identity() };
97  Eigen::Matrix<double, 6, 1> local_twist_{ Eigen::VectorXd::Zero(6) };
98 
99  double joint_value_{ 0 };
100  bool joint_value_changed_{ false };
101 
102  std::vector<OFKTNode*> children_;
103  std::vector<const OFKTNode*> children_const_;
104 
106 
107  friend class OFKTStateSolver;
108 };
109 
110 /*********************************************************************/
111 /*************************** ROOT NODE *******************************/
112 /*********************************************************************/
114 {
115 public:
116  // LCOV_EXCL_START
117  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
118  // LCOV_EXCL_STOP
119 
124  OFKTRootNode(std::string link_name);
125 
126  void setParent(OFKTNode* parent) override;
127  void storeJointValue(double joint_value) override;
128  void setStaticTransformation(const Eigen::Isometry3d& static_tf) override;
129  void computeAndStoreLocalTransformation() override;
130  void computeAndStoreWorldTransformation() override;
131  bool updateWorldTransformationRequired() const override;
132 
133  Eigen::Isometry3d computeLocalTransformation(double joint_value) const override;
134 
135 private:
136  friend class OFKTStateSolver;
137 };
138 
139 /**********************************************************************/
140 /*************************** FIXED NODE *******************************/
141 /**********************************************************************/
143 {
144 public:
145  // LCOV_EXCL_START
146  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
147  // LCOV_EXCL_STOP
148 
149  OFKTFixedNode(OFKTNode* parent, std::string link_name, std::string joint_name, const Eigen::Isometry3d& static_tf);
150 
151  void storeJointValue(double joint_value) override;
152  double getJointValue() const override;
153  void setStaticTransformation(const Eigen::Isometry3d& static_tf) override;
154  void computeAndStoreLocalTransformation() override;
155  Eigen::Isometry3d computeLocalTransformation(double joint_value) const override;
156 
157 private:
158  friend class OFKTStateSolver;
159 };
160 
161 /**********************************************************************/
162 /************************* FLOATING NODE ******************************/
163 /**********************************************************************/
165 {
166 public:
167  // LCOV_EXCL_START
168  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
169  // LCOV_EXCL_STOP
170 
171  OFKTFloatingNode(OFKTNode* parent, std::string link_name, std::string joint_name, const Eigen::Isometry3d& static_tf);
172 
173  void storeJointValue(double joint_value) override;
174  double getJointValue() const override;
175  void setStaticTransformation(const Eigen::Isometry3d& static_tf) override;
176  void computeAndStoreLocalTransformation() override;
177  Eigen::Isometry3d computeLocalTransformation(double joint_value) const override;
178 
179 private:
180  friend class OFKTStateSolver;
181 };
182 
183 /*********************************************************************/
184 /************************* REVOLUTE NODE *****************************/
185 /*********************************************************************/
187 {
188 public:
189  // LCOV_EXCL_START
190  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
191  // LCOV_EXCL_STOP
192 
193  OFKTRevoluteNode(OFKTNode* parent,
194  std::string link_name,
195  std::string joint_name,
196  const Eigen::Isometry3d& static_tf,
197  const Eigen::Vector3d& axis);
198 
199  void storeJointValue(double joint_value) override;
200  void computeAndStoreLocalTransformation() override;
201  Eigen::Isometry3d computeLocalTransformation(double joint_value) const override;
202  const Eigen::Vector3d& getAxis() const;
203 
204 private:
205  Eigen::Vector3d axis_;
206 
208 
209  friend class OFKTStateSolver;
210 };
211 
212 /*********************************************************************/
213 /************************ CONTINUOUS NODE ****************************/
214 /*********************************************************************/
216 {
217 public:
218  // LCOV_EXCL_START
219  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
220  // LCOV_EXCL_STOP
221 
223  std::string link_name,
224  std::string joint_name,
225  const Eigen::Isometry3d& static_tf,
226  const Eigen::Vector3d& axis);
227 
228  void computeAndStoreLocalTransformation() override;
229  Eigen::Isometry3d computeLocalTransformation(double joint_value) const override;
230  const Eigen::Vector3d& getAxis() const;
231 
232 private:
233  Eigen::Vector3d axis_;
234 
236 
237  friend class OFKTStateSolver;
238 };
239 
240 /*********************************************************************/
241 /************************* PRISMATIC NODE ****************************/
242 /*********************************************************************/
244 {
245 public:
246  // LCOV_EXCL_START
247  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
248  // LCOV_EXCL_STOP
249 
250  OFKTPrismaticNode(OFKTNode* parent,
251  std::string link_name,
252  std::string joint_name,
253  const Eigen::Isometry3d& static_tf,
254  const Eigen::Vector3d& axis);
255 
256  void computeAndStoreLocalTransformation() override;
257  Eigen::Isometry3d computeLocalTransformation(double joint_value) const override;
258  const Eigen::Vector3d& getAxis() const;
259 
260 private:
261  Eigen::Vector3d axis_;
262 
264 
265  friend class OFKTStateSolver;
266 };
267 } // namespace tesseract_scene_graph
268 
269 #endif // TESSERACT_STATE_SOLVER_OFKT_NODES_H
tesseract_scene_graph::OFKTFloatingNode::computeLocalTransformation
Eigen::Isometry3d computeLocalTransformation(double joint_value) const override
Compute the local tranformation but do not save.
Definition: ofkt_nodes.cpp:227
tesseract_scene_graph::OFKTFixedNode::getJointValue
double getJointValue() const override
Get the current joint value.
Definition: ofkt_nodes.cpp:179
tesseract_scene_graph::OFKTRevoluteNode::computeLocalTransformation
Eigen::Isometry3d computeLocalTransformation(double joint_value) const override
Compute the local tranformation but do not save.
Definition: ofkt_nodes.cpp:260
tesseract_scene_graph::OFKTBaseNode::children_const_
std::vector< const OFKTNode * > children_const_
Definition: ofkt_nodes.h:103
tesseract_scene_graph::OFKTBaseNode::setStaticTransformation
void setStaticTransformation(const Eigen::Isometry3d &static_tf) override
Set the static transformation.
Definition: ofkt_nodes.cpp:86
tesseract_scene_graph::OFKTContinuousNode::computeAndStoreLocalTransformation
void computeAndStoreLocalTransformation() override
Compute and save the local transformation 'L = S * J(Joint Value)'.
Definition: ofkt_nodes.cpp:294
tesseract_scene_graph::OFKTBaseNode::joint_tf_
Eigen::Isometry3d joint_tf_
Definition: ofkt_nodes.h:94
tesseract_scene_graph::OFKTContinuousNode
Definition: ofkt_nodes.h:215
tesseract_scene_graph::OFKTBaseNode::children_
std::vector< OFKTNode * > children_
Definition: ofkt_nodes.h:102
tesseract_scene_graph::OFKTFloatingNode::OFKTFloatingNode
EIGEN_MAKE_ALIGNED_OPERATOR_NEW OFKTFloatingNode(OFKTNode *parent, std::string link_name, std::string joint_name, const Eigen::Isometry3d &static_tf)
Definition: ofkt_nodes.cpp:195
tesseract_scene_graph::OFKTBaseNode::joint_name_
std::string joint_name_
Definition: ofkt_nodes.h:92
tesseract_scene_graph::OFKTFloatingNode::computeAndStoreLocalTransformation
void computeAndStoreLocalTransformation() override
Compute and save the local transformation 'L = S * J(Joint Value)'.
Definition: ofkt_nodes.cpp:225
tesseract_scene_graph::OFKTBaseNode::computeAndStoreWorldTransformation
void computeAndStoreWorldTransformation() override
Compute and store the nodes world transformation.
Definition: ofkt_nodes.cpp:102
tesseract_scene_graph::OFKTPrismaticNode::computeAndStoreLocalTransformationImpl
void computeAndStoreLocalTransformationImpl()
Definition: ofkt_nodes.cpp:323
tesseract_scene_graph::OFKTPrismaticNode::computeLocalTransformation
Eigen::Isometry3d computeLocalTransformation(double joint_value) const override
Compute the local tranformation but do not save.
Definition: ofkt_nodes.cpp:332
tesseract_scene_graph::OFKTFixedNode
Definition: ofkt_nodes.h:142
tesseract_scene_graph::OFKTBaseNode::joint_value_
double joint_value_
Definition: ofkt_nodes.h:99
tesseract_scene_graph::OFKTRootNode::setParent
void setParent(OFKTNode *parent) override
Set the parent node.
Definition: ofkt_nodes.cpp:137
tesseract_scene_graph::OFKTBaseNode::getJointName
const std::string & getJointName() const override
Get the joint name associated with the node.
Definition: ofkt_nodes.cpp:71
tesseract_scene_graph::OFKTBaseNode::hasJointValueChanged
bool hasJointValueChanged() const override
Indicates that the joint value has changed and that local and world transformation need to be recompu...
Definition: ofkt_nodes.cpp:84
tesseract_scene_graph::OFKTBaseNode::type_
tesseract_scene_graph::JointType type_
Definition: ofkt_nodes.h:89
tesseract_scene_graph::OFKTRootNode::computeLocalTransformation
Eigen::Isometry3d computeLocalTransformation(double joint_value) const override
Compute the local tranformation but do not save.
Definition: ofkt_nodes.cpp:156
tesseract_scene_graph::OFKTFloatingNode::storeJointValue
void storeJointValue(double joint_value) override
Set the nodes joint value if it has one.
Definition: ofkt_nodes.cpp:208
tesseract_scene_graph::OFKTBaseNode::getLinkName
const std::string & getLinkName() const override
Get the link name associated with the node.
Definition: ofkt_nodes.cpp:70
tesseract_scene_graph::OFKTBaseNode::getLocalTwist
Eigen::Matrix< double, 6, 1 > getLocalTwist() const override
Return the twist of the node in its local frame.
Definition: ofkt_nodes.cpp:110
tesseract_scene_graph::OFKTRootNode
Definition: ofkt_nodes.h:113
tesseract_scene_graph::OFKTFixedNode::computeLocalTransformation
Eigen::Isometry3d computeLocalTransformation(double joint_value) const override
Compute the local tranformation but do not save.
Definition: ofkt_nodes.cpp:190
tesseract_scene_graph::OFKTBaseNode::getWorldTransformation
const Eigen::Isometry3d & getWorldTransformation() const override
Get the nodes world transformation.
Definition: ofkt_nodes.cpp:107
tesseract_scene_graph::OFKTBaseNode::update_world_required_
bool update_world_required_
Definition: ofkt_nodes.h:105
tesseract_scene_graph::OFKTBaseNode::static_tf_
Eigen::Isometry3d static_tf_
Definition: ofkt_nodes.h:93
tesseract_scene_graph::OFKTPrismaticNode::computeAndStoreLocalTransformation
void computeAndStoreLocalTransformation() override
Compute and save the local transformation 'L = S * J(Joint Value)'.
Definition: ofkt_nodes.cpp:330
tesseract_scene_graph::OFKTContinuousNode::OFKTContinuousNode
EIGEN_MAKE_ALIGNED_OPERATOR_NEW OFKTContinuousNode(OFKTNode *parent, std::string link_name, std::string joint_name, const Eigen::Isometry3d &static_tf, const Eigen::Vector3d &axis)
Definition: ofkt_nodes.cpp:270
tesseract_scene_graph::OFKTBaseNode::local_tf_
Eigen::Isometry3d local_tf_
Definition: ofkt_nodes.h:95
tesseract_scene_graph::OFKTContinuousNode::computeLocalTransformation
Eigen::Isometry3d computeLocalTransformation(double joint_value) const override
Compute the local tranformation but do not save.
Definition: ofkt_nodes.cpp:296
tesseract_scene_graph::OFKTBaseNode::getType
JointType getType() const override
Get the type of joint associated with the node.
Definition: ofkt_nodes.cpp:60
tesseract_scene_graph::OFKTBaseNode::link_name_
std::string link_name_
Definition: ofkt_nodes.h:91
tesseract_scene_graph::OFKTBaseNode::getParent
OFKTNode * getParent() override
Get the parent node.
Definition: ofkt_nodes.cpp:67
tesseract_scene_graph::OFKTRootNode::OFKTRootNode
EIGEN_MAKE_ALIGNED_OPERATOR_NEW OFKTRootNode(std::string link_name)
This should only be used for the root node of the tree.
Definition: ofkt_nodes.cpp:131
tesseract_scene_graph::OFKTPrismaticNode
Definition: ofkt_nodes.h:243
tesseract_scene_graph::OFKTBaseNode::getLocalTransformation
const Eigen::Isometry3d & getLocalTransformation() const override
Get the local transformation: 'L = S * J'.
Definition: ofkt_nodes.cpp:94
tesseract_scene_graph::OFKTRevoluteNode::OFKTRevoluteNode
EIGEN_MAKE_ALIGNED_OPERATOR_NEW OFKTRevoluteNode(OFKTNode *parent, std::string link_name, std::string joint_name, const Eigen::Isometry3d &static_tf, const Eigen::Vector3d &axis)
Definition: ofkt_nodes.cpp:232
tesseract_scene_graph::OFKTContinuousNode::axis_
Eigen::Vector3d axis_
Definition: ofkt_nodes.h:233
tesseract_scene_graph::OFKTBaseNode::getChildren
std::vector< OFKTNode * > & getChildren() override
Get a vector of child nodes associated with this node.
Definition: ofkt_nodes.cpp:124
tesseract_scene_graph::OFKTFixedNode::OFKTFixedNode
EIGEN_MAKE_ALIGNED_OPERATOR_NEW OFKTFixedNode(OFKTNode *parent, std::string link_name, std::string joint_name, const Eigen::Isometry3d &static_tf)
Definition: ofkt_nodes.cpp:161
tesseract_scene_graph::OFKTBaseNode
Definition: ofkt_nodes.h:41
tesseract_scene_graph::OFKTRevoluteNode::getAxis
const Eigen::Vector3d & getAxis() const
Definition: ofkt_nodes.cpp:265
tesseract_scene_graph::OFKTBaseNode::OFKTBaseNode
EIGEN_MAKE_ALIGNED_OPERATOR_NEW OFKTBaseNode(JointType type, OFKTNode *parent, std::string link_name)
Definition: ofkt_nodes.cpp:41
tesseract_scene_graph::OFKTRootNode::updateWorldTransformationRequired
bool updateWorldTransformationRequired() const override
Indicates if an update of the world transformation is required.
Definition: ofkt_nodes.cpp:154
tesseract_scene_graph::OFKTFixedNode::computeAndStoreLocalTransformation
void computeAndStoreLocalTransformation() override
Compute and save the local transformation 'L = S * J(Joint Value)'.
Definition: ofkt_nodes.cpp:188
tesseract_scene_graph::OFKTFloatingNode::getJointValue
double getJointValue() const override
Get the current joint value.
Definition: ofkt_nodes.cpp:213
tesseract_scene_graph::OFKTNode
The OFKT node is contains multiple trasformation which are described below.
Definition: ofkt_node.h:55
tesseract_scene_graph::OFKTBaseNode::world_tf_
Eigen::Isometry3d world_tf_
Definition: ofkt_nodes.h:96
tesseract_scene_graph::OFKTBaseNode::parent_
OFKTNode * parent_
Definition: ofkt_nodes.h:90
tesseract_scene_graph::OFKTBaseNode::removeChild
void removeChild(const OFKTNode *node) override
Remove a child node assiciated with this node.
Definition: ofkt_nodes.cpp:118
tesseract_scene_graph::OFKTBaseNode::joint_value_changed_
bool joint_value_changed_
Definition: ofkt_nodes.h:100
tesseract_scene_graph::OFKTRevoluteNode::axis_
Eigen::Vector3d axis_
Definition: ofkt_nodes.h:205
tesseract_scene_graph::OFKTBaseNode::getJointValue
double getJointValue() const override
Get the current joint value.
Definition: ofkt_nodes.cpp:82
tesseract_scene_graph::OFKTStateSolver
An implementation of the Optimized Forward Kinematic Tree as a stat solver.
Definition: ofkt_state_solver.h:56
tesseract_scene_graph::OFKTRevoluteNode::computeAndStoreLocalTransformationImpl
void computeAndStoreLocalTransformationImpl()
Definition: ofkt_nodes.cpp:251
tesseract_scene_graph::OFKTRevoluteNode::computeAndStoreLocalTransformation
void computeAndStoreLocalTransformation() override
Compute and save the local transformation 'L = S * J(Joint Value)'.
Definition: ofkt_nodes.cpp:258
tesseract_scene_graph::OFKTPrismaticNode::OFKTPrismaticNode
EIGEN_MAKE_ALIGNED_OPERATOR_NEW OFKTPrismaticNode(OFKTNode *parent, std::string link_name, std::string joint_name, const Eigen::Isometry3d &static_tf, const Eigen::Vector3d &axis)
Definition: ofkt_nodes.cpp:306
tesseract_scene_graph::OFKTBaseNode::local_twist_
Eigen::Matrix< double, 6, 1 > local_twist_
Definition: ofkt_nodes.h:97
tesseract_scene_graph::OFKTPrismaticNode::axis_
Eigen::Vector3d axis_
Definition: ofkt_nodes.h:261
tesseract_scene_graph::OFKTFloatingNode::setStaticTransformation
void setStaticTransformation(const Eigen::Isometry3d &static_tf) override
Set the static transformation.
Definition: ofkt_nodes.cpp:218
tesseract_scene_graph::OFKTContinuousNode::getAxis
const Eigen::Vector3d & getAxis() const
Definition: ofkt_nodes.cpp:301
tesseract_scene_graph::OFKTPrismaticNode::getAxis
const Eigen::Vector3d & getAxis() const
Definition: ofkt_nodes.cpp:337
tesseract_scene_graph::OFKTBaseNode::addChild
void addChild(OFKTNode *node) override
Add a child node.
Definition: ofkt_nodes.cpp:112
type
type
tesseract_scene_graph::OFKTContinuousNode::computeAndStoreLocalTransformationImpl
void computeAndStoreLocalTransformationImpl()
Definition: ofkt_nodes.cpp:287
tesseract_scene_graph::OFKTBaseNode::storeJointValue
void storeJointValue(double joint_value) override
Set the nodes joint value if it has one.
Definition: ofkt_nodes.cpp:73
tesseract_scene_graph::OFKTFloatingNode
Definition: ofkt_nodes.h:164
tesseract_scene_graph::JointType
JointType
tesseract_scene_graph::OFKTRevoluteNode
Definition: ofkt_nodes.h:186
tesseract_scene_graph::OFKTFixedNode::storeJointValue
void storeJointValue(double joint_value) override
Set the nodes joint value if it has one.
Definition: ofkt_nodes.cpp:174
ofkt_node.h
A implementation of the Optimized Forward Kinematic Tree Node.
tesseract_scene_graph::OFKTBaseNode::getStaticTransformation
const Eigen::Isometry3d & getStaticTransformation() const override
Get the nodes static transformation.
Definition: ofkt_nodes.cpp:93
tesseract_scene_graph::OFKTFixedNode::setStaticTransformation
void setStaticTransformation(const Eigen::Isometry3d &static_tf) override
Set the static transformation.
Definition: ofkt_nodes.cpp:181
tesseract_scene_graph::OFKTBaseNode::computeLocalTransformation
Eigen::Isometry3d computeLocalTransformation(double joint_value) const override
Compute the local tranformation but do not save.
Definition: ofkt_nodes.cpp:96
tesseract_scene_graph::OFKTRevoluteNode::storeJointValue
void storeJointValue(double joint_value) override
Set the nodes joint value if it has one.
Definition: ofkt_nodes.cpp:249
tesseract_scene_graph::OFKTRootNode::storeJointValue
void storeJointValue(double joint_value) override
Set the nodes joint value if it has one.
Definition: ofkt_nodes.cpp:142
tesseract_scene_graph::OFKTRootNode::setStaticTransformation
void setStaticTransformation(const Eigen::Isometry3d &static_tf) override
Set the static transformation.
Definition: ofkt_nodes.cpp:147
tesseract_scene_graph::OFKTBaseNode::setParent
void setParent(OFKTNode *parent) override
Set the parent node.
Definition: ofkt_nodes.cpp:62
tesseract_scene_graph
tesseract_scene_graph::OFKTRootNode::computeAndStoreWorldTransformation
void computeAndStoreWorldTransformation() override
Compute and store the nodes world transformation.
Definition: ofkt_nodes.cpp:153
tesseract_scene_graph::OFKTRootNode::computeAndStoreLocalTransformation
void computeAndStoreLocalTransformation() override
Compute and save the local transformation 'L = S * J(Joint Value)'.
Definition: ofkt_nodes.cpp:152
tesseract_scene_graph::OFKTBaseNode::updateWorldTransformationRequired
bool updateWorldTransformationRequired() const override
Indicates if an update of the world transformation is required.
Definition: ofkt_nodes.cpp:108


tesseract_state_solver
Author(s): Levi Armstrong
autogenerated on Sun May 18 2025 03:02:10