Moby
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Friends | List of all members
Moby::Joint Class Reference

Defines a joint used in articulated rigid body dynamics simulation. More...

#include <Joint.h>

Inheritance diagram for Moby::Joint:
Moby::Visualizable Moby::Base Moby::FixedJoint Moby::Gears Moby::PlanarJoint Moby::PrismaticJoint Moby::RevoluteJoint Moby::ScrewJoint Moby::SphericalJoint Moby::UniversalJoint

Public Types

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

Public Member Functions

 Joint ()
 Initializes the joint. More...
 
 Joint (boost::weak_ptr< RigidBody > inboard, boost::weak_ptr< RigidBody > outboard)
 Initializes the joint with the specified inboard and outboard links. More...
 
void set_location (const Point3d &p, RigidBodyPtr inboard, RigidBodyPtr outboard)
 Sets the location of this joint with specified inboard and outboard links.
 
Ravelin::VectorNd & get_scaled_force (Ravelin::VectorNd &f)
 Gets the scaled actuator forces. More...
 
virtual void save_to_xml (XMLTreePtr node, std::list< boost::shared_ptr< const Base > > &shared_objects) const
 Implements Base::save_to_xml()
 
virtual void load_from_xml (boost::shared_ptr< const XMLTree > node, std::map< std::string, BasePtr > &id_map)
 Implements Base::load_from_xml()
 
virtual void set_inboard_link (RigidBodyPtr link, bool update_pose)
 Sets the pointer to the inboard link for this joint (and updates the spatial axes, if the outboard link has been set)
 
virtual void set_outboard_link (RigidBodyPtr link, bool update_pose)
 Sets the pointer to the outboard link for this joint. More...
 
void set_articulated_body (ArticulatedBodyPtr abody)
 Sets the articulated body corresponding to this body. More...
 
ArticulatedBodyPtr get_articulated_body ()
 Gets the articulated body corresponding to this body. More...
 
RigidBodyPtr get_inboard_link () const
 Gets the inboard link for this joint.
 
RigidBodyPtr get_outboard_link () const
 Gets the outboard link for this joint.
 
- Public Member Functions inherited from Moby::Visualizable
 Visualizable (const Visualizable *v)
 
virtual void update_visualization ()
 Updates the visualization using the appropriate transform. More...
 
void set_visualization_relative_pose (const Ravelin::Pose3d &P)
 Sets the visualization relative pose.
 
virtual void set_visualization_data (osg::Node *vdata)
 Sets the visualization data from a node.
 
virtual void set_visualization_data (OSGGroupWrapperPtr vdata)
 Sets the visualization data from a OSGGroupWrapper.
 
osg::Group * get_visualization_data () const
 Gets the visualization data for this object.
 
boost::shared_ptr< const
Ravelin::Pose3d > 
get_visualization_pose ()
 Gets the pose for this visualizable object.
 
- Public Member Functions inherited from Moby::Base
 Base (const Base *b)
 

Public Attributes

Ravelin::VectorNd lolimit
 The lower joint limit.
 
Ravelin::VectorNd hilimit
 The upper joint limit.
 
double limit_restitution
 The coefficient of restitution applied when this joint reaches a limit.
 
double mu_fc
 The coulomb friction coefficient for this joint.
 
double mu_fv
 The viscous friction coefficient for this joint.
 
double compliant_layer_depth
 The depth of the compliant layer around the joint limit.
 
- Public Attributes inherited from Moby::Base
boost::shared_ptr< void > userdata
 Any relevant userdata.
 
std::string id
 The unique ID for this object.
 

Protected Member Functions

void determine_q_dot ()
 (Relatively slow) method for determining the joint velocity from current link velocities
 
virtual void init_data ()
 Computes the constraint Jacobian for this joint with respect to the given body in Rodrigues parameters. More...
 

Friends

class ArticulatedBody
 

Additional Inherited Members

- Static Public Member Functions inherited from Moby::Visualizable
static osg::Group * construct_from_node (boost::shared_ptr< const XMLTree > node, const std::map< std::string, BasePtr > &id_map)
 Utility method for load_from_xml() More...
 
- Static Public Member Functions inherited from Moby::Base
template<class T >
static boost::shared_ptr< T > clone (boost::shared_ptr< T > x)
 Static method for cloning a shared pointer.
 
- Protected Attributes inherited from Moby::Visualizable
boost::shared_ptr
< Ravelin::Pose3d > 
_vF
 The relative pose.
 
OSGGroupWrapperPtr _vizdata
 The underlying visualization data.
 

Detailed Description

Defines a joint used in articulated rigid body dynamics simulation.

Todo:
implement a rest position for q?

Member Enumeration Documentation

The constraint type is implicit if constraint forces must be determined to hold the inner and outer links together and explicit otherwise.

Constructor & Destructor Documentation

Joint::Joint ( )

Initializes the joint.

The inboard and outboard links are set to NULL.

References Moby::Visualizable::_vF, compliant_layer_depth, limit_restitution, mu_fc, and mu_fv.

Joint::Joint ( boost::weak_ptr< RigidBody inboard,
boost::weak_ptr< RigidBody outboard 
)

Initializes the joint with the specified inboard and outboard links.

Note
does not set the inner joint for the outboard link or add the outboard as a child of the inboard link

References Moby::Visualizable::_vF, compliant_layer_depth, limit_restitution, mu_fc, and mu_fv.

Member Function Documentation

ArticulatedBodyPtr Joint::get_articulated_body ( )

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
VectorNd & Joint::get_scaled_force ( Ravelin::VectorNd &  f)

Gets the scaled actuator forces.

Note
relevant only to reduced-coordinate articulated bodies
void Joint::init_data ( )
protectedvirtual

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

Sets the number of degrees-of-freedom for this joint.

Parameters
bodythe body with which the constraint Jacobian will be calculated; if the body is not either the inner or outer link, the constraint Jacobian will be a zero matrix
indexthe index of the constraint equation for which to calculate
Cqa vector that contains the corresponding column of the constraint Jacobian on returnComputes the time derivative of the constraint Jacobian for this joint with respect to the given body in Rodrigues parameters
bodythe body with which the constraint Jacobian will be calculated; if the body is not either the inner or outer link, the constraint Jacobian will be a zero matrix
indexthe index of the constraint equation for which to calculate
Cqa vector that contains the corresponding column of the constraint Jacobian on returnMethod for initializing all variables in the joint This method should be called at the beginning of all constructors of all derived classes.
Note
resets all joint values (q, qd, qdd) to zero, limits to -/+ infinity, actuator forces to zero, and actuator limit to infinity.

References hilimit, and lolimit.

Referenced by Moby::FixedJoint::FixedJoint(), Moby::Gears::Gears(), Moby::PlanarJoint::PlanarJoint(), Moby::PrismaticJoint::PrismaticJoint(), Moby::RevoluteJoint::RevoluteJoint(), Moby::ScrewJoint::ScrewJoint(), Moby::SphericalJoint::SphericalJoint(), and Moby::UniversalJoint::UniversalJoint().

void Joint::set_articulated_body ( ArticulatedBodyPtr  abody)

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

Referenced by load_from_xml().

void Joint::set_outboard_link ( RigidBodyPtr  outboard,
bool  update_pose 
)
virtual

Sets the pointer to the outboard link for this joint.

Note
also points the outboard link to this joint

Referenced by load_from_xml(), and set_location().


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