Physsim::UniversalJoint Class Reference

Defines an actuated universal joint. More...

#include <UniversalJoint.h>

Inheritance diagram for Physsim::UniversalJoint:

Physsim::Joint Physsim::Visualizable Physsim::Base List of all members.

Public Types

enum  Axis { eAxis1, eAxis2 }

Public Member Functions

 UniversalJoint ()
 Initializes the joint.
virtual void clone (BasePtr &cloned, bimap< BasePtr, BasePtr > *obj_map=NULL) const
 Clones this object.
virtual void load_state (BaseConstPtr object, bimap< BasePtr, BasePtr > *correspondence=NULL)
 Loads the state of this object.
virtual void save_state (BasePtr object, bimap< BasePtr, BasePtr > *correspondence=NULL) const
 Saves the state of this object.
 UniversalJoint (boost::weak_ptr< RigidBody > inboard, boost::weak_ptr< RigidBody > outboard)
 Initializes the joint with the specified inboard and outboard links.
Vector3 get_axis_global (Axis a) const
 Gets the global axis for this joint.
void set_axis_global (const Vector3 &axis, Axis a)
 Sets the global axis for this joint.
void set_axis_local (const Vector3 &axis, Axis a)
 Sets the local axis of translation for this joint.
virtual void update_spatial_axes ()
 Updates the spatial axis for this joint.
virtual void determine_Q ()
 Determines (and sets) the value of Q from the axes and the inboard link and outboard link transforms.
virtual const Matrix4get_transform ()
 Gets the transform induced by this joint.
virtual const SMatrixNget_spatial_axes (ReferenceFrameType type)
 Gets the spatial axes for this joint.
virtual const SMatrixNget_spatial_axes_deriv (ReferenceFrameType type)
 Gets the derivative of the spatial-axis.
virtual void load_from_xml (XMLTreeConstPtr node, std::map< std::string, BasePtr > &id_map)
 Implements Base::load_from_xml().
virtual void save_to_xml (XMLTreePtr node, std::list< BaseConstPtr > &shared_objects) const
 Implements Base::save_to_xml().
virtual unsigned get_num_dof () const
 Gets the number of degrees-of-freedom for this joint.
virtual bool is_singular_config () const
 Universal joint can never be in a singular configuration.
const Vector3get_axis_local (Axis a) const
 Gets the unit vector describing the local axis of rotation for this joint.

Detailed Description

Defines an actuated universal joint.


Constructor & Destructor Documentation

UniversalJoint::UniversalJoint (  ) 

Initializes the joint.

The axes of rotation are each set to [0 0 0]. The inboard and outboard links are set to NULL.

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

Initializes the joint with the specified inboard and outboard links.

The axis of rotation is set to [0 0 0]. Note that it is possible that the inboard link is NULL, indicating that this joint connects the base to the outboard link.


Member Function Documentation

void UniversalJoint::load_state ( BaseConstPtr  object,
bimap< BasePtr, BasePtr > *  correspondence = NULL 
) [virtual]

Loads the state of this object.

The underlying penalty resting contact method must have identical structure.

Reimplemented from Physsim::Joint.

void UniversalJoint::save_state ( BasePtr  object,
bimap< BasePtr, BasePtr > *  correspondence = NULL 
) const [virtual]

Saves the state of this object.

The underlying penalty resting contact method must have identical structure.

Reimplemented from Physsim::Joint.

Vector3 UniversalJoint::get_axis_global ( Axis  a  )  const

Gets the global axis for this joint.

The global axis for this joint takes the orientation of the inboard link into account; thus, if the orientation of the inboard link changes, then the global axis changes.

See also:
getAxisLocal()

setAxisLocal()

void UniversalJoint::set_axis_global ( const Vector3 axis,
Axis  a 
)

Sets the global axis for this joint.

The global axis for this joint takes the orientation of the inboard link into account; thus, if the orientation of the inboard link changes, then the global axis changes.

Note:
set_axis_global() should be called on all axes before setting q!
See also:
getAxisLocal()

setAxisLocal()

void UniversalJoint::set_axis_local ( const Vector3 axis,
Axis  a 
)

Sets the local axis of translation for this joint.

The local axis for this joint does not take the orientation of the inboard link into account; thus, if the orientation of the inboard link changes, then the local axis remains constant.

Parameters:
axis a unit vector
See also:
get_axis_global()

set_axis_global()

const SMatrixN & UniversalJoint::get_spatial_axes ( ReferenceFrameType  rftype  )  [virtual]

Gets the spatial axes for this joint.

Note:
these spatial axes are not constant, unlike many joints.

Reimplemented from Physsim::Joint.

const SMatrixN & UniversalJoint::get_spatial_axes_deriv ( ReferenceFrameType  rftype  )  [virtual]

Gets the derivative of the spatial-axis.

Note:
these spatial axes are not constant, unlike many joints.

Implements Physsim::Joint.

const Vector3& Physsim::UniversalJoint::get_axis_local ( Axis  a  )  const [inline]

Gets the unit vector describing the local axis of rotation for this joint.

The local axis for this joint does not take the orientation of the inboard link into account; thus, if the orientation of the inboard link changes, then the local axis remains constant.

See also:
get_axis_global()

set_axis_global()


The documentation for this class was generated from the following files:
Generated on Wed Oct 24 14:54:23 2007 for Physsim by  doxygen 1.5.1