11 #ifndef __RDL_JOINT_H__ 12 #define __RDL_JOINT_H__ 315 throw RdlException(
"Error: Invalid use of Joint constructor Joint(JointType type). Only allowed when type != JointTypeCustom");
319 throw RdlException(
"Error: Invalid use of Joint constructor Joint(JointType type).");
330 for (
unsigned int i = 0; i <
mDoFCount; ++i)
337 throw RdlException(
"Error: Invalid use of Joint constructor Joint(JointType type, int degreesOfFreedom). Only allowed when type == JointTypeCustom.");
345 for (
unsigned int i = 0; i <
mDoFCount; i++)
365 for (
unsigned int i = 0; i <
mDoFCount; i++)
409 mJointAxes[0].
set(joint_axis[0], joint_axis[1], joint_axis[2], 0., 0., 0.);
414 assert(joint_axis.squaredNorm() == 1.);
416 mJointAxes[0].
set(0., 0., 0., joint_axis[0], joint_axis[1], joint_axis[2]);
600 if (fabs(axis.norm() - 1.0) > 1.0e-8)
602 std::cerr <<
"Warning: joint axis is not unit!" << std::endl;
605 bool axis_rotational =
false;
606 bool axis_translational =
false;
611 if (fabs(translation.norm()) < 1.0e-8)
613 axis_rotational =
true;
616 if (fabs(rotation.norm()) < 1.0e-8)
618 axis_translational =
true;
621 return axis_rotational || axis_translational;
701 #endif // ifndef __RDL_JOINT_H__
EIGEN_STRONG_INLINE void set(const double &v0, const double &v1, const double &v2, const double &v3, const double &v4, const double &v5)
3 DoF joint that uses Euler ZYX convention (faster than emulated
Joint(const Math::SpatialVector &axis_0)
Constructs a 1 DoF joint with the given motion subspaces.
Joint & operator=(const Joint &joint)
User defined joints of varying size.
CustomJoint is a struct used to create a joint with user defined parameters. This is accomplished by ...
CustomJoint()
Constructor.
Joint(JointType type, int degreesOfFreedom)
Fixed joint which causes the inertial properties to be merged with.
void jcalc(Model &model, unsigned int joint_id, const Math::VectorNd &q, const Math::VectorNd &qdot)
Computes all variables for a joint model and updates the body frame as well as the body's center of m...
Joint(const Math::SpatialVector &axis_0, const Math::SpatialVector &axis_1)
Constructs a 2 DoF joint with the given motion subspaces.
Joint(const Joint &joint)
bool validate_spatial_axis(Math::SpatialVector &axis)
Checks whether we have pure rotational or translational axis.
Math::SpatialTransform XJ
Joint(const Math::SpatialVector &axis_0, const Math::SpatialVector &axis_1, const Math::SpatialVector &axis_2)
Constructs a 3 DoF joint with the given motion subspaces.
unsigned int custom_joint_index
Describes a joint relative to the predecessor body.
3 DoF joint that uses Euler XYZ convention (faster than emulated
Math::SpatialTransform jcalc_XJ(Model &model, unsigned int joint_id, const Math::VectorNd &q)
virtual ~CustomJoint()
Destructor.
Joint(const Math::SpatialVector &axis_0, const Math::SpatialVector &axis_1, const Math::SpatialVector &axis_2, const Math::SpatialVector &axis_3, const Math::SpatialVector &axis_4)
Constructs a 5 DoF joint with the given motion subspaces.
JointType
General types of joints.
unsigned int mDoFCount
Number of degrees of freedom of the joint. Note: CustomJoints.
Math::SpatialVector * mJointAxes
The spatial axes of the joint.
Contains all information about the rigid body model.
A 6-DoF joint for floating-base (or freeflyer) systems.
void jcalc_X_lambda_S(Model &model, unsigned int joint_id, const Math::VectorNd &q)
Joint(const Math::SpatialVector &axis_0, const Math::SpatialVector &axis_1, const Math::SpatialVector &axis_2, const Math::SpatialVector &axis_3)
Constructs a 4 DoF joint with the given motion subspaces.
Joint(const Math::SpatialVector &axis_0, const Math::SpatialVector &axis_1, const Math::SpatialVector &axis_2, const Math::SpatialVector &axis_3, const Math::SpatialVector &axis_4, const Math::SpatialVector &axis_5)
Constructs a 6 DoF joint with the given motion subspaces.
3 DoF joint using Quaternions for joint positional variables and
Joint(const JointType joint_type, const Math::Vector3d &joint_axis)
Constructs a joint from the given cartesian parameters.
JointType mJointType
Type of joint.
Namespace for all structures of the RobotDynamics library.
3 DoF joint that uses Euler YXZ convention (faster than emulated