Drake
Joint< T > Class Template Referenceabstract

A Joint models the kinematical relationship which characterizes the possible relative motion between two bodies. More...

#include <drake/multibody/multibody_tree/joints/joint.h>

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

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...
 
Does not allow copy, move, or assignment
 Joint (const Joint &)=delete
 
Jointoperator= (const Joint &)=delete
 
 Joint (Joint &&)=delete
 
Jointoperator= (Joint &&)=delete
 

Protected Member Functions

void DoSetTopology (const MultibodyTreeTopology &)
 
virtual std::unique_ptr< BluePrintMakeImplementationBlueprint () const =0
 This method must be implemented by derived classes in order to provide JointImplementationBuilder a BluePrint of their internal implementation JointImplementation. More...
 
const JointImplementationget_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 double.

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 >
 

Detailed Description

template<typename T>
class drake::multibody::Joint< 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 inboard-outboard 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:

MultibodyTree<double> model;
// ... Code here to setup quantities below as mass, com, etc. ...
const Body<double>& pendulum =
model.AddBody<RigidBody>(SpatialInertia<double>(mass, com, unit_inertia));
// We will connect the pendulum body to the world using a RevoluteJoint.
// In this simple case the parent body P is the model's world body and frame
// F IS the world frame.
// Additionally, we need to specify the pose of frame M on the pendulum's
// body frame B.
// Say we declared and initialized X_BM...
const RevoluteJoint<double>& elbow =
model.AddJoint<RevoluteJoint>(
"Elbow", /* joint name */
model.get_world_body(), /* parent body */
{}, /* frame F IS the world frame W */
pendulum, /* child body, the pendulum */
X_BM, /* pose of frame M in the body frame B */
Vector3d::UnitZ()); /* revolute axis in this case */
Warning
Do not ever attempt to instantiate and manipulate Joint objects on the stack; it will fail. Add joints to your model using the provided API MultibodyTree::AddJoint() as in the example above.
Template Parameters
TThe scalar type. Must be a valid Eigen scalar.

Constructor & Destructor Documentation

Joint ( const Joint< T > &  )
delete
Joint ( Joint< T > &&  )
delete
Joint ( const std::string &  name,
const Frame< T > &  frame_on_parent,
const Frame< T > &  frame_on_child 
)
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.

Parameters
[in]nameA string with a name identifying this joint.
[in]frame_on_parentThe frame F attached on the parent body connected by this joint.
[in]frame_on_childThe frame M attached on the child body connected by this joint.
virtual ~Joint ( )
inlinevirtual

Member Function Documentation

virtual std::unique_ptr<Joint<double> > DoCloneToScalar ( const MultibodyTree< double > &  tree_clone) const
protectedpure virtual
virtual std::unique_ptr<Joint<AutoDiffXd> > DoCloneToScalar ( const MultibodyTree< AutoDiffXd > &  tree_clone) const
protectedpure virtual

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

void DoSetTopology ( const MultibodyTreeTopology )
inlineprotected
const Body<T>& get_child_body ( ) const
inline

Returns a const reference to the child body B.

const Frame<T>& get_frame_on_child ( ) const
inline

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

Here is the caller graph for this function:

const Frame<T>& get_frame_on_parent ( ) const
inline

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

Here is the caller graph for this function:

const JointImplementation& get_implementation ( ) const
inlineprotected

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

Warning
The MultibodyTree model must have already been finalized, or this method will abort.
const std::string& get_name ( ) const
inline

Returns the name of this joint.

const Body<T>& get_parent_body ( ) const
inline

Returns a const reference to the parent body P.

virtual std::unique_ptr<BluePrint> MakeImplementationBlueprint ( ) const
protectedpure virtual

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

Here is the caller graph for this function:

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

Friends And Related Function Documentation

friend class internal::JointImplementationBuilder< T >
friend
friend class Joint
friend

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