8 #error This class is not to be included by the user directly. Use DynamicBodyd.h or DynamicBodyf.h instead.
14 class DYNAMIC_BODY :
public virtual_enable_shared_from_this<DYNAMIC_BODY>
17 enum GeneralizedCoordinateType { eEuler, eSpatial };
28 virtual MATRIXN&
calc_jacobian(boost::shared_ptr<const POSE3> source_pose, boost::shared_ptr<const POSE3> target_pose, boost::shared_ptr<DYNAMIC_BODY> body,
MATRIXN& J) = 0;
29 virtual MATRIXN& calc_jacobian_dot(boost::shared_ptr<const POSE3> source_pose, boost::shared_ptr<const POSE3> target_pose, boost::shared_ptr<DYNAMIC_BODY> body,
MATRIXN& J) = 0;
56 virtual REAL
calc_kinetic_energy(boost::shared_ptr<const POSE3> P = boost::shared_ptr<const POSE3>()) = 0;
59 virtual boost::shared_ptr<const POSE3>
get_gc_pose()
const = 0;
188 X.
resize(NGC, B.columns());
198 X.
resize(NGC, B.columns());
virtual void set_generalized_coordinates_euler(const SHAREDVECTORN &gc)=0
Sets the generalized coordinates of this body (using Euler parameters for any rigid body orientations...
virtual MATRIXN & solve_generalized_inertia(const SHAREDMATRIXN &B, MATRIXN &X)
Solves using the inverse generalized inertia.
Definition: DynamicBody.h:195
virtual MATRIXN & calc_jacobian(boost::shared_ptr< const POSE3 > source_pose, boost::shared_ptr< const POSE3 > target_pose, boost::shared_ptr< DYNAMIC_BODY > body, MATRIXN &J)=0
The Jacobian transforms from the generalized coordinate from to the given frame.
virtual SHAREDVECTORN & convert_to_generalized_force(boost::shared_ptr< SINGLE_BODY > body, const SFORCE &w, SHAREDVECTORN &gf)=0
Converts a force to a generalized force.
SHAREDVECTORN segment(unsigned start_idx, unsigned end_idx)
Gets a subvector of this vector as a shared vector.
Definition: VectorN.cpp:245
virtual MATRIXN & resize(unsigned rows, unsigned columns, bool preserve=false)
Resizes this matrix, optionally preserving its existing elements.
Definition: MatrixN.cpp:274
CONST_SHAREDMATRIXN block(unsigned row_start, unsigned row_end, unsigned col_start, unsigned col_end) const
Gets a block as a constant shared matrix.
Definition: MatrixN.h:505
Quaternion class used for orientation.
Definition: Quat.h:21
virtual SHAREDMATRIXN & transpose_solve_generalized_inertia(const MATRIXN &B, SHAREDMATRIXN &X)
Solves the transpose matrix using the inverse generalized inertia.
Definition: DynamicBody.h:268
VECTORN gc
Temporaries for use with integration.
Definition: DynamicBody.h:330
virtual SHAREDVECTORN & solve_generalized_inertia(const VECTORN &b, SHAREDVECTORN &x)
Solves using the inverse generalized inertia.
Definition: DynamicBody.h:235
virtual SHAREDMATRIXN & solve_generalized_inertia(const SHAREDMATRIXN &B, SHAREDMATRIXN &X)=0
Solves using the inverse generalized inertia.
virtual SHAREDVECTORN & get_generalized_velocity(GeneralizedCoordinateType gctype, SHAREDVECTORN &gv)=0
Gets the generalized velocity of this body.
virtual void set_generalized_velocity(GeneralizedCoordinateType gctype, const VECTORN &gv)
Sets the generalized velocity of this body.
Definition: DynamicBody.h:161
Superclass for both rigid and deformable bodies.
Definition: SingleBody.h:14
virtual SHAREDVECTORN & get_generalized_coordinates_euler(SHAREDVECTORN &gc)=0
Gets the generalized coordinates of this body (using Euler parameters for any rigid body orientations...
virtual VECTORN & get_generalized_forces(VECTORN &f)
Gets the external forces on this body.
Definition: DynamicBody.h:289
A generic, possibly non-square matrix.
Definition: MatrixN.h:18
virtual VECTORN & convert_to_generalized_force(boost::shared_ptr< SINGLE_BODY > body, const SFORCE &w, VECTORN &gf)
Converts a force to a generalized force.
Definition: DynamicBody.h:315
virtual VECTORN & get_generalized_velocity(GeneralizedCoordinateType gctype, VECTORN &gv)
Gets the generalized velocity of this body.
Definition: DynamicBody.h:111
virtual SHAREDVECTORN & get_generalized_forces(SHAREDVECTORN &f)=0
Gets the external forces on this body.
virtual void add_generalized_force(const SHAREDVECTORN &gf)=0
Adds a generalized force to the body.
virtual void validate_position_variables()
Validates position-based variables (potentially dangerous for a user to call)
Definition: DynamicBody.h:32
virtual unsigned num_generalized_coordinates(GeneralizedCoordinateType gctype) const =0
Gets the number of generalized coordinates.
std::string body_id
The identifier for this body.
Definition: DynamicBody.h:22
virtual MATRIXN & transpose_solve_generalized_inertia(const SHAREDMATRIXN &B, MATRIXN &X)
Solves the transpose matrix using the inverse generalized inertia.
Definition: DynamicBody.h:258
virtual void set_generalized_forces(const SHAREDVECTORN &gf)=0
Sets the generalized forces on the body.
A generic, possibly non-square matrix using shared data.
Definition: SharedMatrixN.h:59
virtual void translate(const ORIGIN3 &o)=0
Translates the dynamic body by the given translation.
virtual void set_generalized_acceleration(const VECTORN &ga)
Sets the generalized acceleration of this body.
Definition: DynamicBody.h:124
virtual MATRIXN & solve_generalized_inertia(const MATRIXN &B, MATRIXN &X)
Solves using the inverse generalized inertia.
Definition: DynamicBody.h:184
A generic N-dimensional floating point vector.
Definition: SharedVectorN.h:15
virtual void set_generalized_forces(const VECTORN &gf)
Sets the generalized forces on the body.
Definition: DynamicBody.h:68
virtual void calc_fwd_dyn()=0
Forces a recalculation of forward dynamics.
virtual bool is_enabled() const =0
Gets whether the body's dynamics are integrated forward.
Superclass for deformable bodies and single and multi-rigid bodies.
Definition: DynamicBody.h:14
virtual SHAREDVECTORN & get_generalized_acceleration(SHAREDVECTORN &ga)=0
Gets the generalized velocity of this body.
ReferenceFrameType get_computation_frame_type() const
Gets the computation frame type for this body.
Definition: DynamicBody.h:41
virtual void apply_generalized_impulse(const VECTORN &gj)
Applies a generalized impulse to the body.
Definition: DynamicBody.h:88
ReferenceFrameType _rftype
The computation frame type.
Definition: DynamicBody.h:327
virtual void validate_velocity_variables()
Validates velocity-based variables (potentially dangerous for a user to call)
Definition: DynamicBody.h:35
virtual void rotate(const QUAT &q)=0
Rotates the dynamic body by the given orientation.
virtual void set_generalized_coordinates_euler(const VECTORN &gc)
Sets the generalized coordinates of this body (using Euler parameters for any rigid body orientations...
Definition: DynamicBody.h:147
virtual void set_generalized_acceleration(const SHAREDVECTORN &ga)=0
Sets the generalized velocity of this body.
A generic N-dimensional floating point vector.
Definition: VectorN.h:16
virtual void apply_generalized_impulse(const SHAREDVECTORN &gj)=0
Applies a generalized impulse to the body.
MATRIXN & get_generalized_inertia(MATRIXN &M)
Gets the generalized inertia of this body.
Definition: DynamicBody.h:168
virtual void set_computation_frame_type(ReferenceFrameType rftype)=0
Sets the computation frame type for this body.
virtual VECTORN & get_generalized_acceleration(VECTORN &ga)
Gets the generalized acceleration of this body.
Definition: DynamicBody.h:134
virtual SHAREDMATRIXN & solve_generalized_inertia(const MATRIXN &B, SHAREDMATRIXN &X)
Solves using the inverse generalized inertia.
Definition: DynamicBody.h:205
A spatial force (a wrench)
Definition: SForce.h:14
A three-dimensional floating point vector used for representing points and vectors in 3D and without ...
Definition: Origin3.h:16
virtual VECTORN & get_generalized_coordinates_euler(VECTORN &gc)
Gets the generalized coordinates of this body (using Euler parameters for any rigid body orientations...
Definition: DynamicBody.h:98
virtual void reset_accumulators()=0
Resets the force and torque accumulators on the dynamic body.
virtual boost::shared_ptr< const POSE3 > get_gc_pose() const =0
Gets the frame for generalized coordinates.
virtual void set_generalized_velocity(GeneralizedCoordinateType gctype, const SHAREDVECTORN &gv)=0
Sets the generalized velocity of this body.
virtual void add_generalized_force(const VECTORN &gf)
Adds a generalized force to the body.
Definition: DynamicBody.h:78
virtual VECTORN & solve_generalized_inertia(const SHAREDVECTORN &b, VECTORN &x)
Solves using the inverse generalized inertia.
Definition: DynamicBody.h:225
virtual VECTORN & solve_generalized_inertia(const VECTORN &b, VECTORN &x)
Solves using the inverse generalized inertia.
Definition: DynamicBody.h:214
virtual MATRIXN & transpose_solve_generalized_inertia(const MATRIXN &B, MATRIXN &X)
Solves the transpose matrix using the inverse generalized inertia.
Definition: DynamicBody.h:247
virtual REAL calc_kinetic_energy(boost::shared_ptr< const POSE3 > P=boost::shared_ptr< const POSE3 >())=0
Calculates the kinetic energy of the body in an arbitrary frame.