Robot Dynamics Library
FrameObject.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017 Jordan Lack <jlack1987@gmail.com>
2 // RDL - Robot Dynamics Library
3 // Licensed under the zlib license. See LICENSE for more details.
4 
5 #ifndef __RDL_FRAME_OBJECT_HPP__
6 #define __RDL_FRAME_OBJECT_HPP__
7 
17 
18 namespace RobotDynamics
19 {
26 {
27  public:
29  {
30  }
31 
35  virtual ~FrameObject()
36  {
37  }
38 
43  virtual void changeFrame(ReferenceFramePtr desiredFrame);
44 
50  {
51  return referenceFrame;
52  }
53 
59  {
60  referenceFrame = frame;
61  }
62 
67  void checkReferenceFramesMatch(const FrameObject* frameObject) const
68  {
69  getReferenceFrame()->checkReferenceFramesMatch(frameObject->getReferenceFrame());
70  }
71 
72  void checkReferenceFramesMatch(FrameObject* frameObject) const
73  {
74  getReferenceFrame()->checkReferenceFramesMatch(frameObject->getReferenceFrame());
75  }
76 
77  protected:
79 
87 };
88 } // namespace RobotDynamics
89 #endif // ifndef __RDL_FRAME_OBJECT_HPP__
An interface that objects with a ReferenceFrame extend to inherit the FrameObject::changeFrame method...
Definition: FrameObject.hpp:26
virtual void changeFrame(ReferenceFramePtr desiredFrame)
Change the ReferenceFrame this FrameObject is expressed in.
Definition: FrameObject.cpp:9
FrameObject(ReferenceFramePtr referenceFrame)
Definition: FrameObject.hpp:28
void setReferenceFrame(ReferenceFramePtr frame)
Set frame objects internal reference frame.
Definition: FrameObject.hpp:58
void checkReferenceFramesMatch(const FrameObject *frameObject) const
Check if two FrameObjects hold the same ReferenceFrame.
Definition: FrameObject.hpp:67
void checkReferenceFramesMatch(FrameObject *frameObject) const
Definition: FrameObject.hpp:72
ReferenceFramePtr getReferenceFrame() const
Get a pointer to the reference frame this FrameObject is expressed in.
Definition: FrameObject.hpp:49
ReferenceFramePtr referenceFrame
Definition: FrameObject.hpp:78
virtual ~FrameObject()
Destructor.
Definition: FrameObject.hpp:35
virtual Math::TransformableGeometricObject * getTransformableGeometricObject()=0
Pure virtual method that FrameObjects are required to implement so the FrameObject::changeFrame metho...
The TransformableGeometricObject class is an essential interface because it forces all geometric obje...
Definition: rdl_eigenmath.hpp:43
std::shared_ptr< ReferenceFrame > ReferenceFramePtr
Definition: ReferenceFrame.hpp:68
Namespace for all structures of the RobotDynamics library.
Definition: examples.hpp:19