Skip to content

raisim::ArticulatedSystem::LinkRef ​

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

Lightweight handle to a body (link) of an ArticulatedSystem, obtained by getLink(). It stores a raw pointer to the system, which must outlive the handle.

Constructors & destructor ​

LinkRef ​

cpp
LinkRef(size_t localId, ArticulatedSystem *system)

Parameters

ParameterDescription
localId (in)body index
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 body frame origin (its parent joint) [m]

getOrientation ​

cpp
void getOrientation(Mat<3, 3> &orientation) const

Parameters

ParameterDescription
orientation (out)world-frame orientation of the body frame

getPose ​

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

Parameters

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

getCollisionDefinition ​

cpp
CollisionDefinition *getCollisionDefinition(const std::string &name)

Parameters

ParameterDescription
name (in)collision body name (e.g., "LINK_NAME/0" for URDF models)

Returns the collision body of this link, or nullptr if not found. Owned by the system.

getVisualObject ​

cpp
VisObject *getVisualObject(const std::string &name)

Parameters

ParameterDescription
name (in)visual object name

Returns the visual object of this link, or nullptr if not found. Owned by the system.

setWeight ​

cpp
void setWeight(double weight)

Set the body mass and call ArticulatedSystem::updateMassInfo().

Parameters

ParameterDescription
weight (in)mass [kg]

getWeight ​

cpp
double getWeight() const

Returns body mass [kg]

setInertia ​

cpp
void setInertia(const Mat<3, 3> &inertia)

Parameters

ParameterDescription
inertia (in)inertia about the body COM, expressed in the body frame [kg m^2]

getInertia ​

cpp
const Mat<3, 3> &getInertia() const

Returns inertia about the body COM, expressed in the body frame [kg m^2]

setComPositionInParentFrame ​

cpp
void setComPositionInParentFrame(const Vec<3> &com)

Set the center of mass position. Despite the name, it is expressed in this body's own frame (the same storage as ArticulatedSystem::getBodyCOM_B()).

Parameters

ParameterDescription
com (in)COM position in the body frame [m]

getComPositionInParentFrame ​

cpp
const Vec<3> &getComPositionInParentFrame() const

Despite the name, the returned position is expressed in this body's own frame (the same storage as ArticulatedSystem::getBodyCOM_B()).

Returns COM position in the body frame [m]

getCollisionSet ​

cpp
const std::unordered_map<std::string, CollisionDefinition *> &getCollisionSet() const

Returns collision bodies of this link, keyed by name (collected when the LinkRef was created)

getVisualSet ​

cpp
const std::unordered_map<std::string, VisObject *> &getVisualSet() const

Returns visual objects of this link, keyed by name (collected when the LinkRef was created)

RaiSim — physics for robotics and AI.