dart
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Friends | List of all members
dart::dynamics::Frame Class Referenceabstract

The Frame class serves as the backbone of DART's kinematic tree structure. More...

#include <Frame.hpp>

Inheritance diagram for dart::dynamics::Frame:
Inheritance graph
[legend]
Collaboration diagram for dart::dynamics::Frame:
Collaboration graph
[legend]

Public Member Functions

 Frame (const Frame &)=delete
 
 ~Frame () override
 Destructor.
 
virtual const Eigen::Isometry3d & getRelativeTransform () const =0
 Get the transform of this Frame with respect to its parent Frame.
 
const Eigen::Isometry3d & getWorldTransform () const
 Get the transform of this Frame with respect to the World Frame.
 
Eigen::Isometry3d getTransform (const Frame *_withRespectTo=Frame::World()) const
 Get the transform of this Frame with respect to some other Frame.
 
Eigen::Isometry3d getTransform (const Frame *withRespectTo, const Frame *inCoordinatesOf) const
 Get the transform of this Frame with respect to some other Frame. More...
 
virtual const Eigen::Vector6d & getRelativeSpatialVelocity () const =0
 Get the spatial velocity of this Frame relative to its parent Frame, in its own coordinates. More...
 
const Eigen::Vector6d & getSpatialVelocity () const
 Get the total spatial velocity of this Frame in the coordinates of this Frame. More...
 
Eigen::Vector6d getSpatialVelocity (const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Get the spatial velocity of this Frame relative to some other Frame. More...
 
Eigen::Vector6d getSpatialVelocity (const Eigen::Vector3d &_offset) const
 Get the spatial velocity of a fixed point in this Frame. More...
 
Eigen::Vector6d getSpatialVelocity (const Eigen::Vector3d &_offset, const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Get the spatial velocity of a fixed point in this Frame.
 
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. More...
 
Eigen::Vector3d getLinearVelocity (const Eigen::Vector3d &_offset, const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
 Get the linear velocity of a point that is fixed in this Frame. More...
 
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. More...
 
virtual const Eigen::Vector6d & getRelativeSpatialAcceleration () const =0
 Get the spatial acceleration of this Frame relative to its parent Frame, in the coordinates of this Frame. More...
 
virtual const Eigen::Vector6d & getPrimaryRelativeAcceleration () const =0
 The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as the partial acceleration, accessible by getPartialAcceleration(). More...
 
virtual const Eigen::Vector6d & getPartialAcceleration () const =0
 The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as the partial acceleration. More...
 
const Eigen::Vector6d & getSpatialAcceleration () const
 Get the total spatial acceleration of this Frame in the coordinates of this Frame. More...
 
Eigen::Vector6d getSpatialAcceleration (const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Get the spatial acceleration of this Frame relative to some other Frame. More...
 
Eigen::Vector6d getSpatialAcceleration (const Eigen::Vector3d &_offset) const
 Get the spatial acceleration of a fixed point in this Frame. More...
 
Eigen::Vector6d getSpatialAcceleration (const Eigen::Vector3d &_offset, const Frame *_relativeTo, const Frame *_inCoordinatesOf) const
 Get the spatial acceleration of a fixed point in this Frame.
 
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. More...
 
Eigen::Vector3d getLinearAcceleration (const Eigen::Vector3d &_offset, const Frame *_relativeTo=Frame::World(), const Frame *_inCoordinatesOf=Frame::World()) const
 
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. More...
 
const std::set< Entity * > & getChildEntities ()
 Get a container with the Entities that are children of this Frame. More...
 
const std::set< const Entity * > getChildEntities () const
 Get a container with the Entities that are children of this Frame. More...
 
std::size_t getNumChildEntities () const
 Get the number of Entities that are currently children of this Frame.
 
const std::set< Frame * > & getChildFrames ()
 Get a container with the Frames that are children of this Frame. More...
 
std::set< const Frame * > getChildFrames () const
 Get a container with the Frames that are children of this Frame. More...
 
std::size_t getNumChildFrames () const
 Get the number of Frames that are currently children of this Frame.
 
bool isShapeFrame () const
 Returns true if this Frame is a ShapeFrame.
 
virtual ShapeFrameasShapeFrame ()
 Convert 'this' into a ShapeFrame pointer if Frame is a ShapeFrame, otherwise return nullptr.
 
virtual const ShapeFrameasShapeFrame () const
 Convert 'const this' into a ShapeFrame pointer if Frame is a ShapeFrame, otherwise return nullptr.
 
bool isWorld () const
 Returns true if this Frame is the World Frame.
 
virtual void dirtyTransform () override
 Notify the transformation updates of this Frame and all its children are needed.
 
virtual void dirtyVelocity () override
 Notify the velocity updates of this Frame and all its children are needed.
 
virtual void dirtyAcceleration () override
 Notify the acceleration updates of this Frame and all its children are needed.
 
- Public Member Functions inherited from dart::dynamics::Entity
 Entity (Frame *_refFrame, bool _quiet)
 Constructor for typical usage.
 
 Entity ()
 Default constructor, delegates to Entity(ConstructAbstract_t)
 
 Entity (const Entity &)=delete
 
virtual ~Entity ()
 Destructor.
 
virtual const std::string & setName (const std::string &_name)=0
 Set name. More...
 
virtual const std::string & getName () const =0
 Return the name of this Entity.
 
FramegetParentFrame ()
 Get the parent (reference) frame of this Entity.
 
const FramegetParentFrame () const
 Get the parent (reference) frame of this Entity.
 
bool descendsFrom (const Frame *_someFrame) const
 Returns true if and only if this Entity is itself (i.e. More...
 
bool isFrame () const
 True iff this Entity is also a Frame.
 
bool isQuiet () const
 Returns true if this Entity is set to be quiet. More...
 
virtual void notifyTransformUpdate ()
 Notify the transformation update of this Entity that its parent Frame's pose is needed.
 
bool needsTransformUpdate () const
 Returns true iff a transform update is needed for this Entity.
 
virtual void notifyVelocityUpdate ()
 Notify the velocity update of this Entity that its parent Frame's velocity is needed.
 
bool needsVelocityUpdate () const
 Returns true iff a velocity update is needed for this Entity.
 
virtual void notifyAccelerationUpdate ()
 Notify the acceleration of this Entity that its parent Frame's acceleration is needed.
 
bool needsAccelerationUpdate () const
 Returns true iff an acceleration update is needed for this Entity.
 
- Public Member Functions inherited from dart::common::Subject
virtual ~Subject ()
 Destructor will notify all Observers that it is destructing.
 

Static Public Member Functions

static FrameWorld ()
 
static std::shared_ptr< FrameWorldShared ()
 

Protected Types

enum  ConstructAbstractTag { ConstructAbstract }
 Used when constructing a pure abstract class, because calling the Frame constructor is just a formality.
 
- Protected Types inherited from dart::dynamics::Entity
enum  ConstructFrameTag { ConstructFrame }
 Used when constructing a Frame class, because the Frame constructor will take care of setting up the parameters you pass into it.
 
enum  ConstructAbstractTag { ConstructAbstract }
 Used when constructing a pure abstract class, because calling the Entity constructor is just a formality.
 

Protected Member Functions

 Frame (Frame *_refFrame)
 Constructor for typical usage.
 
 Frame ()
 Default constructor, delegates to Frame(ConstructAbstract_t)
 
 Frame (ConstructAbstractTag)
 Constructor for use by pure abstract classes.
 
virtual void changeParentFrame (Frame *_newParentFrame) override
 Used by derived classes to change their parent frames.
 
virtual void processNewEntity (Entity *_newChildEntity)
 Called during a parent Frame change to allow extensions of the Frame class to handle new children in customized ways. More...
 
virtual void processRemovedEntity (Entity *_oldChildEntity)
 Called when a child Entity is removed from its parent Frame. More...
 
- Protected Member Functions inherited from dart::dynamics::Entity
 Entity (ConstructFrameTag)
 
 Entity (ConstructAbstractTag)
 
- Protected Member Functions inherited from dart::common::Subject
void sendDestructionNotification () const
 Send a destruction notification to all Observers. More...
 
void addObserver (Observer *_observer) const
 Add an Observer to the list of Observers.
 
void removeObserver (Observer *_observer) const
 Remove an Observer from the list of Observers.
 

Protected Attributes

Eigen::Isometry3d mWorldTransform
 World transform of this Frame. More...
 
Eigen::Vector6d mVelocity
 Total velocity of this Frame, in the coordinates of this Frame. More...
 
Eigen::Vector6d mAcceleration
 Total acceleration of this Frame, in the coordinates of this Frame. More...
 
std::set< Frame * > mChildFrames
 Container of this Frame's child Frames.
 
std::set< Entity * > mChildEntities
 Container of this Frame's child Entities.
 
- Protected Attributes inherited from dart::dynamics::Entity
FramemParentFrame
 Parent frame of this Entity.
 
bool mNeedTransformUpdate
 Does this Entity need a Transform update.
 
bool mNeedVelocityUpdate
 Does this Entity need a Velocity update.
 
bool mNeedAccelerationUpdate
 Does this Entity need an Acceleration update.
 
FrameChangedSignal mFrameChangedSignal
 Frame changed signal.
 
NameChangedSignal mNameChangedSignal
 Name changed signal.
 
EntitySignal mTransformUpdatedSignal
 Transform changed signal.
 
EntitySignal mVelocityChangedSignal
 Velocity changed signal.
 
EntitySignal mAccelerationChangedSignal
 Acceleration changed signal.
 
- Protected Attributes inherited from dart::common::Subject
std::set< Observer * > mObservers
 List of current Observers.
 

Friends

class Entity
 
class WorldFrame
 
class ShapeFrame
 

Additional Inherited Members

- Public Types inherited from dart::dynamics::Entity
using EntitySignal = common::Signal< void(const Entity *)>
 
using FrameChangedSignal = common::Signal< void(const Entity *, const Frame *_oldFrame, const Frame *_newFrame)>
 
using NameChangedSignal = common::Signal< void(const Entity *, const std::string &_oldName, const std::string &_newName)>
 
- Public Attributes inherited from dart::dynamics::Entity
common::SlotRegister< FrameChangedSignalonFrameChanged
 Slot register for frame changed signal.
 
common::SlotRegister< NameChangedSignalonNameChanged
 Slot register for name changed signal.
 
common::SlotRegister< EntitySignalonTransformUpdated
 Slot register for transform updated signal.
 
common::SlotRegister< EntitySignalonVelocityChanged
 Slot register for velocity updated signal.
 
common::SlotRegister< EntitySignalonAccelerationChanged
 Slot register for acceleration updated signal.
 

Detailed Description

The Frame class serves as the backbone of DART's kinematic tree structure.

Frame inherits Entity, so it exists within a reference Frame. This class keeps track of both its local (relative) and global (world) transforms, velocities, and accelerations. It also notifies every child Entity when a transform, velocity, or acceleration has changed locally or globally.

Entity class is inherited by using virtual inheritence to solve the so-called "diamond problem". Because of that, the Entity's constructor will be called directly by the most derived class's constructor.

Member Function Documentation

◆ getAngularAcceleration()

Eigen::Vector3d dart::dynamics::Frame::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.

It can be expressed in the coordinates of any Frame.

◆ getAngularVelocity()

Eigen::Vector3d dart::dynamics::Frame::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.

It can be expressed in the coordinates of any Frame.

◆ getChildEntities() [1/2]

const std::set< Entity * > & dart::dynamics::Frame::getChildEntities ( )

Get a container with the Entities that are children of this Frame.

std::set is used because Entities may be arbitrarily added and removed from a parent Frame, and each entry should be unique. std::set makes this procedure easier.

◆ getChildEntities() [2/2]

const std::set< const Entity * > dart::dynamics::Frame::getChildEntities ( ) const

Get a container with the Entities that are children of this Frame.

Note that this is version is slightly less efficient than the non-const version because it needs to rebuild a set where each pointer is converted to be a const pointer.

◆ getChildFrames() [1/2]

const std::set< Frame * > & dart::dynamics::Frame::getChildFrames ( )

Get a container with the Frames that are children of this Frame.

std::set is used because Frames may be arbitrarily added and removed from a parent Frame, and each entry should be unique.

◆ getChildFrames() [2/2]

std::set< const Frame * > dart::dynamics::Frame::getChildFrames ( ) const

Get a container with the Frames that are children of this Frame.

Note that this version is less efficient than the non-const version because it needs to rebuild a set so that the entries are const.

◆ getLinearAcceleration()

Eigen::Vector3d dart::dynamics::Frame::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.

It can be expressed in the coordinates of any Frame.

◆ getLinearVelocity() [1/2]

Eigen::Vector3d dart::dynamics::Frame::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.

It can be expressed in the coordinates of any Frame.

◆ getLinearVelocity() [2/2]

Eigen::Vector3d dart::dynamics::Frame::getLinearVelocity ( const Eigen::Vector3d &  _offset,
const Frame _relativeTo = Frame::World(),
const Frame _inCoordinatesOf = Frame::World() 
) const

Get the linear velocity of a point that is fixed in this Frame.

You can specify a relative Frame, and it can be expressed in the coordinates of any Frame.

◆ getPartialAcceleration()

virtual const Eigen::Vector6d& dart::dynamics::Frame::getPartialAcceleration ( ) const
pure virtual

The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as the partial acceleration.

This function returns that component of acceleration.

Implemented in dart::dynamics::BodyNode, dart::dynamics::WorldFrame, dart::dynamics::SimpleFrame, and dart::dynamics::FixedFrame.

◆ getPrimaryRelativeAcceleration()

virtual const Eigen::Vector6d& dart::dynamics::Frame::getPrimaryRelativeAcceleration ( ) const
pure virtual

The Featherstone ABI algorithm exploits a component of the spatial acceleration which we refer to as the partial acceleration, accessible by getPartialAcceleration().

We save operations during our forward kinematics by computing and storing the partial acceleration separately from the rest of the Frame's acceleration. getPrimaryRelativeAcceleration() will return the portion of the relative spatial acceleration that is not contained in the partial acceleration. To get the full spatial acceleration of this Frame relative to its parent Frame, use getRelativeSpatialAcceleration(). To get the full spatial acceleration of this Frame relative to the World Frame, use getSpatialAcceleration().

Implemented in dart::dynamics::BodyNode, dart::dynamics::WorldFrame, dart::dynamics::SimpleFrame, and dart::dynamics::FixedFrame.

◆ getRelativeSpatialAcceleration()

virtual const Eigen::Vector6d& dart::dynamics::Frame::getRelativeSpatialAcceleration ( ) const
pure virtual

Get the spatial acceleration of this Frame relative to its parent Frame, in the coordinates of this Frame.

Implemented in dart::dynamics::BodyNode, dart::dynamics::WorldFrame, dart::dynamics::SimpleFrame, and dart::dynamics::FixedFrame.

◆ getRelativeSpatialVelocity()

virtual const Eigen::Vector6d& dart::dynamics::Frame::getRelativeSpatialVelocity ( ) const
pure virtual

Get the spatial velocity of this Frame relative to its parent Frame, in its own coordinates.

Implemented in dart::dynamics::BodyNode, dart::dynamics::WorldFrame, dart::dynamics::SimpleFrame, and dart::dynamics::FixedFrame.

◆ getSpatialAcceleration() [1/3]

const Eigen::Vector6d & dart::dynamics::Frame::getSpatialAcceleration ( ) const

Get the total spatial acceleration of this Frame in the coordinates of this Frame.

◆ getSpatialAcceleration() [2/3]

Eigen::Vector6d dart::dynamics::Frame::getSpatialAcceleration ( const Frame _relativeTo,
const Frame _inCoordinatesOf 
) const

Get the spatial acceleration of this Frame relative to some other Frame.

It can be expressed in the coordinates of any Frame.

◆ getSpatialAcceleration() [3/3]

Eigen::Vector6d dart::dynamics::Frame::getSpatialAcceleration ( const Eigen::Vector3d &  _offset) const

Get the spatial acceleration of a fixed point in this Frame.

The acceleration is in coordinates of this Frame and is relative to the World Frame.

◆ getSpatialVelocity() [1/3]

const Eigen::Vector6d & dart::dynamics::Frame::getSpatialVelocity ( ) const

Get the total spatial velocity of this Frame in the coordinates of this Frame.

◆ getSpatialVelocity() [2/3]

Eigen::Vector6d dart::dynamics::Frame::getSpatialVelocity ( const Frame _relativeTo,
const Frame _inCoordinatesOf 
) const

Get the spatial velocity of this Frame relative to some other Frame.

It can be expressed in the coordinates of any Frame.

◆ getSpatialVelocity() [3/3]

Eigen::Vector6d dart::dynamics::Frame::getSpatialVelocity ( const Eigen::Vector3d &  _offset) const

Get the spatial velocity of a fixed point in this Frame.

The velocity is in coordinates of this Frame and is relative to the World Frame.

◆ getTransform()

Eigen::Isometry3d dart::dynamics::Frame::getTransform ( const Frame withRespectTo,
const Frame inCoordinatesOf 
) const

Get the transform of this Frame with respect to some other Frame.

It can be expressed in the coordinates of any Frame.

◆ processNewEntity()

void dart::dynamics::Frame::processNewEntity ( Entity _newChildEntity)
protectedvirtual

Called during a parent Frame change to allow extensions of the Frame class to handle new children in customized ways.

This function is a no op unless an inheriting class (such as BodyNode) overrides it.

Reimplemented in dart::dynamics::BodyNode.

◆ processRemovedEntity()

void dart::dynamics::Frame::processRemovedEntity ( Entity _oldChildEntity)
protectedvirtual

Called when a child Entity is removed from its parent Frame.

This allows special post-processing to be performed for extensions of the Frame class.

Reimplemented in dart::dynamics::BodyNode.

Member Data Documentation

◆ mAcceleration

Eigen::Vector6d dart::dynamics::Frame::mAcceleration
mutableprotected

Total acceleration of this Frame, in the coordinates of this Frame.

Do not use directly! Use getSpatialAcceleration() to access this quantity

◆ mVelocity

Eigen::Vector6d dart::dynamics::Frame::mVelocity
mutableprotected

Total velocity of this Frame, in the coordinates of this Frame.

Do not use directly! Use getSpatialVelocity() to access this quantity

◆ mWorldTransform

Eigen::Isometry3d dart::dynamics::Frame::mWorldTransform
mutableprotected

World transform of this Frame.

This object is mutable to enable auto-updating to happen in the const member getWorldTransform() function

Do not use directly! Use getWorldTransform() to access this quantity


The documentation for this class was generated from the following files: