5 #ifndef __RDL_REFERENCE_FRAME_HPP__
6 #define __RDL_REFERENCE_FRAME_HPP__
68 class FixedReferenceFrame;
126 throw ReferenceFrameException(
"You are not allowed to create a frame with parentFrame=nullptr. Only a root frame and the world frame may have "
127 "parentFrame=nullptr");
132 while (root->getParentFrame() !=
nullptr)
134 root = root->getParentFrame();
Definition: ReferenceFrame.hpp:375
A custom exception for frame operations.
Definition: FrameExceptions.hpp:28
ReferenceFrame object used to tell what frame objects are expressed in. Every ReferenceFrame has a po...
Definition: ReferenceFrame.hpp:85
ReferenceFrame(const ReferenceFrame &referenceFrameToCopy)
Copy constructor.
Definition: ReferenceFrame.hpp:91
std::string frameName
Definition: ReferenceFrame.hpp:356
void operator=(const FixedReferenceFrame &)=delete
ReferenceFramePtr getParentFrame()
get a pointer to this frames parent
Definition: ReferenceFrame.hpp:235
virtual ~ReferenceFrame()
Destructor.
Definition: ReferenceFrame.hpp:157
ReferenceFrame * getRootFrame()
Definition: ReferenceFrame.hpp:149
RobotDynamics::Math::SpatialTransform transformToRoot
Definition: ReferenceFrame.hpp:359
void checkReferenceFramesMatch(ReferenceFramePtr referenceFrame) const
Check if the argument ReferenceFrame equals this.
Definition: ReferenceFrame.cpp:34
FixedReferenceFrame(const FixedReferenceFrame &)=delete
static ReferenceFramePtr worldFrame
Definition: ReferenceFrame.hpp:355
void verifyFramesHaveSameRoot(ReferenceFramePtr frame)
Check if two frames have the same roots.
Definition: ReferenceFrame.cpp:52
ReferenceFrame * rootFrame
Definition: ReferenceFrame.hpp:364
FixedReferenceFrame(const std::string &frameName, ReferenceFramePtr parentFrame, const RobotDynamics::Math::SpatialTransform &transformFromParent, unsigned int movableBodyId)
Definition: ReferenceFrame.hpp:381
static ReferenceFramePtr getWorldFrame()
Get a pointer to the world frame.
Definition: ReferenceFrame.hpp:263
RobotDynamics::Math::SpatialTransform transformFromParent
Definition: ReferenceFrame.hpp:358
std::string getName() const
Get the frame name.
Definition: ReferenceFrame.hpp:244
RobotDynamics::Math::SpatialTransform getTransformToParent()
Get spatial transform this frame to its parent.
Definition: ReferenceFrame.hpp:281
virtual RobotDynamics::Math::SpatialTransform getTransformToRoot()
Get this frames ReferenceFrame::transformToRoot.
Definition: ReferenceFrame.hpp:217
static ReferenceFramePtr createAWorldFrame(const std::string &frameName="world")
Helper method to create a world frame.
Definition: ReferenceFrame.hpp:350
ReferenceFrame & operator=(const ReferenceFrame &other)
Definition: ReferenceFrame.hpp:314
ReferenceFrame()
Empty constructor. All contained ptrs will be initialize to nullptr.
Definition: ReferenceFrame.hpp:145
bool getIsBodyFrame() const
Get boolean telling if this frame is a body frame or not. If it is a body frame, A pointer to this fr...
Definition: ReferenceFrame.hpp:309
unsigned int movableBodyId
Definition: ReferenceFrame.hpp:370
bool isWorldFrame
Definition: ReferenceFrame.hpp:365
std::shared_ptr< FixedReferenceFrame > FixedReferenceFramePtr
Definition: ReferenceFrame.hpp:70
void getTransformToDesiredFrame(RobotDynamics::Math::SpatialTransform &transformToPack, ReferenceFramePtr desiredFrame)
Get the spatial transform from this frame to desiredFrame and store it in transformToPack.
Definition: ReferenceFrame.hpp:176
unsigned int getMovableBodyId() const
Get the ID of the movable body this frame is attached to.
Definition: ReferenceFrame.hpp:299
RobotDynamics::Math::SpatialTransform getTransformFromParent()
Get spatial transform from parent to this frame.
Definition: ReferenceFrame.hpp:272
static ReferenceFramePtr createARootFrame(const std::string &frameName)
Creates a root frame with ReferenceFrame::parentFrame=nullptr.
Definition: ReferenceFrame.hpp:254
RobotDynamics::Math::SpatialTransform inverseTransformToRoot
Definition: ReferenceFrame.hpp:361
RobotDynamics::Math::SpatialTransform getInverseTransformToRoot() override
Get this frames ReferenceFrame::inverseTransformToRoot.
Definition: ReferenceFrame.hpp:401
std::shared_ptr< ReferenceFrame > ReferenceFramePtr
Definition: ReferenceFrame.hpp:68
ReferenceFramePtr parentFrame
Definition: ReferenceFrame.hpp:357
virtual RobotDynamics::Math::SpatialTransform getInverseTransformToRoot()
Get this frames ReferenceFrame::inverseTransformToRoot.
Definition: ReferenceFrame.hpp:226
std::vector< ReferenceFramePtr > ReferenceFramePtrV
Definition: ReferenceFrame.hpp:71
ReferenceFrame(const std::string &frameName, ReferenceFramePtr parentFrame, const RobotDynamics::Math::SpatialTransform &transformFromParent, bool isBodyFrame, unsigned int movableBodyId)
Constructor.
Definition: ReferenceFrame.hpp:115
void update()
Recalculates this frames ReferenceFrame::transformToRoot and ReferenceFrame::inverseTransformToRoot w...
Definition: ReferenceFrame.cpp:23
virtual ~FixedReferenceFrame()
Definition: ReferenceFrame.hpp:387
std::vector< FixedReferenceFramePtr > FixedReferenceFramePtrV
Definition: ReferenceFrame.hpp:72
bool getIsWorldFrame() const
Get a boolean telling if this frame is the world frame.
Definition: ReferenceFrame.hpp:290
void setTransformFromParent(const RobotDynamics::Math::SpatialTransform &transformFromParent)
Set a frames ReferenceFrame::transformToParent. For frames connected by a joint, this needs to be upd...
Definition: ReferenceFrame.hpp:200
RobotDynamics::Math::SpatialTransform getTransformToRoot() override
Get this frames ReferenceFrame::transformToRoot.
Definition: ReferenceFrame.hpp:391
bool isBodyFrame
Definition: ReferenceFrame.hpp:367
ReferenceFrame(const std::string &frameName, bool isWorldFrame, unsigned int movableBodyId, bool isBodyFrame)
Definition: ReferenceFrame.hpp:338
Namespace for all structures of the RobotDynamics library.
Definition: examples.hpp:19