Ravelin
PlanarJoint.h
1 /****************************************************************************
2  * Copyright 2015 Evan Drumwright
3  * This library is distributed under the terms of the Apache V2.0 License
4  ****************************************************************************/
5 
6 #ifndef PLANARJOINT
7 #error This class is not to be included by the user directly. Use PlanarJointd.h or PlanarJointf.h instead.
8 #endif
9 
11 class PLANARJOINT : public virtual JOINT
12 {
13  public:
14  PLANARJOINT();
15  virtual void update_spatial_axes();
16  virtual void determine_q(VECTORN& q);
17  virtual boost::shared_ptr<const POSE3> get_induced_pose();
18  virtual unsigned num_dof() const { return 3; }
19  virtual void evaluate_constraints(REAL C[]);
20  virtual void calc_constraint_jacobian(bool inboard, MATRIXN& Cq);
21  virtual void calc_constraint_jacobian_dot(bool inboard, MATRIXN& Cq);
22  virtual bool is_singular_config() const { return false; }
23  void set_normal(const VECTOR3& normal);
24  virtual const std::vector<SVELOCITY>& get_spatial_axes_dot() { return _s_dot; }
25 
26  protected:
27  void update_offset();
28 
30  VECTOR3 _vi, _vj;
31 
33  VECTOR3 _normal, _tan1, _tan2;
34 
36  REAL _offset;
37 
39  std::vector<SVELOCITY> _s_dot;
40 
41 }; // end class
42 
REAL _offset
The plane offset such that n'*x = offset.
Definition: PlanarJoint.h:36
std::vector< SVELOCITY > _s_dot
The derivative of the spatial axis.
Definition: PlanarJoint.h:39
Defines a joint that constrains motion to a plane.
Definition: PlanarJoint.h:11
virtual bool is_singular_config() const
Gets whether this joint is in a singular configuration.
Definition: PlanarJoint.h:22
virtual void update_spatial_axes()
Updates the spatial axis for this joint.
Definition: PlanarJoint.cpp:51
void set_normal(const VECTOR3 &normal)
Sets the normal vector to the plane.
Definition: PlanarJoint.cpp:31
A generic, possibly non-square matrix.
Definition: MatrixN.h:18
void update_offset()
Updates the offset value to the plane.
Definition: PlanarJoint.cpp:38
virtual void calc_constraint_jacobian(bool inboard, MATRIXN &Cq)
Computes the constraint jacobian with respect to a body.
Definition: PlanarJoint.cpp:143
VECTORN q
The position of this joint.
Definition: Joint.h:144
virtual void determine_q(VECTORN &q)
Determines (and sets) the value of Q from the axes and the inboard link and outboard link transforms...
Definition: PlanarJoint.cpp:87
virtual void calc_constraint_jacobian_dot(bool inboard, MATRIXN &Cq)
Computes the time derivative of the constraint jacobian with respect to a body.
Definition: PlanarJoint.cpp:199
A generic N-dimensional floating point vector.
Definition: VectorN.h:16
virtual boost::shared_ptr< const POSE3 > get_induced_pose()
Gets the (local) transform for this joint.
Definition: PlanarJoint.cpp:93
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 evaluate_constraints(REAL C[])
Evaluates the constraint equations.
Definition: PlanarJoint.cpp:116
VECTOR3 _normal
The plane normal and tangents (global frame)
Definition: PlanarJoint.h:33
virtual const std::vector< SVELOCITY > & get_spatial_axes_dot()
Abstract method to get the spatial axes derivatives for this joint.
Definition: PlanarJoint.h:24
PLANARJOINT()
Initializes the joint.
Definition: PlanarJoint.cpp:11
VECTOR3 _vi
Vectors orthogonal to the normal vector in the outboard link frame.
Definition: PlanarJoint.h:30
virtual unsigned num_dof() const
Gets the number of degrees-of-freedom for this joint.
Definition: PlanarJoint.h:18