raisim::Joint
class · #include <raisim/object/ArticulatedSystem/JointAndBodies.hpp>
Joint connecting a body to its parent; used to build an articulated system (see Child).
Public types
Type
enum Type : intJoint type.
| Enumerator | Value | Description |
|---|---|---|
FIXED | 0 | No degree of freedom. At the root, it means a fixed base; elsewhere, the child is merged into its movable parent. |
REVOLUTE | 1 rotational DOF about the axis (gc: 1, gv: 1). | |
PRISMATIC | 1 translational DOF along the axis (gc: 1, gv: 1). | |
SPHERICAL | Ball joint (gc: quaternion w,x,y,z; gv: angular velocity in the child body frame). | |
FLOATING | Free 6-DOF joint, only allowed at the root (gc: position + quaternion; gv: linear + angular velocity in the world frame). |
Constructors & destructor
Joint
Joint()Joint(
const Vec<3> &joint_axis,
const Vec<3> &joint_pos_P,
const Mat<3, 3> &joint_rot,
const Vec<2> &joint_limit,
Type joint_type,
const std::string &joint_name)if upper and lower bounds of the limit are the same, the limit is ignored
Parameters
| Parameter | Description |
|---|---|
joint_axis (in) | joint axis in the joint frame |
joint_pos_P (in) | joint position in the parent body frame [m] |
joint_rot (in) | joint frame orientation relative to the parent body frame |
joint_limit (in) | {lower, upper} [rad or m] |
joint_type (in) | joint type |
joint_name (in) | joint name |
Public member functions
jointAxis
void jointAxis(std::initializer_list<double> a)Parameters
| Parameter | Description |
|---|---|
a (in) | joint axis {x, y, z} (first 3 values are used) |
jointPosition
void jointPosition(std::initializer_list<double> p)Parameters
| Parameter | Description |
|---|---|
p (in) | joint position in the parent body frame {x, y, z} [m] (first 3 values are used) |
void jointPosition(const Vec<3> &p)Parameters
| Parameter | Description |
|---|---|
p (in) | joint position in the parent body frame [m] |
getGcDim
size_t getGcDim()Returns generalized coordinate dimension: 0 (fixed), 1 (revolute/prismatic), 4 (spherical), 7 (floating)
getGvDim
size_t getGvDim()Returns generalized velocity dimension: 0 (fixed), 1 (revolute/prismatic), 3 (spherical), 6 (floating)
Static member functions
getFloatingBaseJoint static
static Joint getFloatingBaseJoint()Returns a default joint of type FLOATING
Public attributes
axis
Vec<3> axisJoint axis expressed in the joint frame (the parent body frame rotated by rot).
pos_P
Vec<3> pos_PJoint position in parent frame.
rot
Mat<3, 3> rotJoint frame orientation relative to the parent body frame.
limit
Vec<2> limitJoint limits (lower, upper) [rad or m]. For a spherical joint, limit[0] is the maximum angle. Equal bounds mean no limit.
type
Type typeJoint type.
effort
double effortEffort limit (torque/force). If positive, the actuation limits are set to [-effort, effort].
damping
double dampingJoint damping coefficient.
friction
double frictionJoint friction coefficient. Stored, but currently not used by the ArticulatedSystem dynamics.
stiffness
double stiffnessJoint spring stiffness. If positive, a spring element with rest configuration springMount is created.
rotor_inertia
double rotor_inertiaRotor inertia about the joint axis (added to the mass matrix diagonal).
velocity_limit
double velocity_limitJoint velocity limit. Infinity means "no limit configured" – do NOT overload 0 for that, since an explicit velocity="0" (URDF) or maxJointVelocity=0 (USD) is a legitimate request to hold the joint still and must still be enforced. Loaders that do not read a velocity limit leave this at infinity; ArticulatedSystem enforces the limit whenever it is finite.
springMount
Vec<4> springMountSpring rest configuration: springMount[0] for revolute/prismatic joints, a rotation quaternion (w,x,y,z) for spherical joints, which a positive stiffness requires (it is normalized; a zero one is fatal).
jointRef
double jointRefReference joint position (MJCF "ref") of a revolute/prismatic joint: the joint is offset so that the model's nominal pose corresponds to this coordinate, which is also the initial generalized coordinate.
name
std::string nameJoint name.