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
LinkRef(size_t localId, ArticulatedSystem *system)Parameters
| Parameter | Description |
|---|---|
localId (in) | body index |
system (in) | the owning articulated system |
Public member functions
getPosition
void getPosition(Vec<3> &position) constParameters
| Parameter | Description |
|---|---|
position (out) | world-frame position of the body frame origin (its parent joint) [m] |
getOrientation
void getOrientation(Mat<3, 3> &orientation) constParameters
| Parameter | Description |
|---|---|
orientation (out) | world-frame orientation of the body frame |
getPose
void getPose(Vec<3> &position, Mat<3, 3> &orientation) constParameters
| Parameter | Description |
|---|---|
position (out) | world-frame position of the body frame origin [m] |
orientation (out) | world-frame orientation of the body frame |
getCollisionDefinition
CollisionDefinition *getCollisionDefinition(const std::string &name)Parameters
| Parameter | Description |
|---|---|
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
VisObject *getVisualObject(const std::string &name)Parameters
| Parameter | Description |
|---|---|
name (in) | visual object name |
Returns the visual object of this link, or nullptr if not found. Owned by the system.
setWeight
void setWeight(double weight)Set the body mass and call ArticulatedSystem::updateMassInfo().
Parameters
| Parameter | Description |
|---|---|
weight (in) | mass [kg] |
getWeight
double getWeight() constReturns body mass [kg]
setInertia
void setInertia(const Mat<3, 3> &inertia)Parameters
| Parameter | Description |
|---|---|
inertia (in) | inertia about the body COM, expressed in the body frame [kg m^2] |
getInertia
const Mat<3, 3> &getInertia() constReturns inertia about the body COM, expressed in the body frame [kg m^2]
setComPositionInParentFrame
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
| Parameter | Description |
|---|---|
com (in) | COM position in the body frame [m] |
getComPositionInParentFrame
const Vec<3> &getComPositionInParentFrame() constDespite 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
const std::unordered_map<std::string, CollisionDefinition *> &getCollisionSet() constReturns collision bodies of this link, keyed by name (collected when the LinkRef was created)
getVisualSet
const std::unordered_map<std::string, VisObject *> &getVisualSet() constReturns visual objects of this link, keyed by name (collected when the LinkRef was created)