Skip to content

raisim::Child ​

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

Node of a kinematic tree (a body plus the joint connecting it to its parent), used to build an ArticulatedSystem programmatically.

Constructors & destructor ​

Child ​

cpp
Child(const Body &body, const Joint &joint, const std::string &name)

Parameters

ParameterDescription
body (in)body of this node
joint (in)joint connecting this node to its parent
name (in)node (body) name
cpp
Child()

Public member functions ​

numberOfBodiesFromHere ​

cpp
size_t numberOfBodiesFromHere()

Returns number of movable bodies in this subtree, including this node (fixed children are not counted)

numberOfDOFFromHere ​

cpp
size_t numberOfDOFFromHere()

Returns generalized velocity dimension of this subtree

numberOfGCFromHere ​

cpp
size_t numberOfGCFromHere()

Returns generalized coordinate dimension of this subtree

jointIdx ​

cpp
size_t jointIdx(std::string &nm, std::vector<std::string> &jointsNames)

Parameters

ParameterDescription
nm (in)joint name
jointsNames (in)joint names

Returns index of nm in jointsNames, or size_t(-1) if not found

initCollisionBodies ​

cpp
void initCollisionBodies(
    CollisionSet &collect,
    std::vector<VisObject> &visCollect,
    std::vector<std::vector<float>> &meshVert,
    std::vector<std::vector<std::uint32_t>> &meshIdx,
    const std::string &resDir,
    bool convexifyMeshes)

Internal: create the collision bodies (and their visuals) of this subtree.

Parameters

ParameterDescription
collect (out)collision bodies
visCollect (out)collision visuals
meshVert (out)mesh vertices
meshIdx (out)mesh indices
resDir (in)resource directory for relative mesh paths
convexifyMeshes (in)convexify mesh collision bodies

initVisuals ​

cpp
void initVisuals(std::vector<VisObject> &collect)

Internal: collect the visual objects of this subtree.

Parameters

ParameterDescription
collect (out)visual objects

consumeFixedBodies ​

cpp
void consumeFixedBodies(std::vector<CoordinateFrame> &frameOfInterest)

Internal: merge fixed children into their movable parent and record their frames.

Parameters

ParameterDescription
frameOfInterest (out)coordinate frames

processJointRef ​

cpp
void processJointRef()

Internal: apply Joint::jointRef offsets in this subtree.

changeParent ​

cpp
void changeParent(Child &ch, Child &gch)

Internal: re-express grandchild gch's joint in the frame of ch's parent.

Parameters

ParameterDescription
ch (in)child
gch (in, out)grandchild

addChild ​

cpp
void addChild(const Child &childNode)

Add a child node. FIXED children go to fixedBodies (merged into this body when the system is built), other joints go to child. A FLOATING child is fatal.

Parameters

ParameterDescription
childNode (in)child node (copied)

Public attributes ​

body ​

cpp
Body body

Body definition for this node.

joint ​

cpp
Joint joint

Joint connecting this node to its parent.

name ​

cpp
std::string name

Node name (usually the child body name).

child ​

cpp
std::vector<Child> child

Movable child nodes.

fixedBodies ​

cpp
std::vector<Child> fixedBodies

Fixed child nodes.

RaiSim — physics for robotics and AI.