Ravelin
UniversalJoint.h
1 /****************************************************************************
2  * Copyright 2014 Evan Drumwright
3  * This library is distributed under the terms of the Apache V2.0 License
4  ****************************************************************************/
5 
6 #ifndef UNIVERSALJOINT
7 #error This class is not to be included by the user directly. Use UniversalJointd.h or UniversalJointf.h instead.
8 #endif
9 
11 class UNIVERSALJOINT : public virtual JOINT
12 {
13  public:
14  enum Axis { eAxis1, eAxis2 };
16  VECTOR3 get_axis(Axis a) const;
17  void set_axis(const VECTOR3& axis, Axis a);
18  virtual void update_spatial_axes();
19  virtual void determine_q(VECTORN& q);
20  virtual boost::shared_ptr<const POSE3> get_induced_pose();
21  virtual const std::vector<SVELOCITY>& get_spatial_axes();
22  virtual const std::vector<SVELOCITY>& get_spatial_axes_dot();
23  virtual unsigned num_dof() const { return 2; }
24  virtual void evaluate_constraints(REAL C[]);
25  virtual void calc_constraint_jacobian(bool inboard, MATRIXN& Cq);
26  virtual void calc_constraint_jacobian_dot(bool inboard, MATRIXN& Cq);
27 
29  virtual bool is_singular_config() const { return false; }
30 
31  protected:
32  bool assign_axes();
33  MATRIX3 get_rotation() const;
34 
36  VECTOR3 _u[2];
37 
40 
42  std::vector<SVELOCITY> _s_dot;
43 
44  void setup_joint();
45 
46 }; // end class
VECTOR3 _u[2]
The local joint axes.
Definition: UniversalJoint.h:36
virtual void evaluate_constraints(REAL C[])
Evaluates the constraint equations for this joint.
virtual void determine_q(VECTORN &q)
Abstract method to determine the value of Q (joint position) from current transforms.
virtual void calc_constraint_jacobian(bool inboard, MATRIXN &Cq)
Computes the constraint Jacobian for this joint with respect to the given body.
virtual const std::vector< SVELOCITY > & get_spatial_axes_dot()
Abstract method to get the spatial axes derivatives for this joint.
VECTOR3 _h2
The second joint axis in outboard pose frame.
Definition: UniversalJoint.h:39
virtual boost::shared_ptr< const POSE3 > get_induced_pose()
Abstract method to get the local transform for this joint.
A generic, possibly non-square matrix.
Definition: MatrixN.h:18
Defines a joint for purely rotational motion.
Definition: UniversalJoint.h:11
VECTORN q
The position of this joint.
Definition: Joint.h:144
A generic N-dimensional floating point vector.
Definition: VectorN.h:16
virtual bool is_singular_config() const
Universal joint is never singular.
Definition: UniversalJoint.h:29
A three-dimensional floating point vector used for representing points and vectors in 3D with associa...
Definition: Vector3.h:15
Defines a bilateral constraint (a joint)
Definition: Joint.h:14
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...
A 3x3 matrix that may be used for orientation, inertia tensors, etc.
Definition: Matrix3.h:20
virtual const std::vector< SVELOCITY > & get_spatial_axes()
Gets the spatial axes for this joint.
virtual void update_spatial_axes()
Abstract method to update the local spatial axes.
virtual unsigned num_dof() const
Gets the number of degrees-of-freedom for this joint.
Definition: UniversalJoint.h:23
std::vector< SVELOCITY > _s_dot
The derivative of the spatial axis.
Definition: UniversalJoint.h:42