Drake
ModelInstance< T > Class Template Reference

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

Public Member Functions

 ModelInstance (ModelInstanceIndex index)
 
int num_positions () const
 
int num_velocities () const
 
int num_states () const
 
int num_actuated_dofs () const
 
void add_mobilizer (const Mobilizer< T > *mobilizer)
 
void add_joint_actuator (const JointActuator< T > *joint_actuator)
 
void SetActuationInArray (const Eigen::Ref< const VectorX< T >> &u_instance, EigenPtr< VectorX< T >> u) const
 Given the actuation values u_instance for all actuators in this model instance, this method sets the portion of the actuation vector u (which is the actuation vector for the entire MultibodyTree) corresponding to the actuators for this model instance. More...
 
VectorX< T > GetPositionsFromArray (const Eigen::Ref< const VectorX< T >> &q) const
 Returns an Eigen vector of the generalized positions for this model instance from a vector q of generalized positions for the entire MultibodyTree model. More...
 
void SetPositionsInArray (const Eigen::Ref< const VectorX< T >> &q_instance, EigenPtr< VectorX< T >> q) const
 Sets the vector of generalized positions for this model instance in the relevant locations of an array that corresponds to the positions for the entire MultibodyTree model. More...
 
VectorX< T > GetVelocitiesFromArray (const Eigen::Ref< const VectorX< T >> &v) const
 Returns an Eigen vector of the generalized velocities for this mobilizer from a vector v of generalized velocities for the entire MultibodyTree model. More...
 
void SetVelocitiesInArray (const Eigen::Ref< const VectorX< T >> &v_instance, EigenPtr< VectorX< T >> v) const
 Sets the vector of generalized velocities for this model instance in the relevant locations of an array corresponding to the velocities for the entire MultibodyTree model. More...
 
Does not allow copy, move, or assignment
 ModelInstance (const ModelInstance &)=delete
 
ModelInstanceoperator= (const ModelInstance &)=delete
 
 ModelInstance (ModelInstance &&)=delete
 
ModelInstanceoperator= (ModelInstance &&)=delete
 

Detailed Description

template<typename T>
class drake::multibody::internal::ModelInstance< T >

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

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

Constructor & Destructor Documentation

◆ ModelInstance() [1/3]

ModelInstance ( const ModelInstance< T > &  )
delete

◆ ModelInstance() [2/3]

ModelInstance ( ModelInstance< T > &&  )
delete

◆ ModelInstance() [3/3]

ModelInstance ( ModelInstanceIndex  index)
inlineexplicit

Member Function Documentation

◆ add_joint_actuator()

void add_joint_actuator ( const JointActuator< T > *  joint_actuator)
inline

◆ add_mobilizer()

void add_mobilizer ( const Mobilizer< T > *  mobilizer)
inline

◆ GetPositionsFromArray()

VectorX< T > GetPositionsFromArray ( const Eigen::Ref< const VectorX< T >> &  q) const

Returns an Eigen vector of the generalized positions for this model instance from a vector q of generalized positions for the entire MultibodyTree model.

Exceptions
std::logic_errorif q is not of size MultibodyTree::num_positions().

◆ GetVelocitiesFromArray()

VectorX< T > GetVelocitiesFromArray ( const Eigen::Ref< const VectorX< T >> &  v) const

Returns an Eigen vector of the generalized velocities for this mobilizer from a vector v of generalized velocities for the entire MultibodyTree model.

Exceptions
std::logic_errorif v is not of size MultibodyTree::num_velocities().

◆ num_actuated_dofs()

int num_actuated_dofs ( ) const
inline

◆ num_positions()

int num_positions ( ) const
inline

◆ num_states()

int num_states ( ) const
inline

◆ num_velocities()

int num_velocities ( ) const
inline

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ SetActuationInArray()

void SetActuationInArray ( const Eigen::Ref< const VectorX< T >> &  u_instance,
EigenPtr< VectorX< T >>  u 
) const

Given the actuation values u_instance for all actuators in this model instance, this method sets the portion of the actuation vector u (which is the actuation vector for the entire MultibodyTree) corresponding to the actuators for this model instance.

Parameters
[in]u_instanceActuation values for the actuators. It must be of size equal to the number of degrees of freedom of all of the actuated joints in this model instance.
[out]uThe vector containing the actuation values for the entire MultibodyTree model to which this actuator belongs to. It must be of size equal to the number of degrees of freedom of all of the actuated joints in the entire MultibodyTree model.
Exceptions
std::logic_errorif u_instance is not of size equal to the number of degrees of freedom of all of the actuated joints in this model or u is not of size equal to the number of degrees of freedom of all of the actuated joints in the entire MultibodyTree model to which this actuator belongs to.

◆ SetPositionsInArray()

void SetPositionsInArray ( const Eigen::Ref< const VectorX< T >> &  q_instance,
EigenPtr< VectorX< T >>  q 
) const

Sets the vector of generalized positions for this model instance in the relevant locations of an array that corresponds to the positions for the entire MultibodyTree model.

Elements of the array that do not correspond to this are not altered. Note that calling SetPositionsInArray(q_instance, q) causes GetPositionsFromArray(q) to yield q_instance.

Exceptions
std::logic_errorif q is not of size MultibodyTree::num_positions() or q_instance is not of size num_positions().

◆ SetVelocitiesInArray()

void SetVelocitiesInArray ( const Eigen::Ref< const VectorX< T >> &  v_instance,
EigenPtr< VectorX< T >>  v 
) const

Sets the vector of generalized velocities for this model instance in the relevant locations of an array corresponding to the velocities for the entire MultibodyTree model.

Elements of the array that do not correspond to this are not altered. Note that calling SetVelocitiesInArray(v_instance, v) causes GetVelocitiesFromArray(v) to yield v_instance.

Exceptions
std::logic_errorif v is not of size MultibodyTree::num_velocities() or v_instance is not of size num_velocities().

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