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
Child(const Body &body, const Joint &joint, const std::string &name)Parameters
| Parameter | Description |
|---|---|
body (in) | body of this node |
joint (in) | joint connecting this node to its parent |
name (in) | node (body) name |
Child()Public member functions
numberOfBodiesFromHere
size_t numberOfBodiesFromHere()Returns number of movable bodies in this subtree, including this node (fixed children are not counted)
numberOfDOFFromHere
size_t numberOfDOFFromHere()Returns generalized velocity dimension of this subtree
numberOfGCFromHere
size_t numberOfGCFromHere()Returns generalized coordinate dimension of this subtree
jointIdx
size_t jointIdx(std::string &nm, std::vector<std::string> &jointsNames)Parameters
| Parameter | Description |
|---|---|
nm (in) | joint name |
jointsNames (in) | joint names |
Returns index of nm in jointsNames, or size_t(-1) if not found
initCollisionBodies
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
| Parameter | Description |
|---|---|
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
void initVisuals(std::vector<VisObject> &collect)Internal: collect the visual objects of this subtree.
Parameters
| Parameter | Description |
|---|---|
collect (out) | visual objects |
consumeFixedBodies
void consumeFixedBodies(std::vector<CoordinateFrame> &frameOfInterest)Internal: merge fixed children into their movable parent and record their frames.
Parameters
| Parameter | Description |
|---|---|
frameOfInterest (out) | coordinate frames |
processJointRef
void processJointRef()Internal: apply Joint::jointRef offsets in this subtree.
changeParent
void changeParent(Child &ch, Child &gch)Internal: re-express grandchild gch's joint in the frame of ch's parent.
Parameters
| Parameter | Description |
|---|---|
ch (in) | child |
gch (in, out) | grandchild |
addChild
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
| Parameter | Description |
|---|---|
childNode (in) | child node (copied) |
Public attributes
body
Body bodyBody definition for this node.
joint
Joint jointJoint connecting this node to its parent.
name
std::string nameNode name (usually the child body name).
child
std::vector<Child> childMovable child nodes.
fixedBodies
std::vector<Child> fixedBodiesFixed child nodes.