Skip to content

raisim::ArticulatedSystem::JointRef ​

class · #include <raisim/object/ArticulatedSystem/ArticulatedSystem.hpp>

Lightweight handle to a joint (coordinate frame) of an ArticulatedSystem, obtained by getJoint(). It stores a raw pointer to the system, which must outlive the handle. Joint-coordinate accessors are fatal for fixed joints.

Constructors & destructor ​

JointRef ​

cpp
JointRef(size_t frameId, ArticulatedSystem *system)

Parameters

ParameterDescription
frameId (in)index of the joint's coordinate frame (see getFrameIdxByName())
system (in)the owning articulated system

Public member functions ​

getPosition ​

cpp
void getPosition(Vec<3> &position) const

Parameters

ParameterDescription
position (out)world-frame position of the joint frame [m]

getOrientation ​

cpp
Mat<3, 3> getOrientation() const

Returns world-frame orientation of the joint frame

getPose ​

cpp
void getPose(Vec<3> &position, Mat<3, 3> &orientation) const

Parameters

ParameterDescription
position (out)world-frame position of the joint frame [m]
orientation (out)world-frame orientation of the joint frame

getJointCoordinate ​

cpp
void getJointCoordinate(VecDyn &coordinate) const

Get this joint's segment of the generalized coordinate.

Parameters

ParameterDescription
coordinate (out)resized to 1 (revolute/prismatic), 4 (spherical, quaternion w,x,y,z) or 7 (floating: position + quaternion). Fatal for a fixed joint.

getJointAngle ​

cpp
double getJointAngle() const

Only for revolute and prismatic joints (fatal otherwise).

Returns joint position [rad or m]

getPositionInParentFrame ​

cpp
const raisim::Vec<3> &getPositionInParentFrame() const

Fatal for a fixed joint.

Returns joint position relative to the parent body, expressed in the parent body frame [m] (see ArticulatedSystem::getJointPos_P())

getJointAxis ​

cpp
const raisim::Vec<3> &getJointAxis() const

Fatal for a fixed joint.

Returns joint axis expressed in the joint frame (see ArticulatedSystem::getJointAxis_P())

getType ​

cpp
Joint::Type getType() const

Returns joint type

getIdxInGeneralizedCoordinate ​

cpp
size_t getIdxInGeneralizedCoordinate() const

Returns index of this joint's first element in the generalized coordinate, or size_t(-1) for a fixed joint

getLinearVelocity ​

cpp
Vec<3> getLinearVelocity() const

Returns world-frame linear velocity of the joint frame origin [m/s]

RaiSim — physics for robotics and AI.