33 #ifndef DART_DYNAMICS_FRAME_HPP_ 34 #define DART_DYNAMICS_FRAME_HPP_ 38 #include <Eigen/Geometry> 40 #include "dart/dynamics/Entity.hpp" 41 #include "dart/math/MathTypes.hpp" 56 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_BEGIN
69 static Frame* World();
77 static std::shared_ptr<Frame> WorldShared();
91 const Frame* _withRespectTo = Frame::World())
const;
96 const Frame* withRespectTo,
const Frame* inCoordinatesOf)
const;
113 const Frame* _relativeTo,
const Frame* _inCoordinatesOf)
const;
121 const Eigen::Vector3d& _offset,
122 const Frame* _relativeTo,
123 const Frame* _inCoordinatesOf)
const;
128 const Frame* _relativeTo = Frame::World(),
129 const Frame* _inCoordinatesOf = Frame::World())
const;
135 const Eigen::Vector3d& _offset,
136 const Frame* _relativeTo = Frame::World(),
137 const Frame* _inCoordinatesOf = Frame::World())
const;
142 const Frame* _relativeTo = Frame::World(),
143 const Frame* _inCoordinatesOf = Frame::World())
const;
178 const Frame* _relativeTo,
const Frame* _inCoordinatesOf)
const;
187 const Eigen::Vector3d& _offset,
188 const Frame* _relativeTo,
189 const Frame* _inCoordinatesOf)
const;
194 const Frame* _relativeTo = Frame::World(),
195 const Frame* _inCoordinatesOf = Frame::World())
const;
198 const Eigen::Vector3d& _offset,
199 const Frame* _relativeTo = Frame::World(),
200 const Frame* _inCoordinatesOf = Frame::World())
const;
205 const Frame* _relativeTo = Frame::World(),
206 const Frame* _inCoordinatesOf = Frame::World())
const;
296 enum ConstructWorldTag
302 explicit Frame(ConstructWorldTag);
336 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
363 const std::string&
setName(
const std::string& name)
override final;
365 const std::string&
getName()
const override final;
373 const Eigen::Isometry3d mRelativeTf;
376 static const Eigen::Vector6d mZero;
380 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
382 DART_DECLARE_CLASS_WITH_VIRTUAL_BASE_END
387 #endif // DART_DYNAMICS_FRAME_HPP_ virtual void processRemovedEntity(Entity *_oldChildEntity)
Called when a child Entity is removed from its parent Frame.
Definition: Frame.cpp:613
virtual const Eigen::Vector6d & getRelativeSpatialVelocity() const =0
Get the spatial velocity of this Frame relative to its parent Frame, in its own coordinates.
virtual void dirtyAcceleration() override
Notify the acceleration updates of this Frame and all its children are needed.
Definition: Frame.cpp:519
bool isWorld() const
Returns true if this Frame is the World Frame.
Definition: Frame.cpp:475
const std::set< Entity * > & getChildEntities()
Get a container with the Entities that are children of this Frame.
Definition: Frame.cpp:421
~Frame() override
Destructor.
Definition: Frame.cpp:45
Eigen::Vector6d mAcceleration
Total acceleration of this Frame, in the coordinates of this Frame.
Definition: Frame.hpp:319
Eigen::Vector3d getAngularAcceleration(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
Get the angular portion of classical acceleration of this Frame relative to some other Frame...
Definition: Frame.cpp:403
Eigen::Isometry3d mWorldTransform
World transform of this Frame.
Definition: Frame.hpp:309
virtual const Eigen::Isometry3d & getRelativeTransform() const =0
Get the transform of this Frame with respect to its parent Frame.
The Frame class serves as the backbone of DART's kinematic tree structure.
Definition: Frame.hpp:57
Eigen::Vector6d mVelocity
Total velocity of this Frame, in the coordinates of this Frame.
Definition: Frame.hpp:314
Eigen::Isometry3d getTransform(const Frame *_withRespectTo=Frame::World()) const
Get the transform of this Frame with respect to some other Frame.
Definition: Frame.cpp:109
Entity class is a base class for any objects that exist in the kinematic tree structure of DART...
Definition: Entity.hpp:60
ConstructAbstractTag
Used when constructing a pure abstract class, because calling the Entity constructor is just a formal...
Definition: Entity.hpp:164
virtual ShapeFrame * asShapeFrame()
Convert 'this' into a ShapeFrame pointer if Frame is a ShapeFrame, otherwise return nullptr...
Definition: Frame.cpp:463
std::size_t getNumChildEntities() const
Get the number of Entities that are currently children of this Frame.
Definition: Frame.cpp:433
Definition: Aspect.cpp:40
The WorldFrame class is a class that is used internally to create the singleton World Frame...
Definition: Frame.hpp:343
virtual const std::string & getName() const =0
Return the name of this Entity.
virtual const Eigen::Vector6d & getPartialAcceleration() const =0
The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as ...
const std::set< Frame * > & getChildFrames()
Get a container with the Frames that are children of this Frame.
Definition: Frame.cpp:439
const Eigen::Vector6d & getSpatialVelocity() const
Get the total spatial velocity of this Frame in the coordinates of this Frame.
Definition: Frame.cpp:140
Eigen::Vector3d getLinearVelocity(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
Get the linear portion of classical velocity of this Frame relative to some other Frame...
Definition: Frame.cpp:227
virtual const Eigen::Vector6d & getRelativeSpatialAcceleration() const =0
Get the spatial acceleration of this Frame relative to its parent Frame, in the coordinates of this F...
virtual const Eigen::Vector6d & getPrimaryRelativeAcceleration() const =0
The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as ...
virtual void dirtyTransform() override
Notify the transformation updates of this Frame and all its children are needed.
Definition: Frame.cpp:481
virtual const std::string & setName(const std::string &_name)=0
Set name.
const Eigen::Vector6d & getSpatialAcceleration() const
Get the total spatial acceleration of this Frame in the coordinates of this Frame.
Definition: Frame.cpp:250
bool isShapeFrame() const
Returns true if this Frame is a ShapeFrame.
Definition: Frame.cpp:457
virtual void changeParentFrame(Frame *_newParentFrame) override
Used by derived classes to change their parent frames.
Definition: Frame.cpp:565
std::set< Frame * > mChildFrames
Container of this Frame's child Frames.
Definition: Frame.hpp:322
virtual void processNewEntity(Entity *_newChildEntity)
Called during a parent Frame change to allow extensions of the Frame class to handle new children in ...
Definition: Frame.cpp:607
Eigen::Vector3d getLinearAcceleration(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
Get the linear portion of classical acceleration of this Frame relative to some other Frame...
Definition: Frame.cpp:361
std::set< Entity * > mChildEntities
Container of this Frame's child Entities.
Definition: Frame.hpp:325
Definition: ShapeFrame.hpp:189
std::size_t getNumChildFrames() const
Get the number of Frames that are currently children of this Frame.
Definition: Frame.cpp:451
Eigen::Vector3d getAngularVelocity(const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
Get the angular portion of classical velocity of this Frame relative to some other Frame...
Definition: Frame.cpp:243
virtual void dirtyVelocity() override
Notify the velocity updates of this Frame and all its children are needed.
Definition: Frame.cpp:500
Frame()
Default constructor, delegates to Frame(ConstructAbstract_t)
Definition: Frame.cpp:549
const Eigen::Isometry3d & getWorldTransform() const
Get the transform of this Frame with respect to the World Frame.
Definition: Frame.cpp:93