7 #error This class is not to be included by the user directly. Use Jointd.h or Jointf.h instead.
14 class JOINT :
public virtual_enable_shared_from_this<JOINT>
17 enum ConstraintType { eUnknown, eExplicit, eImplicit };
18 enum DOFs { DOF_1=0, DOF_2=1, DOF_3=2, DOF_4=3, DOF_5=4, DOF_6=5 };
24 ConstraintType get_constraint_type()
const {
return _constraint_type; }
37 boost::shared_ptr<ARTICULATED_BODY>
get_articulated_body() {
return (_abody.expired()) ? boost::shared_ptr<ARTICULATED_BODY>() : boost::shared_ptr<ARTICULATED_BODY>(_abody); }
47 virtual void set_inboard_link(boost::shared_ptr<RIGIDBODY> link,
bool update_pose);
48 virtual void set_outboard_link(boost::shared_ptr<RIGIDBODY> link,
bool update_pose);
49 void set_location(
const VECTOR3& p, boost::shared_ptr<RIGIDBODY> inboard, boost::shared_ptr<RIGIDBODY> outboard);
51 virtual void set_inboard_pose(boost::shared_ptr<const POSE3> inboard_pose,
bool update_joint_pose);
52 virtual void set_outboard_pose(boost::shared_ptr<POSE3> outboard_pose,
bool update_joint_pose);
59 boost::shared_ptr<RIGIDBODY>
get_inboard_link()
const {
return (_inboard_link.expired()) ? boost::shared_ptr<RIGIDBODY>() : boost::shared_ptr<RIGIDBODY>(_inboard_link); }
62 boost::shared_ptr<RIGIDBODY>
get_outboard_link()
const {
return (_outboard_link.expired()) ? boost::shared_ptr<RIGIDBODY>() : boost::shared_ptr<RIGIDBODY>(_outboard_link); }
81 void set_index(
unsigned index) { _joint_idx = index; }
100 boost::shared_ptr<const POSE3>
get_pose()
const {
return _F; };
141 virtual unsigned num_dof()
const = 0;
168 void invalidate_pose_vectors() {
get_outboard_link()->invalidate_pose_vectors(); }
169 boost::shared_ptr<const POSE3> get_inboard_pose() {
if (_inboard_link.expired())
return boost::shared_ptr<const POSE3>();
return get_inboard_link()->get_pose(); }
170 boost::shared_ptr<const POSE3> get_outboard_pose() {
if (_outboard_link.expired())
return boost::shared_ptr<const POSE3>();
return get_outboard_link()->get_pose(); }
176 boost::shared_ptr<POSE3>
_F;
179 boost::shared_ptr<POSE3>
_Fb;
193 std::vector<SVELOCITY>
_s;
204 boost::weak_ptr<RIGIDBODY> _inboard_link;
205 boost::weak_ptr<RIGIDBODY> _outboard_link;
206 boost::weak_ptr<ARTICULATED_BODY> _abody;
207 ConstraintType _constraint_type;
210 unsigned _constraint_idx;
boost::shared_ptr< POSE3 > _F
The frame of this joint.
Definition: Joint.h:176
Abstract class for articulated bodies.
Definition: ArticulatedBody.h:15
boost::shared_ptr< POSE3 > _Fprime
The frame induced by the joint.
Definition: Joint.h:173
std::vector< SVELOCITY > _s
The spatial axes (in joint frame) for the joint.
Definition: Joint.h:193
void set_constraint_type(ConstraintType type)
Sets whether this constraint is implicit or explicit (or unknown)
Definition: Joint.h:30
VECTORN lambda
Constraint forces calculated by forward dynamics.
Definition: Joint.h:71
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 b...
Definition: Joint.h:103
VECTORN _q_tare
The stored "tare" value for the initial joint configuration.
Definition: Joint.h:202
void set_index(unsigned index)
Sets the joint index.
Definition: Joint.h:81
virtual void determine_q(VECTORN &q)=0
Abstract method to determine the value of Q (joint position) from current transforms.
virtual const std::vector< SVELOCITY > & get_spatial_axes()
Gets the spatial axes for this joint.
Definition: Joint.cpp:187
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...
Definition: Joint.h:100
VECTORN qd
The velocity of this joint.
Definition: Joint.h:147
bool transform_jacobian(MATRIXN &J, bool use_inboard, MATRIXN &output)
Transforms a Jacobian (if necessary)
Definition: Joint.cpp:198
std::string joint_id
The ID of this joint.
Definition: Joint.h:27
A generic, possibly non-square matrix.
Definition: MatrixN.h:18
void reset_force()
Resets the force on the joint.
Definition: Joint.cpp:26
boost::shared_ptr< ARTICULATED_BODY > get_articulated_body()
Gets the articulated body corresponding to this body.
Definition: Joint.h:37
Represents a single rigid body.
Definition: RigidBody.h:23
virtual void calc_constraint_jacobian_dot(bool inboard, MATRIXN &Cq)=0
Computes the time derivative of the constraint Jacobian for this joint with respect to the given body...
virtual void evaluate_constraints_dot(REAL C[])
Evaluates the time derivative of the constraint equations.
Definition: Joint.cpp:277
boost::shared_ptr< POSE3 > _Fb
The frame of this joint backward from the outboard link.
Definition: Joint.h:179
VECTOR3 get_location(bool use_outboard=false) const
Gets the location of this joint.
Definition: Joint.cpp:164
VECTORN qdd
The acceleration of this joint.
Definition: Joint.h:65
virtual boost::shared_ptr< const POSE3 > get_induced_pose()=0
Abstract method to get the local transform for this joint.
virtual unsigned num_constraint_eqns() const
Gets the number of constraint equations for this joint.
Definition: Joint.h:112
virtual void calc_constraint_jacobian(bool inboard, MATRIXN &Cq)=0
Computes the constraint Jacobian for this joint with respect to the given body.
VECTORN q
The position of this joint.
Definition: Joint.h:144
void set_coord_index(unsigned index)
Sets the coordinate index for this joint.
Definition: Joint.h:94
void set_articulated_body(boost::shared_ptr< ARTICULATED_BODY > abody)
Sets the articulated body corresponding to this body.
Definition: Joint.h:44
boost::shared_ptr< RIGIDBODY > get_outboard_link() const
Gets the outboard link for this joint.
Definition: Joint.h:62
unsigned get_coord_index() const
Gets the starting coordinate index for this joint.
Definition: Joint.h:97
virtual bool is_singular_config() const =0
Gets whether this joint is in a singular configuration.
unsigned get_index() const
Gets the joint index (returns UINT_MAX if not set)
Definition: Joint.h:74
A generic N-dimensional floating point vector.
Definition: VectorN.h:16
void add_force(const VECTORN &force)
Adds a force to the joint.
Definition: Joint.cpp:32
unsigned get_constraint_index() const
Gets the constraint index for this joint.
Definition: Joint.h:84
void set_constraint_index(unsigned idx)
Sets the constraint index for this joint.
Definition: Joint.h:87
void calc_constraint_jacobian_numeric(bool inboard, MATRIXN &Cq)
Computes the constraint jacobian with respect to a body numerically
Definition: Joint.cpp:224
A three-dimensional floating point vector used for representing points and vectors in 3D with associa...
Definition: Vector3.h:15
virtual void update_spatial_axes()
Abstract method to update the local spatial axes.
Definition: Joint.cpp:70
Defines a bilateral constraint (a joint)
Definition: Joint.h:14
virtual void init_data()
Method for initializing all variables in the joint.
Definition: Joint.cpp:82
JOINT()
Initializes the joint.
Definition: Joint.cpp:10
virtual void evaluate_constraints(REAL C[])=0
Evaluates the constraint equations for this joint.
VECTORN force
The actuator force (user/controller sets this)
Definition: Joint.h:68
virtual const std::vector< SVELOCITY > & get_spatial_axes_dot()=0
Abstract method to get the spatial axes derivatives for this joint.
boost::shared_ptr< RIGIDBODY > get_inboard_link() const
Gets the inboard link for this joint.
Definition: Joint.h:59
virtual unsigned num_dof() const =0
Gets the number of degrees-of-freedom for this joint.