Drake

A Joint models the kinematical relationship which characterizes the possible relative motion between two bodies. More...
#include <multibody/multibody_tree/joints/joint.h>
Classes  
struct  BluePrint 
(Advanced) Structure containing all the information needed to build the MultibodyTree implementation for a Joint. More...  
struct  JointImplementation 
(Advanced) A Joint is implemented in terms of MultibodyTree elements such as bodies, mobilizers, force elements and constraints. More...  
Public Member Functions  
Joint (const std::string &name, const Frame< T > &frame_on_parent, const Frame< T > &frame_on_child)  
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 &  get_name () const 
Returns the name of this joint. More...  
const Body< T > &  get_parent_body () const 
Returns a const reference to the parent body P. More...  
const Body< T > &  get_child_body () const 
Returns a const reference to the child body B. More...  
const Frame< T > &  get_frame_on_parent () const 
Returns a const reference to the frame F attached on the parent body P. More...  
const Frame< T > &  get_frame_on_child () const 
Returns a const reference to the frame M attached on the child body B. More...  
int  num_dofs () const 
Returns the number of degrees of freedom for this joint. 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...  
Does not allow copy, move, or assignment  
Joint (const Joint &)=delete  
Joint &  operator= (const Joint &)=delete 
Joint (Joint &&)=delete  
Joint &  operator= (Joint &&)=delete 
Protected Member Functions  
virtual int  do_get_num_dofs () const =0 
Returns the number of degrees of freedom for this joint. More...  
virtual void  DoAddInOneForce (const systems::Context< T > &context, int joint_dof, const T &joint_tau, MultibodyForces< T > *forces) const =0 
Adds into forces a force along the one of the joint's degrees of freedom given by joint_dof . More...  
void  DoSetTopology (const MultibodyTreeTopology &) 
virtual std::unique_ptr< BluePrint >  MakeImplementationBlueprint () const =0 
This method must be implemented by derived classes in order to provide JointImplementationBuilder a BluePrint of their internal implementation JointImplementation. More...  
const JointImplementation &  get_implementation () const 
Returns a const reference to the internal implementation of this joint. More...  
Methods to make a clone templated on different scalar types.  
Clones this Joint (templated on T) to a joint templated on  
virtual std::unique_ptr< Joint< double > >  DoCloneToScalar (const MultibodyTree< double > &tree_clone) const =0 
virtual std::unique_ptr< Joint< AutoDiffXd > >  DoCloneToScalar (const MultibodyTree< AutoDiffXd > &tree_clone) const =0 
Clones this Joint (templated on T) to a joint templated on AutoDiffXd. More...  
Friends  
template<typename >  
class  Joint 
class  internal::JointImplementationBuilder< T > 
A Joint models the kinematical relationship which characterizes the possible relative motion between two bodies.
The two bodies connected by a Joint object are referred to as the parent and child bodies. Although the terms parent and child are sometimes used synonymously to describe the relationship between inboard and outboard bodies in multibody models, this usage is wholly unrelated and implies nothing about the inboardoutboard relationship between the bodies. A Joint is a model of a physical kinematic constraint between two bodies, a constraint that in the real physical system does not even allude to the ordering of the bodies.
In Drake we define a frame F rigidly attached to the parent body P with pose X_PF
and a frame M rigidly attached to the child body B with pose X_BM
. A Joint object specifies a kinematic relation between frames F and M, which in turn imposes a kinematic relation between bodies P and B.
Typical joints include the ball joint, to allow unrestricted rotations about a given point, the revolute joint, that constraints two bodies to rotate about a given common axis, etc.
Consider the following example to build a simple pendulum system:
T  The scalar type. Must be a valid Eigen scalar. 

inline 
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.
See this class's documentation for further details.
[in]  name  A string with a name identifying this joint. 
[in]  frame_on_parent  The frame F attached on the parent body connected by this joint. 
[in]  frame_on_child  The frame M attached on the child body connected by this joint. 

inlinevirtual 

inline 
Adds into forces
a force along the one of the joint's degrees of freedom indicated by index joint_dof
.
The meaning for this degree of freedom and even its dimensional units depend on the specific joint subclass. For a RevoluteJoint for instance, joint_dof
can only be 0 since revolute joints's motion subspace only has one degree of freedom, while the units of joint_tau
are those of torque (N⋅m in the MKS system of units). For multidof joints please refer to the documentation provided by specific joint subclasses regarding the meaning of joint_dof
.
[in]  context  The context storing the state and parameters for the model to which this joint belongs. 
[in]  joint_dof  Index specifying one of the degress of freedom for this joint. The index must be in the range 0 <= joint_dof < num_dofs() or otherwise this method will abort. 
[in]  joint_tau  Generalized force corresponding to the degree of freedom indicated by joint_dof to be added into forces . 
[out]  forces  On return, this method will add force joint_tau for the degree of freedom joint_dof into the output forces . This method aborts if forces is nullptr or if forces doest not have the right sizes to accommodate a set of forces for the model to which this joint belongs. 

protectedpure virtual 
Returns the number of degrees of freedom for this
joint.
Implementation to the NVI num_dofs() that must be implemented by all subclasses. E.g., this method should return one for a revolute joint and it should return three for a ball joint.

protectedpure virtual 
Adds into forces
a force along the one of the joint's degrees of freedom given by joint_dof
.
How forces is added to a MultibodyTree model depends on the underlying implementation of a particular joint and therefore specific Joint subclasses must provide a definition for this method. For instance, a revolute joint could be modeled with a single generalized coordinate for the angular rotation (implemented through a RevoluteMobilizer) or it could be modeled using a constraint that only allows rotation about the joint's axis but that constrains the motion in the other five degrees of freedom. This method is only called by the public NVI AddInOneForce() and therefore input arguments were checked to be valid.

protectedpure virtual 

protectedpure virtual 
Clones this Joint (templated on T) to a joint templated on AutoDiffXd.

inlineprotected 

inline 
Returns a const reference to the child body B.

inline 
Returns a const reference to the frame M attached on the child body B.

inline 
Returns a const reference to the frame F attached on the parent body P.

inlineprotected 
Returns a const reference to the internal implementation of this
joint.

inline 
Returns the name of this joint.

inline 
Returns a const reference to the parent body P.

protectedpure virtual 
This method must be implemented by derived classes in order to provide JointImplementationBuilder a BluePrint of their internal implementation JointImplementation.

inline 
Returns the number of degrees of freedom for this
joint.
E.g., one for a revolute joint and three for a ball joint.

friend 

friend 