Drake

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>
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 (NonVirtual 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  
Body &  operator= (const Body &)=delete 
Body (Body &&)=delete  
Body &  operator= (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 > 
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.
T  The scalar type. Must be a valid Eigen scalar. 

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 >.

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 >.

inline 
NVI (NonVirtual 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.

protectedpure virtual 
Clones this Body (templated on T) to a body templated on double
.
Implemented in RigidBody< T >, and RigidBody< double >.

protectedpure virtual 
Clones this Body (templated on T) to a body templated on AutoDiffXd.
Implemented in RigidBody< T >, and RigidBody< double >.

inline 

pure virtual 
Returns the mass of this body stored in context
.
Implemented in RigidBody< T >, and RigidBody< double >.

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

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 >.

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 >.

friend 