Skip to content

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 ​

cpp
enum Type : int

Joint type.

EnumeratorValueDescription
FIXED0No degree of freedom. At the root, it means a fixed base; elsewhere, the child is merged into its movable parent.
REVOLUTE1 rotational DOF about the axis (gc: 1, gv: 1).
PRISMATIC1 translational DOF along the axis (gc: 1, gv: 1).
SPHERICALBall joint (gc: quaternion w,x,y,z; gv: angular velocity in the child body frame).
FLOATINGFree 6-DOF joint, only allowed at the root (gc: position + quaternion; gv: linear + angular velocity in the world frame).

Constructors & destructor ​

Joint ​

cpp
Joint()
cpp
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

ParameterDescription
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 ​

cpp
void jointAxis(std::initializer_list<double> a)

Parameters

ParameterDescription
a (in)joint axis {x, y, z} (first 3 values are used)

jointPosition ​

cpp
void jointPosition(std::initializer_list<double> p)

Parameters

ParameterDescription
p (in)joint position in the parent body frame {x, y, z} [m] (first 3 values are used)
cpp
void jointPosition(const Vec<3> &p)

Parameters

ParameterDescription
p (in)joint position in the parent body frame [m]

getGcDim ​

cpp
size_t getGcDim()

Returns generalized coordinate dimension: 0 (fixed), 1 (revolute/prismatic), 4 (spherical), 7 (floating)

getGvDim ​

cpp
size_t getGvDim()

Returns generalized velocity dimension: 0 (fixed), 1 (revolute/prismatic), 3 (spherical), 6 (floating)

Static member functions ​

getFloatingBaseJoint static ​

cpp
static Joint getFloatingBaseJoint()

Returns a default joint of type FLOATING

Public attributes ​

axis ​

cpp
Vec<3> axis

Joint axis expressed in the joint frame (the parent body frame rotated by rot).

pos_P ​

cpp
Vec<3> pos_P

Joint position in parent frame.

rot ​

cpp
Mat<3, 3> rot

Joint frame orientation relative to the parent body frame.

limit ​

cpp
Vec<2> limit

Joint limits (lower, upper) [rad or m]. For a spherical joint, limit[0] is the maximum angle. Equal bounds mean no limit.

type ​

cpp
Type type

Joint type.

effort ​

cpp
double effort

Effort limit (torque/force). If positive, the actuation limits are set to [-effort, effort].

damping ​

cpp
double damping

Joint damping coefficient.

friction ​

cpp
double friction

Joint friction coefficient. Stored, but currently not used by the ArticulatedSystem dynamics.

stiffness ​

cpp
double stiffness

Joint spring stiffness. If positive, a spring element with rest configuration springMount is created.

rotor_inertia ​

cpp
double rotor_inertia

Rotor inertia about the joint axis (added to the mass matrix diagonal).

velocity_limit ​

cpp
double velocity_limit

Joint 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 ​

cpp
Vec<4> springMount

Spring 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 ​

cpp
double jointRef

Reference 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 ​

cpp
std::string name

Joint name.

RaiSim — physics for robotics and AI.