Skip to content

raisim::Compound ​

class · #include <raisim/object/singleBodies/Compound.hpp>

Inherits: raisim::SingleBodyObject

A rigid body composed of primitive children (BOX, CYLINDER, CAPSULE, SPHERE) with user-given mass properties. Create it with World::addCompound().

Nested classes ​

Constructors & destructor ​

Compound ​

cpp
Compound(
    const std::vector<CompoundObjectChild> &list,
    double mass,
    const Vec<3> &COM,
    const Mat<3, 3> &inertia)

Parameters

ParameterDescription
list (in)children (at least two; fatal error otherwise)
mass (in)total mass (kg)
COM (in)center of mass in the body frame (m)
inertia (in)inertia about the COM in the body frame (kg m^2)

Public member functions ​

getObjList ​

cpp
const std::vector<CompoundObjectChild> &getObjList()

returns the children of the compound

Returns the children of the compound

getCollisionBodyList ​

cpp
const std::vector<CollisionBodyHandle> &getCollisionBodyList()

returns the collision list of the compound

Returns one collision body per child, in the order of getObjList()

setBodyType ​

cpp
void setBodyType(BodyType type) final

set the body type. Dynamic means that object is free to move. Kinematic means that the object can have velocity but has an infinite mass (like a conveyor belt). A kinematic body moves with its set velocity and ignores forces, gravity and contacts. Static means that the object cannot move and has an infinite mass.

Parameters

ParameterDescription
type (in)the body type

destroyCollisionBodies ​

cpp
void destroyCollisionBodies() final

Internal: releases collision bodies before removal.

updateContactAabbs ​

cpp
void updateContactAabbs() override

Internal: recomputes the world-frame AABBs used by the broadphase.

Inherited members ​

From raisim::SingleBodyObject: clearExternalForcesAndTorques, getAngularVelocity, getAppearance, getBodyToComPosition_rs, getCollisionBody, getCollisionGroup, getCollisionMask, getCom, getComPosition, getComPosition_rs, getContactPointVel, getDOF, getEnergy, getGeneralizedCoordinateDim, getGyroscopicMode, getInertiaMatrix_B, getInertiaMatrix_B_rs, getInertiaMatrix_W, getInertiaMatrix_W_rs, getKineticEnergy, getLinearMomentum, getLinearVelocity, getMass, getObjectType, getOrientation, getPosition, getPotentialEnergy, getQuaternion, getRotationMatrix, getVelocity, integrate, preContactSolverUpdate1, preContactSolverUpdate2, setAngularDamping, setAngularVelocity, setAppearance, setCom, setConstraintForce, setExternalForce, setExternalTorque, setGyroscopicMode, setInertia, setLinearDamping, setLinearVelocity, setMass, setOrientation, setPose, setPosition, setVelocity

From raisim::Object: addContactToPerObjectContact, clearPerObjectContact, getBodyType, getContactAabb, getContactAabbCount, getContacts, getExternalForce, getExternalForcePosition, getExternalTorque, getExternalTorquePosition, getId, getIndexInWorld, getName, getRenderRevision, Id, lock, lockMutex, setIndexInWorld, setName, try_lock, unlock, unlockMutex

RaiSim — physics for robotics and AI.