Drake
PrismaticMobilizer< T > Class Template Referencefinal

This Mobilizer allows two frames to translate relative to one another along an axis whose direction is constant when measured in either this mobilizer's inboard frame or its outboard frame. More...

#include <drake/multibody/multibody_tree/prismatic_mobilizer.h>

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

Public Member Functions

 PrismaticMobilizer (const Frame< T > &inboard_frame_F, const Frame< T > &outboard_frame_M, const Vector3< double > &axis_F)
 Constructor for a PrismaticMobilizer between the inboard_frame_F and outboard_frame_M granting a single translational degree of freedom along axis_F, expressed in the inboard_frame_F. More...
 
const Vector3< double > & translation_axis () const
 
const T & get_translation (const systems::Context< T > &context) const
 Gets the translational distance for this mobilizer from context. More...
 
const PrismaticMobilizer< T > & set_translation (systems::Context< T > *context, const T &translation) const
 Sets context so that the generalized coordinate corresponding to the translation for this mobilizer equals translation. More...
 
const T & get_translation_rate (const systems::Context< T > &context) const
 Gets the rate of change, in meters per second, of this mobilizer's translation (see get_translation()) from context. More...
 
const PrismaticMobilizer< T > & set_translation_rate (systems::Context< T > *context, const T &translation_dot) const
 Sets the rate of change, in meters per second, of this mobilizer's translation to translation_dot. More...
 
void set_zero_state (const systems::Context< T > &context, systems::State< T > *state) const final
 Sets state to store a zero translation and translational rate. More...
 
Isometry3< T > CalcAcrossMobilizerTransform (const MultibodyTreeContext< T > &context) const final
 Computes the across-mobilizer transform X_FM(q) between the inboard frame F and the outboard frame M as a function of the translation distance along this mobilizer's axis (see translation_axis().) The generalized coordinate q for this mobilizer (the translation distance) is read from in context. More...
 
SpatialVelocity< T > CalcAcrossMobilizerSpatialVelocity (const MultibodyTreeContext< T > &context, const Eigen::Ref< const VectorX< T >> &v) const final
 Computes the across-mobilizer velocity V_FM(q, v) of the outboard frame M measured and expressed in frame F as a function of the translation taken from context and input translational velocity v along this mobilizer's axis (see translation_axis()). More...
 
SpatialAcceleration< T > CalcAcrossMobilizerSpatialAcceleration (const MultibodyTreeContext< T > &context, const Eigen::Ref< const VectorX< T >> &vdot) const final
 Computes the across-mobilizer acceleration A_FM(q, v, v̇) of the outboard frame M in the inboard frame F. More...
 
void ProjectSpatialForce (const MultibodyTreeContext< T > &context, const SpatialForce< T > &F_Mo_F, Eigen::Ref< VectorX< T >> tau) const final
 Projects the spatial force F_Mo_F on this mobilizer's outboard frame M onto its translation axis (see translation_axis().) Mathematically: More...
 
void MapVelocityToQDot (const MultibodyTreeContext< T > &context, const Eigen::Ref< const VectorX< T >> &v, EigenPtr< VectorX< T >> qdot) const final
 Computes the kinematic mapping from generalized velocities v to time derivatives of the generalized positions . More...
 
void MapQDotToVelocity (const MultibodyTreeContext< T > &context, const Eigen::Ref< const VectorX< T >> &qdot, EigenPtr< VectorX< T >> v) const final
 Computes the kinematic mapping from time derivatives of the generalized positions to generalized velocities v. More...
 
Does not allow copy, move, or assignment
 PrismaticMobilizer (const PrismaticMobilizer &)=delete
 
PrismaticMobilizeroperator= (const PrismaticMobilizer &)=delete
 
 PrismaticMobilizer (PrismaticMobilizer &&)=delete
 
PrismaticMobilizeroperator= (PrismaticMobilizer &&)=delete
 
- Public Member Functions inherited from MobilizerImpl< T, 1, 1 >
 MobilizerImpl (const Frame< T > &inboard_frame, const Frame< T > &outboard_frame)
 As with Mobilizer this the only constructor available for this base class. More...
 
int num_positions () const final
 Returns the number of generalized coordinates granted by this mobilizer. More...
 
int num_velocities () const final
 Returns the number of generalized velocities granted by this mobilizer. More...
 
std::unique_ptr< internal::BodyNode< T > > CreateBodyNode (const internal::BodyNode< T > *parent_node, const Body< T > *body, const Mobilizer< T > *mobilizer) const final
 For MultibodyTree internal use only. More...
 
 MobilizerImpl (const MobilizerImpl &)=delete
 
 MobilizerImpl (MobilizerImpl &&)=delete
 
MobilizerImploperator= (const MobilizerImpl &)=delete
 
MobilizerImploperator= (MobilizerImpl &&)=delete
 
- Public Member Functions inherited from Mobilizer< T >
 Mobilizer (const Frame< T > &inboard_frame, const Frame< T > &outboard_frame)
 The minimum amount of information that we need to define a Mobilizer is the knowledge of the inboard and outboard frames it connects. More...
 
const Frame< T > & inboard_frame () const
 Returns a constant reference to the inboard frame. More...
 
const Frame< T > & outboard_frame () const
 Returns a constant reference to the outboard frame. More...
 
const Body< T > & inboard_body () const
 Returns a constant reference to the body associated with this mobilizer's inboard frame. More...
 
const Body< T > & outboard_body () const
 Returns a constant reference to the body associated with this mobilizer's outboard frame. More...
 
const MobilizerTopologyget_topology () const
 Returns the topology information for this mobilizer. More...
 
Eigen::VectorBlock< const Eigen::Ref< const VectorX< T > > > get_positions_from_array (const Eigen::Ref< const VectorX< T >> &q_array) const
 Returns a const Eigen expression of the vector of generalized positions for this mobilizer from a vector q_array of generalized positions for the entire MultibodyTree model. More...
 
Eigen::VectorBlock< Eigen::Ref< VectorX< T > > > get_mutable_positions_from_array (EigenPtr< VectorX< T >> q_array) const
 Mutable version of get_positions_from_array(). More...
 
Eigen::VectorBlock< const Eigen::Ref< const VectorX< T > > > get_velocities_from_array (const Eigen::Ref< const VectorX< T >> &v_array) const
 Returns a const Eigen expression of the vector of generalized velocities for this mobilizer from a vector v_array of generalized velocities for the entire MultibodyTree model. More...
 
Eigen::VectorBlock< Eigen::Ref< VectorX< T > > > get_mutable_velocities_from_array (EigenPtr< VectorX< T >> v_array) const
 Mutable version of get_velocities_from_array(). More...
 
Eigen::VectorBlock< const Eigen::Ref< const VectorX< T > > > get_accelerations_from_array (const Eigen::Ref< const VectorX< T >> &vdot_array) const
 Returns a const Eigen expression of the vector of generalized accelerations for this mobilizer from a vector vdot_array of generalized accelerations for the entire MultibodyTree model. More...
 
Eigen::VectorBlock< Eigen::Ref< VectorX< T > > > get_mutable_accelerations_from_array (EigenPtr< VectorX< T >> vdot_array) const
 Mutable version of get_accelerations_from_array(). More...
 
Eigen::VectorBlock< const Eigen::Ref< const VectorX< T > > > get_generalized_forces_from_array (const Eigen::Ref< const VectorX< T >> &tau_array) const
 Returns a const Eigen expression of the vector of generalized forces for this mobilizer from a vector of generalized forces for the entire MultibodyTree model. More...
 
Eigen::VectorBlock< Eigen::Ref< VectorX< T > > > get_mutable_generalized_forces_from_array (EigenPtr< VectorX< T >> tau_array) const
 Mutable version of get_generalized_forces_from_array(). More...
 
template<typename ToScalar >
std::unique_ptr< Mobilizer< ToScalar > > CloneToScalar (const MultibodyTree< ToScalar > &cloned_tree) const
 NVI to DoCloneToScalar() templated on the scalar type of the new clone to be created. More...
 
 Mobilizer (const Mobilizer &)=delete
 
Mobilizeroperator= (const Mobilizer &)=delete
 
 Mobilizer (Mobilizer &&)=delete
 
Mobilizeroperator= (Mobilizer &&)=delete
 
void set_zero_configuration (systems::Context< T > *context) const
 Sets the state stored in context to a zero configuration as defined by set_zero_state(). More...
 

Protected Member Functions

std::unique_ptr< Mobilizer< double > > DoCloneToScalar (const MultibodyTree< double > &tree_clone) const final
 Clones this Mobilizer (templated on T) to a mobilizer templated on double. More...
 
std::unique_ptr< Mobilizer< AutoDiffXd > > DoCloneToScalar (const MultibodyTree< AutoDiffXd > &tree_clone) const final
 Clones this Mobilizer (templated on T) to a mobilizer templated on AutoDiffXd. More...
 
- Protected Member Functions inherited from MobilizerImpl< T, 1, 1 >
MultibodyTreeContext< T > & GetMutableMultibodyTreeContextOrThrow (systems::Context< T > *context) const
 Helper method to retrieve a mutable pointer to the MultibodyTreeContext object referenced by context. More...
 
void set_default_zero_state (const systems::Context< T > &context, systems::State< T > *state) const
 Helper to set state to a default zero state with all generalized positions and generalized velocities related to this mobilizer to zero. More...
 
Eigen::VectorBlock< const VectorX< T >, kNqget_positions (const MultibodyTreeContext< T > &context) const
 Helper to return a const fixed-size Eigen::VectorBlock referencing the segment in the state vector corresponding to this mobilizer's state. More...
 
Eigen::VectorBlock< VectorX< T >, kNqget_mutable_positions (MultibodyTreeContext< T > *context) const
 Helper to return a mutable fixed-size Eigen::VectorBlock referencing the segment in the state vector corresponding to this mobilizer's state. More...
 
Eigen::VectorBlock< VectorX< T >, kNqget_mutable_positions (const systems::Context< T > &context, systems::State< T > *state) const
 Helper variant to return a const fixed-size Eigen::VectorBlock referencing the segment in the state corresponding to this mobilizer's generalized positions. More...
 
Eigen::VectorBlock< VectorX< T > > get_mutable_state_vector (const systems::Context< T > &context, systems::State< T > *state) const
 Returns a mutable reference to the state vector stored in state as an Eigen::VectorBlock<VectorX<T>>. More...
 
Eigen::VectorBlock< VectorX< T >, kNvget_mutable_velocities (const systems::Context< T > &context, systems::State< T > *state) const
 Helper variant to return a const fixed-size Eigen::VectorBlock referencing the segment in the state corresponding to this mobilizer's generalized velocities. More...
 
Eigen::VectorBlock< VectorX< T >, kNvget_mutable_velocities (MultibodyTreeContext< T > *context) const
 Helper to return a mutable fixed-size Eigen::VectorBlock referencing the segment in the state vector corresponding to this mobilizer's state. More...
 
Eigen::VectorBlock< const VectorX< T >, kNvget_velocities (const MultibodyTreeContext< T > &context) const
 Helper to return a const fixed-size Eigen::VectorBlock referencing the segment in the state vector corresponding to this mobilizer's state. More...
 
Methods to make a clone templated on different scalar types.

The only const argument to these methods is the new MultibodyTree clone under construction, which is required to already own the clones of the inboard and outboard frames of the mobilizer being cloned.

Additional Inherited Members

- Protected Types inherited from MobilizerImpl< T, 1, 1 >
enum  
 
- Static Protected Member Functions inherited from MobilizerImpl< T, 1, 1 >
static const MultibodyTreeContext< T > & GetMultibodyTreeContextOrThrow (const systems::Context< T > &context)
 Helper method to retrieve a const reference to the MultibodyTreeContext object referenced by context. More...
 

Detailed Description

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

This Mobilizer allows two frames to translate relative to one another along an axis whose direction is constant when measured in either this mobilizer's inboard frame or its outboard frame.

There is no relative rotation between the inboard and outboard frames, just translation. To fully specify this mobilizer, a user must provide the inboard frame F, the outboard (or "mobilized") frame M and the axis axis_F (expressed in frame F) along which frame M translates with respect to frame F. The single generalized coordinate q introduced by this mobilizer corresponds to the translation distance (in meters) of the origin Mo of frame M with respect to frame F along axis_F. When q = 0, frames F and M are coincident. The translation distance is defined to be positive in the direction of axis_F.

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

Instantiated templates for the following kinds of T's are provided:

  • double
  • AutoDiffXd

They are already available to link against in the containing library. No other values for T are currently supported.

Constructor & Destructor Documentation

PrismaticMobilizer ( const PrismaticMobilizer< T > &  )
delete
PrismaticMobilizer ( PrismaticMobilizer< T > &&  )
delete
PrismaticMobilizer ( const Frame< T > &  inboard_frame_F,
const Frame< T > &  outboard_frame_M,
const Vector3< double > &  axis_F 
)
inline

Constructor for a PrismaticMobilizer between the inboard_frame_F and outboard_frame_M granting a single translational degree of freedom along axis_F, expressed in the inboard_frame_F.

Precondition
axis_F must be a non-zero vector with norm at least root square of machine epsilon. This vector can have any length, only the direction is used.
Exceptions
std::exceptionif the L2 norm of axis_F is less than the square root of machine epsilon.

Here is the call graph for this function:

Member Function Documentation

SpatialAcceleration< T > CalcAcrossMobilizerSpatialAcceleration ( const MultibodyTreeContext< T > &  context,
const Eigen::Ref< const VectorX< T >> &  vdot 
) const
finalvirtual

Computes the across-mobilizer acceleration A_FM(q, v, v̇) of the outboard frame M in the inboard frame F.

By definition A_FM = d_F(V_FM)/dt. The acceleration A_FM will be a function of the translation distance q, its rate of change v for the current state in context and of the input generalized acceleration v̇ = dv/dt, the rate of change of v. See class documentation for the translation sign convention. This method aborts in Debug builds if vdot.size() is not one.

Implements Mobilizer< T >.

Here is the caller graph for this function:

SpatialVelocity< T > CalcAcrossMobilizerSpatialVelocity ( const MultibodyTreeContext< T > &  context,
const Eigen::Ref< const VectorX< T >> &  v 
) const
finalvirtual

Computes the across-mobilizer velocity V_FM(q, v) of the outboard frame M measured and expressed in frame F as a function of the translation taken from context and input translational velocity v along this mobilizer's axis (see translation_axis()).

The generalized coordinate q for this mobilizer (the translation distance) is read from in context. This method aborts in Debug builds if v.size() is not one.

Implements Mobilizer< T >.

Here is the caller graph for this function:

Isometry3< T > CalcAcrossMobilizerTransform ( const MultibodyTreeContext< T > &  context) const
finalvirtual

Computes the across-mobilizer transform X_FM(q) between the inboard frame F and the outboard frame M as a function of the translation distance along this mobilizer's axis (see translation_axis().) The generalized coordinate q for this mobilizer (the translation distance) is read from in context.

Implements Mobilizer< T >.

Here is the caller graph for this function:

std::unique_ptr< Mobilizer< double > > DoCloneToScalar ( const MultibodyTree< double > &  tree_clone) const
finalprotectedvirtual

Clones this Mobilizer (templated on T) to a mobilizer templated on double.

Precondition
Inboard and outboard frames for this mobilizer already have a clone in tree_clone.

Implements Mobilizer< T >.

Here is the caller graph for this function:

std::unique_ptr< Mobilizer< AutoDiffXd > > DoCloneToScalar ( const MultibodyTree< AutoDiffXd > &  tree_clone) const
finalprotectedvirtual

Clones this Mobilizer (templated on T) to a mobilizer templated on AutoDiffXd.

Precondition
Inboard and outboard frames for this mobilizer already have a clone in tree_clone.

Implements Mobilizer< T >.

const T & get_translation ( const systems::Context< T > &  context) const

Gets the translational distance for this mobilizer from context.

See class documentation for sign convention details.

Exceptions
std::logic_errorif context is not a valid MultibodyTreeContext.
Parameters
[in]contextThe context of the MultibodyTree this mobilizer belongs to.
Returns
The translation coordinate of this mobilizer in the context.

Here is the caller graph for this function:

const T & get_translation_rate ( const systems::Context< T > &  context) const

Gets the rate of change, in meters per second, of this mobilizer's translation (see get_translation()) from context.

See class documentation for the translation sign convention.

Parameters
[in]contextThe context of the MultibodyTree this mobilizer belongs to.
Returns
The rate of change of this mobilizer's translation in the context.

Here is the caller graph for this function:

void MapQDotToVelocity ( const MultibodyTreeContext< T > &  context,
const Eigen::Ref< const VectorX< T >> &  qdot,
EigenPtr< VectorX< T >>  v 
) const
finalvirtual

Computes the kinematic mapping from time derivatives of the generalized positions to generalized velocities v.

For this mobilizer v = q̇.

Implements Mobilizer< T >.

Here is the call graph for this function:

Here is the caller graph for this function:

void MapVelocityToQDot ( const MultibodyTreeContext< T > &  context,
const Eigen::Ref< const VectorX< T >> &  v,
EigenPtr< VectorX< T >>  qdot 
) const
finalvirtual

Computes the kinematic mapping from generalized velocities v to time derivatives of the generalized positions .

For this mobilizer q̇ = v.

Implements Mobilizer< T >.

Here is the caller graph for this function:

PrismaticMobilizer& operator= ( const PrismaticMobilizer< T > &  )
delete
PrismaticMobilizer& operator= ( PrismaticMobilizer< T > &&  )
delete
void ProjectSpatialForce ( const MultibodyTreeContext< T > &  context,
const SpatialForce< T > &  F_Mo_F,
Eigen::Ref< VectorX< T >>  tau 
) const
finalvirtual

Projects the spatial force F_Mo_F on this mobilizer's outboard frame M onto its translation axis (see translation_axis().) Mathematically:

   tau = F_Mo_F.translational().dot(axis_F)

Therefore, the result of this method is the scalar value of the linear force along the axis of this mobilizer. This method aborts in Debug builds if tau.size() is not one.

Implements Mobilizer< T >.

Here is the call graph for this function:

Here is the caller graph for this function:

const PrismaticMobilizer< T > & set_translation ( systems::Context< T > *  context,
const T &  translation 
) const

Sets context so that the generalized coordinate corresponding to the translation for this mobilizer equals translation.

Exceptions
std::logic_errorif context is not a valid MultibodyTreeContext.
Parameters
[in]contextThe context of the MultibodyTree this mobilizer belongs to.
[in]translationThe desired translation in meters.
Returns
a constant reference to this mobilizer.

Here is the caller graph for this function:

const PrismaticMobilizer< T > & set_translation_rate ( systems::Context< T > *  context,
const T &  translation_dot 
) const

Sets the rate of change, in meters per second, of this mobilizer's translation to translation_dot.

The new rate of change translation_dot gets stored in context. See class documentation for the translation sign convention.

Parameters
[in]contextThe context of the MultibodyTree this mobilizer belongs to.
[in]translation_dotThe desired rate of change of this mobilizer's translation in meters per second.
Returns
a constant reference to this mobilizer.

Here is the caller graph for this function:

void set_zero_state ( const systems::Context< T > &  context,
systems::State< T > *  state 
) const
finalvirtual

Sets state to store a zero translation and translational rate.

Implements Mobilizer< T >.

Here is the caller graph for this function:

const Vector3<double>& translation_axis ( ) const
inline
Return values
axis_FThe translation axis as a unit vector expressed in the inboard frame F.

Here is the call graph for this function:


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