Drake
RevoluteJoint< T > Class Template Referencefinal

## Detailed Description

### template<typename T> class drake::multibody::RevoluteJoint< T >

This Joint allows two bodies to rotate relatively to one another around a common axis.

That is, given a frame F attached to the parent body P and a frame M attached to the child body B (see the Joint class's documentation), this Joint allows frames F and M to rotate with respect to each other about an axis â. The rotation angle's sign is defined such that child body B rotates about axis â according to the right hand rule, with thumb aligned in the axis direction. Axis â is constant and has the same measures in both frames F and M, that is, â_F = â_M.

Template Parameters
 T The scalar type. Must be a valid Eigen scalar.

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

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

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

## Public Types

template<typename Scalar >
using Context = systems::Context< Scalar >

## Public Member Functions

RevoluteJoint (const std::string &name, const Frame< T > &frame_on_parent, const Frame< T > &frame_on_child, const Vector3< double > &axis, double damping=0)
Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. More...

RevoluteJoint (const std::string &name, const Frame< T > &frame_on_parent, const Frame< T > &frame_on_child, const Vector3< double > &axis, double pos_lower_limit, double pos_upper_limit, double damping=0)
Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis. More...

const std::string & type_name () const override
Returns a string identifying the type of this joint, such as "revolute" or "prismatic". More...

const Vector3< double > & revolute_axis () const
Returns the axis of revolution of this joint as a unit vector. More...

double damping () const
Returns this joint's damping constant in N⋅m⋅s. More...

double position_lower_limit () const
Returns the position lower limit for this joint in radians. More...

double position_upper_limit () const
Returns the position upper limit for this joint in radians. More...

double velocity_lower_limit () const
Returns the velocity lower limit for this joint in radians / s. More...

double velocity_upper_limit () const
Returns the velocity upper limit for this joint in radians / s. More...

double acceleration_lower_limit () const
Returns the acceleration lower limit for this joint in radians / s². More...

double acceleration_upper_limit () const
Returns the acceleration upper limit for this joint in radians / s². More...

void AddInTorque (const systems::Context< T > &context, const T &torque, MultibodyForces< T > *forces) const
Adds into forces a given torque for this joint that is to be applied about the joint's axis. More...

Does not allow copy, move, or assignment
RevoluteJoint (const RevoluteJoint &)=delete

RevoluteJointoperator= (const RevoluteJoint &)=delete

RevoluteJoint (RevoluteJoint &&)=delete

RevoluteJointoperator= (RevoluteJoint &&)=delete

Context-dependent value access
const T & get_angle (const Context< T > &context) const
Gets the rotation angle of this mobilizer from context. More...

const RevoluteJoint< T > & set_angle (Context< T > *context, const T &angle) const
Sets the context so that the generalized coordinate corresponding to the rotation angle of this joint equals angle. More...

void set_default_angle (double angle)

void set_random_angle_distribution (const symbolic::Expression &angle)

const T & get_angular_rate (const Context< T > &context) const
Gets the rate of change, in radians per second, of this joint's angle (see get_angle()) from context. More...

const RevoluteJoint< T > & set_angular_rate (Context< T > *context, const T &angle) const
Sets the rate of change, in radians per second, of this this joint's angle to theta_dot. More...

Public Member Functions inherited from Joint< T >
Joint (const std::string &name, const Frame< T > &frame_on_parent, const Frame< T > &frame_on_child, const VectorX< double > &pos_lower_limits, const VectorX< double > &pos_upper_limits, const VectorX< double > &vel_lower_limits, const VectorX< double > &vel_upper_limits, const VectorX< double > &acc_lower_limits, const VectorX< double > &acc_upper_limits)
Creates a joint between two Frame objects which imposes a given kinematic relation between frame F attached on the parent body P and frame M attached on the child body B. More...

virtual ~Joint ()

const std::string & name () const
Returns the name of this joint. More...

const Body< T > & parent_body () const
Returns a const reference to the parent body P. More...

const Body< T > & child_body () const
Returns a const reference to the child body B. More...

const Frame< T > & frame_on_parent () const
Returns a const reference to the frame F attached on the parent body P. More...

const Frame< T > & frame_on_child () const
Returns a const reference to the frame M attached on the child body B. More...

int velocity_start () const
Returns the index to the first generalized velocity for this joint within the vector v of generalized velocities for the full multibody system. More...

int num_velocities () const
Returns the number of generalized velocities describing this joint. More...

int position_start () const
Returns the index to the first generalized position for this joint within the vector q of generalized positions for the full multibody system. More...

int num_positions () const
Returns the number of generalized positions describing this joint. More...

const T & GetOnePosition (const systems::Context< T > &context) const
Returns the position coordinate for joints with a single degree of freedom. More...

const T & GetOneVelocity (const systems::Context< T > &context) const
Returns the velocity coordinate for joints with a single degree of freedom. More...

void AddInOneForce (const systems::Context< T > &context, int joint_dof, const T &joint_tau, MultibodyForces< T > *forces) const
Adds into forces a force along the one of the joint's degrees of freedom indicated by index joint_dof. More...

void AddInDamping (const systems::Context< T > &context, MultibodyForces< T > *forces) const
Adds into forces the force due to damping within this joint. More...

Joint (const Joint &)=delete

Jointoperator= (const Joint &)=delete

Joint (Joint &&)=delete

Jointoperator= (Joint &&)=delete

const VectorX< double > & position_lower_limits () const

const VectorX< double > & position_upper_limits () const
Returns the position upper limits. More...

const VectorX< double > & velocity_lower_limits () const
Returns the velocity lower limits. More...

const VectorX< double > & velocity_upper_limits () const
Returns the velocity upper limits. More...

const VectorX< double > & acceleration_lower_limits () const
Returns the acceleration lower limits. More...

const VectorX< double > & acceleration_upper_limits () const
Returns the acceleration upper limits. More...

void set_velocity_limits (const VectorX< double > &lower_limits, const VectorX< double > &upper_limits)
Sets the velocity limits to lower_limits and upper_limits. More...

void set_acceleration_limits (const VectorX< double > &lower_limits, const VectorX< double > &upper_limits)
Sets the acceleration limits to lower_limits and upper_limits. More...

## Static Public Attributes

static const char kTypeName [] = "revolute"

## Protected Member Functions

void DoAddInOneForce (const systems::Context< T > &, int joint_dof, const T &joint_tau, MultibodyForces< T > *forces) const override
Joint<T> override called through public NVI, Joint::AddInForce(). More...

void DoAddInDamping (const systems::Context< T > &context, MultibodyForces< T > *forces) const override
Joint<T> override called through public NVI, Joint::AddInDamping(). More...

Protected Member Functions inherited from Joint< T >
void DoSetTopology (const internal::MultibodyTreeTopology &)

const JointImplementationget_implementation () const
Returns a const reference to the internal implementation of this joint. More...

## Friends

template<typename >
class RevoluteJoint

class JointTester

## ◆ Context

 using Context = systems::Context

## ◆ RevoluteJoint() [1/4]

 RevoluteJoint ( const RevoluteJoint< T > & )
delete

## ◆ RevoluteJoint() [2/4]

 RevoluteJoint ( RevoluteJoint< T > && )
delete

## ◆ RevoluteJoint() [3/4]

 RevoluteJoint ( const std::string & name, const Frame< T > & frame_on_parent, const Frame< T > & frame_on_child, const Vector3< double > & axis, double damping = 0 )

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis.

See this class's documentation for further details on the definition of these frames and rotation angle. This constructor signature creates a joint with no joint limits, i.e. the joint position, velocity and acceleration limits are the pair (-∞, ∞). The first three arguments to this constructor are those of the Joint class constructor. See the Joint class's documentation for details. The additional parameters are:

Parameters
 [in] axis A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector. [in] damping Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Exceptions
 std::exception if damping is negative.

## ◆ RevoluteJoint() [4/4]

 RevoluteJoint ( const std::string & name, const Frame< T > & frame_on_parent, const Frame< T > & frame_on_child, const Vector3< double > & axis, double pos_lower_limit, double pos_upper_limit, double damping = 0 )

Constructor to create a revolute joint between two bodies so that frame F attached to the parent body P and frame M attached to the child body B, rotate relatively to one another about a common axis.

See this class's documentation for further details on the definition of these frames and rotation angle. The first three arguments to this constructor are those of the Joint class constructor. See the Joint class's documentation for details. The additional parameters are:

Parameters
 [in] axis A vector in ℝ³ specifying the axis of revolution for this joint. Given that frame M only rotates with respect to F and their origins are coincident at all times, the measures of axis in either frame F or M are exactly the same, that is, axis_F = axis_M. In other words, axis_F (or axis_M) is the eigenvector of R_FM with eigenvalue equal to one. This vector can have any length, only the direction is used. This method aborts if axis is the zero vector. [in] pos_lower_limit Lower position limit, in radians, for the rotation coordinate (see get_angle()). [in] pos_upper_limit Upper position limit, in radians, for the rotation coordinate (see get_angle()). [in] damping Viscous damping coefficient, in N⋅m⋅s, used to model losses within the joint. The damping torque (in N⋅m) is modeled as τ = -damping⋅ω, i.e. opposing motion, with ω the angular rate for this joint (see get_angular_rate()).
Exceptions
 std::exception if damping is negative. std::exception if pos_lower_limit > pos_upper_limit.

## ◆ acceleration_lower_limit()

 double acceleration_lower_limit ( ) const

Returns the acceleration lower limit for this joint in radians / s².

## ◆ acceleration_upper_limit()

 double acceleration_upper_limit ( ) const

Returns the acceleration upper limit for this joint in radians / s².

 void AddInTorque ( const systems::Context< T > & context, const T & torque, MultibodyForces< T > * forces ) const

Adds into forces a given torque for this joint that is to be applied about the joint's axis.

The torque is defined to be positive according to the right-hand-rule with the thumb aligned in the direction of this joint's axis. That is, a positive torque causes a positive rotational acceleration according to the right-hand-rule around the joint's axis.

Note
A torque is the moment of a set of forces whose resultant is zero.

## ◆ damping()

 double damping ( ) const

Returns this joint's damping constant in N⋅m⋅s.

 void DoAddInDamping ( const systems::Context< T > & context, MultibodyForces< T > * forces ) const
overrideprotectedvirtual

Joint<T> override called through public NVI, Joint::AddInDamping().

Therefore arguments were already checked to be valid. This method adds into forces a dissipative torque according to the viscous law τ = -d⋅ω, with d the damping coefficient (see damping()).

Reimplemented from Joint< T >.

 void DoAddInOneForce ( const systems::Context< T > & , int joint_dof, const T & joint_tau, MultibodyForces< T > * forces ) const
overrideprotectedvirtual

Joint<T> override called through public NVI, Joint::AddInForce().

Therefore arguments were already checked to be valid. For a RevoluteJoint, we must always have joint_dof = 0 since there is only a single degree of freedom (num_velocities() == 1). joint_tau is the torque applied about the joint's axis, on the body declared as child (according to the revolute joint's constructor) at the origin of the child frame (which is coincident with the origin of the parent frame at all times). The torque is defined to be positive according to the right-hand-rule with the thumb aligned in the direction of this joint's axis. That is, a positive torque causes a positive rotational acceleration (of the child body frame) according to the right-hand-rule around the joint's axis.

Implements Joint< T >.

## ◆ get_angle()

 const T& get_angle ( const Context< T > & context ) const

Gets the rotation angle of this mobilizer from context.

Parameters
 [in] context The context of the MultibodyTree this joint belongs to.
Returns
The angle coordinate of this joint stored in the context.

## ◆ get_angular_rate()

 const T& get_angular_rate ( const Context< T > & context ) const

Gets the rate of change, in radians per second, of this joint's angle (see get_angle()) from context.

Parameters
 [in] context The context of the MultibodyTree this joint belongs to.
Returns
The rate of change of this joint's angle as stored in the context.

## ◆ operator=() [1/2]

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

## ◆ operator=() [2/2]

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

## ◆ position_lower_limit()

 double position_lower_limit ( ) const

Returns the position lower limit for this joint in radians.

## ◆ position_upper_limit()

 double position_upper_limit ( ) const

Returns the position upper limit for this joint in radians.

## ◆ revolute_axis()

 const Vector3& revolute_axis ( ) const

Returns the axis of revolution of this joint as a unit vector.

Since the measures of this axis in either frame F or M are the same (see this class's documentation for frames's definitions) then, axis = axis_F = axis_M.

## ◆ set_angle()

 const RevoluteJoint& set_angle ( Context< T > * context, const T & angle ) const

Sets the context so that the generalized coordinate corresponding to the rotation angle of this joint equals angle.

Parameters
 [in] context The context of the MultibodyTree this joint belongs to. [in] angle The desired angle in radians to be stored in context.
Returns
a constant reference to this joint.

## ◆ set_angular_rate()

 const RevoluteJoint& set_angular_rate ( Context< T > * context, const T & angle ) const

Sets the rate of change, in radians per second, of this this joint's angle to theta_dot.

The new rate of change theta_dot gets stored in context.

Parameters
 [in] context The context of the MultibodyTree this joint belongs to. [in] theta_dot The desired rate of change of this joints's angle in radians per second.
Returns
a constant reference to this joint.

## ◆ set_default_angle()

 void set_default_angle ( double angle )

## ◆ set_random_angle_distribution()

 void set_random_angle_distribution ( const symbolic::Expression & angle )

## ◆ type_name()

 const std::string& type_name ( ) const
overridevirtual

Returns a string identifying the type of this joint, such as "revolute" or "prismatic".

Implements Joint< T >.

## ◆ velocity_lower_limit()

 double velocity_lower_limit ( ) const

Returns the velocity lower limit for this joint in radians / s.

## ◆ velocity_upper_limit()

 double velocity_upper_limit ( ) const

Returns the velocity upper limit for this joint in radians / s.

## ◆ JointTester

 friend class JointTester
friend

## ◆ RevoluteJoint

 friend class RevoluteJoint
friend

## ◆ kTypeName

 const char kTypeName = "revolute"
static

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