Drake
Frame< T > Class Template Referenceabstract

Frame is an abstract class representing a material frame (also called a physical frame), meaning that it is associated with a material point of a Body. More...

#include <drake/multibody/tree/frame.h>

Public Member Functions

const Body< T > & body () const
 Returns a const reference to the body associated to this Frame. More...
 
const std::string & name () const
 Returns the name of this frame. It may be empty if unnamed. More...
 
virtual Isometry3< T > CalcPoseInBodyFrame (const systems::Context< T > &context) const =0
 Returns the pose X_BF of this frame F in the body frame B associated with this frame. More...
 
virtual Isometry3< T > GetFixedPoseInBodyFrame () const
 Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this frame F in the body frame B associated with this frame. More...
 
virtual Isometry3< T > CalcOffsetPoseInBody (const systems::Context< T > &context, const Isometry3< T > &X_FQ) const
 Given the offset pose X_FQ of a frame Q in this frame F, this method computes the pose X_BQ of frame Q in the body frame B to which this frame is attached. More...
 
virtual Isometry3< T > GetFixedOffsetPoseInBody (const Isometry3< T > &X_FQ) const
 Variant of CalcOffsetPoseInBody() that given the offset pose X_FQ of a frame Q in this frame F, returns the pose X_BQ of frame Q in the body frame B to which this frame is attached. More...
 
template<typename ToScalar >
std::unique_ptr< Frame< ToScalar > > CloneToScalar (const MultibodyTree< ToScalar > &tree_clone) const
 NVI to DoCloneToScalar() templated on the scalar type of the new clone to be created. More...
 
Does not allow copy, move, or assignment
 Frame (const Frame &)=delete
 
Frameoperator= (const Frame &)=delete
 
 Frame (Frame &&)=delete
 
Frameoperator= (Frame &&)=delete
 

Protected Member Functions

 Frame (const std::string &name, const Body< T > &body, optional< ModelInstanceIndex > model_instance={})
 Only derived classes can use this constructor. More...
 
 Frame (const Body< T > &body)
 Overload to permit constructing an unnamed frame. More...
 
Methods to make a clone templated on different scalar types.

These methods are meant to be called by MultibodyTree::CloneToScalar() when making a clone of the entire tree or a new instance templated on a different scalar type.

The only const argument to these methods is the new MultibodyTree clone under construction. Specific Frame subclasses might specify a number of prerequisites on the cloned tree and therefore require it to be at a given state of cloning. See MultibodyTree::CloneToScalar() for a list of prerequisites that are guaranteed to be satisfied during the cloning process.

virtual std::unique_ptr< Frame< double > > DoCloneToScalar (const MultibodyTree< double > &tree_clone) const =0
 Clones this Frame (templated on T) to a frame templated on double. More...
 
virtual std::unique_ptr< Frame< AutoDiffXd > > DoCloneToScalar (const MultibodyTree< AutoDiffXd > &tree_clone) const =0
 Clones this Frame (templated on T) to a frame templated on AutoDiffXd. More...
 
- Protected Member Functions inherited from FrameBase< T >
 FrameBase (ModelInstanceIndex model_instance)
 

Detailed Description

template<typename T>
class drake::multibody::Frame< T >

Frame is an abstract class representing a material frame (also called a physical frame), meaning that it is associated with a material point of a Body.

A material frame can be used to apply forces and torques to a multibody system, and can be used as an attachment point for force-producing elements like joints, actuators, and constraints. Despite its name, Frame is not the most general frame representation in Drake; see FrameBase for a more-general discussion.

The pose and motion of a Frame object is always calculated relative to the BodyFrame of the body with which it is associated, and every Frame object can report which Body object that is. Concrete classes derived from Frame differ only in how those kinematic properties are calculated. For soft bodies that calculation may depend on the body's deformation state variables. A Frame on a rigid body will usually have a fixed offset from its BodyFrame, but that is not required – a frame that moves with respect to its BodyFrame can still be a material frame on that rigid body.

As always in Drake, runtime numerical quantities are stored in a Context. A Frame object does not store runtime values, but provides methods for extracting frame-associated values (such as the Frame object's kinematics) from a given Context.

Template Parameters
TThe scalar type. Must be a valid Eigen scalar.

Constructor & Destructor Documentation

◆ Frame() [1/4]

Frame ( const Frame< T > &  )
delete

◆ Frame() [2/4]

Frame ( Frame< T > &&  )
delete

◆ Frame() [3/4]

Frame ( const std::string &  name,
const Body< T > &  body,
optional< ModelInstanceIndex model_instance = {} 
)
inlineexplicitprotected

Only derived classes can use this constructor.

It creates a Frame object attached to body and puts the frame in the body's model instance.

◆ Frame() [4/4]

Frame ( const Body< T > &  body)
inlineexplicitprotected

Overload to permit constructing an unnamed frame.

Member Function Documentation

◆ body()

const Body<T>& body ( ) const
inline

Returns a const reference to the body associated to this Frame.

◆ CalcOffsetPoseInBody()

virtual Isometry3<T> CalcOffsetPoseInBody ( const systems::Context< T > &  context,
const Isometry3< T > &  X_FQ 
) const
inlinevirtual

Given the offset pose X_FQ of a frame Q in this frame F, this method computes the pose X_BQ of frame Q in the body frame B to which this frame is attached.

In other words, if the pose of this frame F in the body frame B is X_BF, this method computes the pose X_BQ of frame Q in the body frame B as X_BQ = X_BF * X_FQ. In particular, if this isthe body frame B, i.e.X_BFis the identity transformation, this method directly returnsX_FQ`. Specific frame subclasses can override this method to provide faster implementations if needed.

Reimplemented in BodyFrame< T >, BodyFrame< double >, and BodyFrame< AutoDiffXd >.

◆ CalcPoseInBodyFrame()

virtual Isometry3<T> CalcPoseInBodyFrame ( const systems::Context< T > &  context) const
pure virtual

Returns the pose X_BF of this frame F in the body frame B associated with this frame.

In particular, if this is the body frame B, this method directly returns the identity transformation.

Implemented in FixedOffsetFrame< T >, BodyFrame< T >, BodyFrame< double >, and BodyFrame< AutoDiffXd >.

◆ CloneToScalar()

std::unique_ptr<Frame<ToScalar> > CloneToScalar ( const MultibodyTree< ToScalar > &  tree_clone) const
inline

NVI to DoCloneToScalar() templated on the scalar type of the new clone to be created.

This method is mostly intended to be called by MultibodyTree::CloneToScalar(). Most users should not call this clone method directly but rather clone the entire parent MultibodyTree if needed.

See also
MultibodyTree::CloneToScalar()

◆ DoCloneToScalar() [1/2]

virtual std::unique_ptr<Frame<double> > DoCloneToScalar ( const MultibodyTree< double > &  tree_clone) const
protectedpure virtual

Clones this Frame (templated on T) to a frame templated on double.

Implemented in FixedOffsetFrame< T >, BodyFrame< T >, BodyFrame< double >, and BodyFrame< AutoDiffXd >.

◆ DoCloneToScalar() [2/2]

virtual std::unique_ptr<Frame<AutoDiffXd> > DoCloneToScalar ( const MultibodyTree< AutoDiffXd > &  tree_clone) const
protectedpure virtual

Clones this Frame (templated on T) to a frame templated on AutoDiffXd.

Implemented in FixedOffsetFrame< T >, BodyFrame< T >, BodyFrame< double >, and BodyFrame< AutoDiffXd >.

◆ GetFixedOffsetPoseInBody()

virtual Isometry3<T> GetFixedOffsetPoseInBody ( const Isometry3< T > &  X_FQ) const
inlinevirtual

Variant of CalcOffsetPoseInBody() that given the offset pose X_FQ of a frame Q in this frame F, returns the pose X_BQ of frame Q in the body frame B to which this frame is attached.

Exceptions
std::logic_errorif called on a Frame that does not have a fixed offset in the body frame.

Reimplemented in BodyFrame< T >, BodyFrame< double >, and BodyFrame< AutoDiffXd >.

◆ GetFixedPoseInBodyFrame()

virtual Isometry3<T> GetFixedPoseInBodyFrame ( ) const
inlinevirtual

Variant of CalcPoseInBodyFrame() that returns the fixed pose X_BF of this frame F in the body frame B associated with this frame.

Exceptions
std::logic_errorif called on a Frame that does not have a fixed offset in the body frame.

Reimplemented in FixedOffsetFrame< T >, BodyFrame< T >, BodyFrame< double >, and BodyFrame< AutoDiffXd >.

◆ name()

const std::string& name ( ) const
inline

Returns the name of this frame. It may be empty if unnamed.

◆ operator=() [1/2]

Frame& operator= ( const Frame< T > &  )
delete

◆ operator=() [2/2]

Frame& operator= ( Frame< T > &&  )
delete

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