Ravelin
|
Defines a joint for purely rotational motion. More...
#include <UniversalJointd.h>
Public Types | |
enum | Axis { eAxis1, eAxis2, eAxis1, eAxis2 } |
enum | Axis { eAxis1, eAxis2, eAxis1, eAxis2 } |
Public Types inherited from Ravelin::JOINT | |
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 | |
UNIVERSALJOINT () | |
Initializes the joint. More... | |
VECTOR3 | get_axis (Axis a) const |
Gets the axis for this joint. | |
void | set_axis (const VECTOR3 &axis, Axis a) |
Sets an axis of rotation of this joint (MUST BE CALLED AFTER set_location(.)) More... | |
virtual void | update_spatial_axes () |
Updates the spatial axis for this joint. | |
virtual void | determine_q (VECTORN &q) |
Determines (and sets) the value of Q from the axes and the inboard link and outboard link transforms. | |
virtual boost::shared_ptr < const POSE3 > | get_induced_pose () |
Gets the transform induced by this joint. | |
virtual const std::vector < SVELOCITY > & | get_spatial_axes () |
Gets the spatial axes for this joint. More... | |
virtual const std::vector < SVELOCITY > & | get_spatial_axes_dot () |
Gets the derivative of the spatial-axis. More... | |
virtual unsigned | num_dof () const |
Gets the number of degrees-of-freedom for this joint. | |
virtual void | evaluate_constraints (REAL C[]) |
Evaluates the constraint equations. | |
virtual void | calc_constraint_jacobian (bool inboard, MATRIXN &Cq) |
Computes the constraint jacobian with respect to a body. | |
virtual void | calc_constraint_jacobian_dot (bool inboard, MATRIXN &Cq) |
Computes the time derivative of the constraint jacobian with respect to a body. More... | |
virtual bool | is_singular_config () const |
Universal joint is never singular. | |
VECTOR3 | get_axis (Axis a) const |
void | set_axis (const VECTOR3 &axis, Axis a) |
virtual void | update_spatial_axes () |
virtual void | determine_q (VECTORN &q) |
Abstract method to determine the value of Q (joint position) from current transforms. | |
virtual boost::shared_ptr < const POSE3 > | get_induced_pose () |
Abstract method to get the local transform for this joint. More... | |
virtual const std::vector < SVELOCITY > & | get_spatial_axes () |
virtual const std::vector < SVELOCITY > & | get_spatial_axes_dot () |
Abstract method to get the spatial axes derivatives for this joint. More... | |
virtual unsigned | num_dof () const |
Gets the number of degrees-of-freedom for this joint. | |
virtual void | evaluate_constraints (REAL C[]) |
Evaluates the constraint equations for this joint. More... | |
virtual void | calc_constraint_jacobian (bool inboard, MATRIXN &Cq) |
Computes the constraint Jacobian for this joint with respect to the given body. More... | |
virtual void | calc_constraint_jacobian_dot (bool inboard, MATRIXN &Cq) |
Computes the time derivative of the constraint Jacobian for this joint with respect to the given body. More... | |
virtual bool | is_singular_config () const |
Universal joint is never singular. | |
Public Member Functions inherited from Ravelin::JOINT | |
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 | evaluate_constraints_dot (REAL C[]) |
virtual void | set_q_tare (const VECTORN &tare) |
virtual const VECTORN & | get_q_tare () const |
boost::shared_ptr< RIGIDBODY > | get_inboard_link () const |
Gets the inboard link for this joint. | |
boost::shared_ptr< RIGIDBODY > | get_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 POSE3 > | get_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 POSE3 > | get_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 unsigned | num_constraint_eqns () const |
Gets the number of constraint equations for this joint. | |
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 | evaluate_constraints_dot (REAL C[]) |
virtual void | set_q_tare (const VECTORN &tare) |
virtual const VECTORN & | get_q_tare () const |
boost::shared_ptr< RIGIDBODY > | get_inboard_link () const |
Gets the inboard link for this joint. | |
boost::shared_ptr< RIGIDBODY > | get_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 POSE3 > | get_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 POSE3 > | get_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 unsigned | num_constraint_eqns () const |
Gets the number of constraint equations for this joint. | |
Public Member Functions inherited from Ravelin::virtual_enable_shared_from_this< JOINT > | |
boost::shared_ptr< JOINT > | shared_from_this () |
boost::shared_ptr< const JOINT > | shared_from_this () const |
Protected Member Functions | |
bool | assign_axes () |
MATRIX3 | get_rotation () const |
Gets the (local) transform for this joint. | |
void | setup_joint () |
bool | assign_axes () |
MATRIX3 | get_rotation () const |
void | setup_joint () |
Protected Member Functions inherited from Ravelin::JOINT | |
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 POSE3 > | get_inboard_pose () |
boost::shared_ptr< const POSE3 > | get_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 POSE3 > | get_inboard_pose () |
boost::shared_ptr< const POSE3 > | get_outboard_pose () |
virtual void | init_data () |
Method for initializing all variables in the joint. More... | |
Protected Attributes | |
VECTOR3 | _u [2] |
The local joint axes. | |
VECTOR3 | _h2 |
The second joint axis in outboard pose frame. | |
std::vector< SVELOCITY > | _s_dot |
The derivative of the spatial axis. | |
Protected Attributes inherited from Ravelin::JOINT | |
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 |
Additional Inherited Members | |
Public Attributes inherited from Ravelin::JOINT | |
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. | |
Defines a joint for purely rotational motion.
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.
References Ravelin::JOINT::_F, _h2, _s_dot, _u, Ravelin::JOINT::init_data(), num_dof(), and Ravelin::VECTOR3::pose.
|
virtual |
Computes the constraint Jacobian for this joint with respect to the given body.
inboard | 'true' if the Jacobian is to be computed w.r.t. the inboard link; 'false' for the outboard |
Cq | a 6 x ndof matrix for the given body (on return) |
Implements Ravelin::JOINT.
|
virtual |
Computes the time derivative of the constraint jacobian with respect to a body.
TODO: implement this
Implements Ravelin::JOINT.
|
virtual |
Computes the time derivative of the constraint Jacobian for this joint with respect to the given body.
inboard | 'true' if the Jacobian is to be computed w.r.t. the inboard link; 'false' for the outboard |
Cq | a 6 x ndof matrix for the given body (on return) |
Implements Ravelin::JOINT.
|
virtual |
Evaluates the constraint equations for this joint.
When the joint constraints are exactly satisfied, the result will be the zero vector.
C | a vector of size num_constraint_eqns(); contains the evaluation (on return) |
Implements Ravelin::JOINT.
|
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.
Implements Ravelin::JOINT.
|
virtual |
Gets the spatial axes for this joint.
Reimplemented from Ravelin::JOINT.
References Ravelin::JOINT::_q_tare, Ravelin::JOINT::_s, _u, Ravelin::JOINT::get_pose(), and Ravelin::JOINT::q.
|
virtual |
Abstract method to get the spatial axes derivatives for this joint.
Only applicable for reduced-coordinate articulated bodies
Implements Ravelin::JOINT.
|
virtual |
Gets the derivative of the spatial-axis.
Implements Ravelin::JOINT.
References Ravelin::JOINT::_q_tare, _s_dot, _u, Ravelin::JOINT::get_pose(), Ravelin::JOINT::q, and Ravelin::JOINT::qd.
void UNIVERSALJOINT::set_axis | ( | const VECTOR3 & | axis, |
Axis | a | ||
) |
Sets an axis of rotation of this joint (MUST BE CALLED AFTER set_location(.))
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.
axis | a unit vector |
References _h2, _u, Ravelin::JOINT::get_pose(), and update_spatial_axes().