Drake
Body< T > Class Template Referenceabstract

Body provides the general abstraction of a body with an API that makes no assumption about whether a body is rigid or deformable and neither does it make any assumptions about the underlying physical model or approximation. More...

#include <multibody/multibody_tree/body.h>

Inheritance diagram for Body< T >:
[legend]
Collaboration diagram for Body< T >:
[legend]

Public Member Functions

 Body ()
 Creates a Body with a BodyFrame associated with it. More...
 
virtual int get_num_flexible_positions () const =0
 Returns the number of generalized positions q describing flexible deformations for this body. More...
 
virtual int get_num_flexible_velocities () const =0
 Returns the number of generalized velocities v describing flexible deformations for this body. More...
 
const BodyFrame< T > & get_body_frame () const
 Returns a const reference to the associated BodyFrame. More...
 
BodyNodeIndex get_node_index () const
 Returns the index of the node in the underlying tree structure of the parent MultibodyTree to which this body belongs. More...
 
virtual T get_mass (const MultibodyTreeContext< T > &context) const =0
 Returns the mass of this body stored in context. More...
 
virtual const Vector3< T > CalcCenterOfMassInBodyFrame (const MultibodyTreeContext< T > &context) const =0
 Computes the center of mass p_BoBcm_B (or p_Bcm for short) of this body measured from this body's frame origin Bo and expressed in the body frame B. More...
 
virtual SpatialInertia< T > CalcSpatialInertiaInBodyFrame (const MultibodyTreeContext< T > &context) const =0
 Computes the SpatialInertia I_BBo_B of this body about its frame origin Bo (not necessarily its center of mass) and expressed in its body frame B. More...
 
template<typename ToScalar >
std::unique_ptr< Body< ToScalar > > CloneToScalar (const MultibodyTree< ToScalar > &tree_clone) const
 NVI (Non-Virtual Interface) to DoCloneToScalar() templated on the scalar type of the new clone to be created. More...
 
Does not allow copy, move, or assignment
 Body (const Body &)=delete
 
Bodyoperator= (const Body &)=delete
 
 Body (Body &&)=delete
 
Bodyoperator= (Body &&)=delete
 

Protected Member Functions

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 Body subclasses might specify a number of prerequisites on the cloned tree and therefore require it to be at a given state of cloning (for instance requiring that the cloned tree already contains all the frames in the world as in the original tree.) See MultibodyTree::CloneToScalar() for a list of prerequisites that are guaranteed to be satisfied during the cloning process.

virtual std::unique_ptr< Body< double > > DoCloneToScalar (const MultibodyTree< double > &tree_clone) const =0
 Clones this Body (templated on T) to a body templated on double. More...
 
virtual std::unique_ptr< Body< AutoDiffXd > > DoCloneToScalar (const MultibodyTree< AutoDiffXd > &tree_clone) const =0
 Clones this Body (templated on T) to a body templated on AutoDiffXd. More...
 

Friends

class internal::BodyAttorney< T >
 

Detailed Description

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

Body provides the general abstraction of a body with an API that makes no assumption about whether a body is rigid or deformable and neither does it make any assumptions about the underlying physical model or approximation.

As an element or component of a MultibodyTree, a body is a MultibodyTreeElement, and therefore it has a unique index of type BodyIndex within the multibody tree it belongs to.

A Body contains a unique BodyFrame; see BodyFrame class documentation for more information.

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

Constructor & Destructor Documentation

Body ( const Body< T > &  )
delete
Body ( Body< T > &&  )
delete
Body ( )
inline

Creates a Body with a BodyFrame associated with it.

Member Function Documentation

virtual const Vector3<T> CalcCenterOfMassInBodyFrame ( const MultibodyTreeContext< T > &  context) const
pure virtual

Computes the center of mass p_BoBcm_B (or p_Bcm for short) of this body measured from this body's frame origin Bo and expressed in the body frame B.

Implemented in RigidBody< T >, and RigidBody< double >.

Here is the caller graph for this function:

virtual SpatialInertia<T> CalcSpatialInertiaInBodyFrame ( const MultibodyTreeContext< T > &  context) const
pure virtual

Computes the SpatialInertia I_BBo_B of this body about its frame origin Bo (not necessarily its center of mass) and expressed in its body frame B.

In general, the spatial inertia of a body is a function of state. Consider for instance the case of a flexible body for which its spatial inertia in the body frame depends on the generalized coordinates describing its state of deformation. As a particular case, the spatial inertia of a RigidBody in its body frame is constant.

Implemented in RigidBody< T >, and RigidBody< double >.

Here is the caller graph for this function:

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

NVI (Non-Virtual Interface) 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()
virtual std::unique_ptr<Body<double> > DoCloneToScalar ( const MultibodyTree< double > &  tree_clone) const
protectedpure virtual

Clones this Body (templated on T) to a body templated on double.

Implemented in RigidBody< T >, and RigidBody< double >.

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

Clones this Body (templated on T) to a body templated on AutoDiffXd.

Implemented in RigidBody< T >, and RigidBody< double >.

const BodyFrame<T>& get_body_frame ( ) const
inline

Returns a const reference to the associated BodyFrame.

Here is the caller graph for this function:

virtual T get_mass ( const MultibodyTreeContext< T > &  context) const
pure virtual

Returns the mass of this body stored in context.

Implemented in RigidBody< T >, and RigidBody< double >.

Here is the caller graph for this function:

BodyNodeIndex get_node_index ( ) const
inline

Returns the index of the node in the underlying tree structure of the parent MultibodyTree to which this body belongs.

Here is the caller graph for this function:

virtual int get_num_flexible_positions ( ) const
pure virtual

Returns the number of generalized positions q describing flexible deformations for this body.

A rigid body will therefore return zero.

Implemented in RigidBody< T >, and RigidBody< double >.

virtual int get_num_flexible_velocities ( ) const
pure virtual

Returns the number of generalized velocities v describing flexible deformations for this body.

A rigid body will therefore return zero.

Implemented in RigidBody< T >, and RigidBody< double >.

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

Friends And Related Function Documentation

friend class internal::BodyAttorney< T >
friend

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