Ravelin
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Ravelin::JOINT Class Referenceabstract

Defines a bilateral constraint (a joint) More...

#include <Jointd.h>

Inheritance diagram for Ravelin::JOINT:
Ravelin::virtual_enable_shared_from_this< JOINT > Ravelin::virtual_enable_shared_from_this< JOINT > Ravelin::virtual_enable_shared_from_this_base Ravelin::virtual_enable_shared_from_this_base Ravelin::FIXEDJOINT Ravelin::FIXEDJOINT Ravelin::PLANARJOINT Ravelin::PLANARJOINT Ravelin::PRISMATICJOINT Ravelin::PRISMATICJOINT Ravelin::REVOLUTEJOINT Ravelin::REVOLUTEJOINT Ravelin::SPHERICALJOINT Ravelin::SPHERICALJOINT Ravelin::UNIVERSALJOINT Ravelin::UNIVERSALJOINT

Public Types

enum  ConstraintType {
  eUnknown, eExplicit, eImplicit, eUnknown,
  eExplicit, eImplicit
}
 
enum  DOFs {
  DOF_1 =0, DOF_2 =1, DOF_3 =2, DOF_4 =3,
  DOF_5 =4, DOF_6 =5, DOF_1 =0, DOF_2 =1,
  DOF_3 =2, DOF_4 =3, DOF_5 =4, DOF_6 =5
}
 
enum  ConstraintType {
  eUnknown, eExplicit, eImplicit, eUnknown,
  eExplicit, eImplicit
}
 
enum  DOFs {
  DOF_1 =0, DOF_2 =1, DOF_3 =2, DOF_4 =3,
  DOF_5 =4, DOF_6 =5, DOF_1 =0, DOF_2 =1,
  DOF_3 =2, DOF_4 =3, DOF_5 =4, DOF_6 =5
}
 

Public Member Functions

virtual const std::vector
< SVELOCITY > & 
get_spatial_axes ()
 
void add_force (const VECTORN &force)
 
void reset_force ()
 
ConstraintType get_constraint_type () const
 
void set_constraint_type (ConstraintType type)
 Sets whether this constraint is implicit or explicit (or unknown)
 
boost::shared_ptr
< ARTICULATED_BODY
get_articulated_body ()
 Gets the articulated body corresponding to this body. More...
 
void set_articulated_body (boost::shared_ptr< ARTICULATED_BODY > abody)
 Sets the articulated body corresponding to this body. More...
 
virtual void set_inboard_link (boost::shared_ptr< RIGIDBODY > link, bool update_pose)
 
virtual void set_outboard_link (boost::shared_ptr< RIGIDBODY > link, bool update_pose)
 
void set_location (const VECTOR3 &p, boost::shared_ptr< RIGIDBODY > inboard, boost::shared_ptr< RIGIDBODY > outboard)
 
VECTOR3 get_location (bool use_outboard=false) const
 
virtual void set_inboard_pose (boost::shared_ptr< const POSE3 > inboard_pose, bool update_joint_pose)
 
virtual void set_outboard_pose (boost::shared_ptr< POSE3 > outboard_pose, bool update_joint_pose)
 
virtual void update_spatial_axes ()
 
virtual void evaluate_constraints_dot (REAL C[])
 
virtual void set_q_tare (const VECTORN &tare)
 
virtual const VECTORNget_q_tare () const
 
boost::shared_ptr< RIGIDBODYget_inboard_link () const
 Gets the inboard link for this joint.
 
boost::shared_ptr< RIGIDBODYget_outboard_link () const
 Gets the outboard link for this joint.
 
unsigned get_index () const
 Gets the joint index (returns UINT_MAX if not set)
 
void set_index (unsigned index)
 Sets the joint index. More...
 
unsigned get_constraint_index () const
 Gets the constraint index for this joint.
 
void set_constraint_index (unsigned idx)
 Sets the constraint index for this joint.
 
void set_coord_index (unsigned index)
 Sets the coordinate index for this joint. More...
 
unsigned get_coord_index () const
 Gets the starting coordinate index for this joint.
 
boost::shared_ptr< const POSE3get_pose () const
 Gets the pose of this joint (relative to the inboard pose instead of the outboard pose as returned by get_pose_from_outboard())
 
boost::shared_ptr< const POSE3get_pose_from_outboard () const
 Gets the pose of this joint relative to the outboard pose (rather than the inboard pose as returned by get_pose())
 
virtual bool is_singular_config () const =0
 Gets whether this joint is in a singular configuration. More...
 
virtual unsigned num_constraint_eqns () const
 Gets the number of constraint equations for this joint.
 
virtual void evaluate_constraints (REAL C[])=0
 Evaluates the constraint equations for this joint. More...
 
virtual const std::vector
< SVELOCITY > & 
get_spatial_axes_dot ()=0
 Abstract method to get the spatial axes derivatives for this joint. More...
 
virtual boost::shared_ptr
< const POSE3
get_induced_pose ()=0
 Abstract method to get the local transform for this joint. More...
 
virtual void determine_q (VECTORN &q)=0
 Abstract method to determine the value of Q (joint position) from current transforms.
 
virtual unsigned num_dof () const =0
 Gets the number of degrees-of-freedom for this joint.
 
virtual void calc_constraint_jacobian (bool inboard, MATRIXN &Cq)=0
 Computes the constraint Jacobian for this joint with respect to the given body. More...
 
virtual void calc_constraint_jacobian_dot (bool inboard, MATRIXN &Cq)=0
 Computes the time derivative of the constraint Jacobian for this joint with respect to the given body. More...
 
virtual const std::vector
< SVELOCITY > & 
get_spatial_axes ()
 
void add_force (const VECTORN &force)
 
void reset_force ()
 
ConstraintType get_constraint_type () const
 
void set_constraint_type (ConstraintType type)
 Sets whether this constraint is implicit or explicit (or unknown)
 
boost::shared_ptr
< ARTICULATED_BODY
get_articulated_body ()
 Gets the articulated body corresponding to this body. More...
 
void set_articulated_body (boost::shared_ptr< ARTICULATED_BODY > abody)
 Sets the articulated body corresponding to this body. More...
 
virtual void set_inboard_link (boost::shared_ptr< RIGIDBODY > link, bool update_pose)
 
virtual void set_outboard_link (boost::shared_ptr< RIGIDBODY > link, bool update_pose)
 
void set_location (const VECTOR3 &p, boost::shared_ptr< RIGIDBODY > inboard, boost::shared_ptr< RIGIDBODY > outboard)
 
VECTOR3 get_location (bool use_outboard=false) const
 
virtual void set_inboard_pose (boost::shared_ptr< const POSE3 > inboard_pose, bool update_joint_pose)
 
virtual void set_outboard_pose (boost::shared_ptr< POSE3 > outboard_pose, bool update_joint_pose)
 
virtual void update_spatial_axes ()
 
virtual void evaluate_constraints_dot (REAL C[])
 
virtual void set_q_tare (const VECTORN &tare)
 
virtual const VECTORNget_q_tare () const
 
boost::shared_ptr< RIGIDBODYget_inboard_link () const
 Gets the inboard link for this joint.
 
boost::shared_ptr< RIGIDBODYget_outboard_link () const
 Gets the outboard link for this joint.
 
unsigned get_index () const
 Gets the joint index (returns UINT_MAX if not set)
 
void set_index (unsigned index)
 Sets the joint index. More...
 
unsigned get_constraint_index () const
 Gets the constraint index for this joint.
 
void set_constraint_index (unsigned idx)
 Sets the constraint index for this joint.
 
void set_coord_index (unsigned index)
 Sets the coordinate index for this joint. More...
 
unsigned get_coord_index () const
 Gets the starting coordinate index for this joint.
 
boost::shared_ptr< const POSE3get_pose () const
 Gets the pose of this joint (relative to the inboard pose instead of the outboard pose as returned by get_pose_from_outboard())
 
boost::shared_ptr< const POSE3get_pose_from_outboard () const
 Gets the pose of this joint relative to the outboard pose (rather than the inboard pose as returned by get_pose())
 
virtual bool is_singular_config () const =0
 Gets whether this joint is in a singular configuration. More...
 
virtual unsigned num_constraint_eqns () const
 Gets the number of constraint equations for this joint.
 
virtual void evaluate_constraints (REAL C[])=0
 Evaluates the constraint equations for this joint. More...
 
virtual const std::vector
< SVELOCITY > & 
get_spatial_axes_dot ()=0
 Abstract method to get the spatial axes derivatives for this joint. More...
 
virtual boost::shared_ptr
< const POSE3
get_induced_pose ()=0
 Abstract method to get the local transform for this joint. More...
 
virtual void determine_q (VECTORN &q)=0
 Abstract method to determine the value of Q (joint position) from current transforms.
 
virtual unsigned num_dof () const =0
 Gets the number of degrees-of-freedom for this joint.
 
virtual void calc_constraint_jacobian (bool inboard, MATRIXN &Cq)=0
 Computes the constraint Jacobian for this joint with respect to the given body. More...
 
virtual void calc_constraint_jacobian_dot (bool inboard, MATRIXN &Cq)=0
 Computes the time derivative of the constraint Jacobian for this joint with respect to the given body. More...
 
- Public Member Functions inherited from Ravelin::virtual_enable_shared_from_this< JOINT >
boost::shared_ptr< JOINTshared_from_this ()
 
boost::shared_ptr< const JOINTshared_from_this () const
 

Public Attributes

std::string joint_id
 The ID of this joint.
 
VECTORN qdd
 The acceleration of this joint.
 
VECTORN force
 The actuator force (user/controller sets this)
 
VECTORN lambda
 Constraint forces calculated by forward dynamics.
 
VECTORN q
 The position of this joint.
 
VECTORN qd
 The velocity of this joint.
 

Protected Member Functions

void calc_constraint_jacobian_numeric (bool inboard, MATRIXN &Cq)
 
bool transform_jacobian (MATRIXN &J, bool use_inboard, MATRIXN &output)
 
void invalidate_pose_vectors ()
 
boost::shared_ptr< const POSE3get_inboard_pose ()
 
boost::shared_ptr< const POSE3get_outboard_pose ()
 
virtual void init_data ()
 Method for initializing all variables in the joint. More...
 
void calc_constraint_jacobian_numeric (bool inboard, MATRIXN &Cq)
 
bool transform_jacobian (MATRIXN &J, bool use_inboard, MATRIXN &output)
 
void invalidate_pose_vectors ()
 
boost::shared_ptr< const POSE3get_inboard_pose ()
 
boost::shared_ptr< const POSE3get_outboard_pose ()
 
virtual void init_data ()
 Method for initializing all variables in the joint. More...
 

Protected Attributes

boost::shared_ptr< POSE3_Fprime
 The frame induced by the joint.
 
boost::shared_ptr< POSE3_F
 The frame of this joint.
 
boost::shared_ptr< POSE3_Fb
 The frame of this joint backward from the outboard link.
 
std::vector< SVELOCITY_s
 The spatial axes (in joint frame) for the joint. More...
 
VECTORN _q_tare
 The stored "tare" value for the initial joint configuration. More...
 
boost::weak_ptr< RIGIDBODY_inboard_link
 
boost::weak_ptr< RIGIDBODY_outboard_link
 
boost::weak_ptr< ARTICULATED_BODY_abody
 
ConstraintType _constraint_type
 
unsigned _joint_idx
 
unsigned _coord_idx
 
unsigned _constraint_idx
 

Detailed Description

Defines a bilateral constraint (a joint)

Member Function Documentation

virtual void Ravelin::JOINT::calc_constraint_jacobian ( bool  inboard,
MATRIXN Cq 
)
pure virtual

Computes the constraint Jacobian for this joint with respect to the given body.

Parameters
inboard'true' if the Jacobian is to be computed w.r.t. the inboard link; 'false' for the outboard
Cqa 6 x ndof matrix for the given body (on return)

Implemented in Ravelin::SPHERICALJOINT, Ravelin::SPHERICALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::FIXEDJOINT, Ravelin::FIXEDJOINT, Ravelin::PRISMATICJOINT, Ravelin::PRISMATICJOINT, Ravelin::REVOLUTEJOINT, Ravelin::REVOLUTEJOINT, Ravelin::PLANARJOINT, and Ravelin::PLANARJOINT.

virtual void Ravelin::JOINT::calc_constraint_jacobian ( bool  inboard,
MATRIXN Cq 
)
pure virtual

Computes the constraint Jacobian for this joint with respect to the given body.

Parameters
inboard'true' if the Jacobian is to be computed w.r.t. the inboard link; 'false' for the outboard
Cqa 6 x ndof matrix for the given body (on return)

Implemented in Ravelin::SPHERICALJOINT, Ravelin::SPHERICALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::FIXEDJOINT, Ravelin::FIXEDJOINT, Ravelin::PRISMATICJOINT, Ravelin::PRISMATICJOINT, Ravelin::REVOLUTEJOINT, Ravelin::REVOLUTEJOINT, Ravelin::PLANARJOINT, and Ravelin::PLANARJOINT.

virtual void Ravelin::JOINT::calc_constraint_jacobian_dot ( bool  inboard,
MATRIXN Cq 
)
pure virtual

Computes the time derivative of the constraint Jacobian for this joint with respect to the given body.

Parameters
inboard'true' if the Jacobian is to be computed w.r.t. the inboard link; 'false' for the outboard
Cqa 6 x ndof matrix for the given body (on return)

Implemented in Ravelin::SPHERICALJOINT, Ravelin::SPHERICALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::FIXEDJOINT, Ravelin::FIXEDJOINT, Ravelin::PRISMATICJOINT, Ravelin::PRISMATICJOINT, Ravelin::REVOLUTEJOINT, Ravelin::REVOLUTEJOINT, Ravelin::PLANARJOINT, and Ravelin::PLANARJOINT.

virtual void Ravelin::JOINT::calc_constraint_jacobian_dot ( bool  inboard,
MATRIXN Cq 
)
pure virtual

Computes the time derivative of the constraint Jacobian for this joint with respect to the given body.

Parameters
inboard'true' if the Jacobian is to be computed w.r.t. the inboard link; 'false' for the outboard
Cqa 6 x ndof matrix for the given body (on return)

Implemented in Ravelin::SPHERICALJOINT, Ravelin::SPHERICALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::FIXEDJOINT, Ravelin::FIXEDJOINT, Ravelin::PRISMATICJOINT, Ravelin::PRISMATICJOINT, Ravelin::REVOLUTEJOINT, Ravelin::REVOLUTEJOINT, Ravelin::PLANARJOINT, and Ravelin::PLANARJOINT.

virtual void Ravelin::JOINT::evaluate_constraints ( REAL  C[])
pure virtual

Evaluates the constraint equations for this joint.

When the joint constraints are exactly satisfied, the result will be the zero vector.

Parameters
Ca vector of size num_constraint_eqns(); contains the evaluation (on return)
Note
only used by maximal-coordinate articulated bodies

Implemented in Ravelin::UNIVERSALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::SPHERICALJOINT, Ravelin::SPHERICALJOINT, Ravelin::FIXEDJOINT, Ravelin::FIXEDJOINT, Ravelin::PRISMATICJOINT, Ravelin::PRISMATICJOINT, Ravelin::REVOLUTEJOINT, Ravelin::REVOLUTEJOINT, Ravelin::PLANARJOINT, and Ravelin::PLANARJOINT.

virtual void Ravelin::JOINT::evaluate_constraints ( REAL  C[])
pure virtual

Evaluates the constraint equations for this joint.

When the joint constraints are exactly satisfied, the result will be the zero vector.

Parameters
Ca vector of size num_constraint_eqns(); contains the evaluation (on return)
Note
only used by maximal-coordinate articulated bodies

Implemented in Ravelin::UNIVERSALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::SPHERICALJOINT, Ravelin::SPHERICALJOINT, Ravelin::FIXEDJOINT, Ravelin::FIXEDJOINT, Ravelin::PRISMATICJOINT, Ravelin::PRISMATICJOINT, Ravelin::REVOLUTEJOINT, Ravelin::REVOLUTEJOINT, Ravelin::PLANARJOINT, and Ravelin::PLANARJOINT.

boost::shared_ptr<ARTICULATED_BODY> Ravelin::JOINT::get_articulated_body ( )
inline

Gets the articulated body corresponding to this body.

Returns
a pointer to the articulated body, or NULL if this body is not a link an articulated body
boost::shared_ptr<ARTICULATED_BODY> Ravelin::JOINT::get_articulated_body ( )
inline

Gets the articulated body corresponding to this body.

Returns
a pointer to the articulated body, or NULL if this body is not a link an articulated body
virtual boost::shared_ptr<const POSE3> Ravelin::JOINT::get_induced_pose ( )
pure virtual

Abstract method to get the local transform for this joint.

The local transform for the joint transforms the coordinate frame attached to the joint center and aligned with the inner link frame.

Implemented in Ravelin::UNIVERSALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::SPHERICALJOINT, Ravelin::SPHERICALJOINT, Ravelin::FIXEDJOINT, Ravelin::FIXEDJOINT, Ravelin::PLANARJOINT, Ravelin::PLANARJOINT, Ravelin::PRISMATICJOINT, Ravelin::PRISMATICJOINT, Ravelin::REVOLUTEJOINT, and Ravelin::REVOLUTEJOINT.

virtual boost::shared_ptr<const POSE3> Ravelin::JOINT::get_induced_pose ( )
pure virtual

Abstract method to get the local transform for this joint.

The local transform for the joint transforms the coordinate frame attached to the joint center and aligned with the inner link frame.

Implemented in Ravelin::UNIVERSALJOINT, Ravelin::UNIVERSALJOINT, Ravelin::SPHERICALJOINT, Ravelin::SPHERICALJOINT, Ravelin::FIXEDJOINT, Ravelin::FIXEDJOINT, Ravelin::PLANARJOINT, Ravelin::PLANARJOINT, Ravelin::PRISMATICJOINT, Ravelin::PRISMATICJOINT, Ravelin::REVOLUTEJOINT, and Ravelin::REVOLUTEJOINT.

virtual const std::vector<SVELOCITY>& Ravelin::JOINT::get_spatial_axes_dot ( )
pure virtual
virtual const std::vector<SVELOCITY>& Ravelin::JOINT::get_spatial_axes_dot ( )
pure virtual
virtual void Ravelin::JOINT::init_data ( )
protectedvirtual

Method for initializing all variables in the joint.

This method should be called at the beginning of all constructors of all derived classes.

virtual void Ravelin::JOINT::init_data ( )
protectedvirtual

Method for initializing all variables in the joint.

This method should be called at the beginning of all constructors of all derived classes.

Referenced by Ravelin::PRISMATICJOINT::PRISMATICJOINT(), and Ravelin::UNIVERSALJOINT::UNIVERSALJOINT().

virtual bool Ravelin::JOINT::is_singular_config ( ) const
pure virtual
virtual bool Ravelin::JOINT::is_singular_config ( ) const
pure virtual
void Ravelin::JOINT::set_articulated_body ( boost::shared_ptr< ARTICULATED_BODY abody)
inline

Sets the articulated body corresponding to this body.

Parameters
bodya pointer to the articulated body or NULL if this body is not a link in an articulated body
void Ravelin::JOINT::set_articulated_body ( boost::shared_ptr< ARTICULATED_BODY abody)
inline

Sets the articulated body corresponding to this body.

Parameters
bodya pointer to the articulated body or NULL if this body is not a link in an articulated body
void Ravelin::JOINT::set_coord_index ( unsigned  index)
inline

Sets the coordinate index for this joint.

This is set automatically by the articulated body. Users should not change this index or unknown behavior will result.

void Ravelin::JOINT::set_coord_index ( unsigned  index)
inline

Sets the coordinate index for this joint.

This is set automatically by the articulated body. Users should not change this index or unknown behavior will result.

void Ravelin::JOINT::set_index ( unsigned  index)
inline

Sets the joint index.

This is set automatically by the articulated body. Users should not change this index or unknown behavior will result.

void Ravelin::JOINT::set_index ( unsigned  index)
inline

Sets the joint index.

This is set automatically by the articulated body. Users should not change this index or unknown behavior will result.

Member Data Documentation

VECTORN JOINT::_q_tare
protected

The stored "tare" value for the initial joint configuration.

The tare value is the value that the joint assumes in the an articulated body's initial configuration. This value is necessary so that- when the body's joints are set to the zero vector- the body re-enters the initial configuration.

Referenced by Ravelin::PRISMATICJOINT::get_induced_pose(), Ravelin::UNIVERSALJOINT::get_rotation(), Ravelin::UNIVERSALJOINT::get_spatial_axes(), and Ravelin::UNIVERSALJOINT::get_spatial_axes_dot().

std::vector< SVELOCITY > JOINT::_s
protected

The spatial axes (in joint frame) for the joint.

Spatial axes are used in the dynamics equations for reduced-coordinate articulated bodies only.

Referenced by Ravelin::UNIVERSALJOINT::get_spatial_axes(), Ravelin::PRISMATICJOINT::update_spatial_axes(), and Ravelin::UNIVERSALJOINT::update_spatial_axes().


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