raisim::Body
class · #include <raisim/object/ArticulatedSystem/JointAndBodies.hpp>
Inertial, collision and visual properties of a link, used to build an articulated system (see Child).
Constructors & destructor
Body
Body()Body(double mass, const Mat<3, 3> &inertia, const Vec<3> &comPos)Parameters
| Parameter | Description |
|---|---|
mass (in) | mass [kg] |
inertia (in) | inertia about the COM in the body frame [kg m^2] |
comPos (in) | COM position in the body frame [m] |
Public member functions
setMass
void setMass(double mass)Parameters
| Parameter | Description |
|---|---|
mass (in) | mass [kg] |
getMass
double &getMass()Returns reference to the mass [kg]
const double &getMass() constReturns mass [kg]
setInertia
void setInertia(std::initializer_list<double> inertia)Parameters
| Parameter | Description |
|---|---|
inertia (in) | symmetric inertia about the COM as {ixx, ixy, ixz, iyy, iyz, izz} [kg m^2] |
void setInertia(const Vec<3> &inertia)Parameters
| Parameter | Description |
|---|---|
inertia (in) | diagonal inertia about the COM {ixx, iyy, izz} [kg m^2] |
void setInertia(const Vec<6> &inertia)Parameters
| Parameter | Description |
|---|---|
inertia (in) | symmetric inertia about the COM as {ixx, ixy, ixz, iyy, iyz, izz} [kg m^2] |
setInertiaMjcfOrder
void setInertiaMjcfOrder(const Vec<6> &inertia)Parameters
| Parameter | Description |
|---|---|
inertia (in) | symmetric inertia about the COM in MJCF order {ixx, iyy, izz, ixy, ixz, iyz} [kg m^2] |
setZeroInertial
void setZeroInertial()Set the mass, inertia and COM to zero.
getInertia
Mat<3, 3> &getInertia()Returns reference to the inertia about the COM in the body frame [kg m^2]
const Mat<3, 3> &getInertia() constReturns inertia about the COM in the body frame [kg m^2]
setCom
void setCom(const Vec<3> &com)Parameters
| Parameter | Description |
|---|---|
com (in) | COM position in the body frame [m] |
getCom
Vec<3> &getCom()Returns reference to the COM position in the body frame [m]
const Vec<3> &getCom() constReturns COM position in the body frame [m]
clearColAndVis
void clearColAndVis()Remove all collision and visual objects.
addCollisionObject
void addCollisionObject(
Shape::Type shape,
const Vec<4> ¶m,
const raisim::Vec<3> &origin,
const raisim::Mat<3, 3> &rot,
const raisim::Vec<3> &scale,
const std::string &colName,
const std::string &materialName,
const std::string &collisionVisualizedMaterial,
const std::string &meshFileName,
CollisionGroup group=CollisionGroup(-1),
CollisionGroup mask=CollisionGroup(-1))Add a collision object to this body.
addVisualObject
void addVisualObject(
Shape::Type shape,
const Vec<4> &shapeParam,
const raisim::Vec<3> &origin,
const raisim::Mat<3, 3> &rotMat,
const raisim::Vec<4> &color,
const raisim::Vec<3> &scale,
const std::string &meshFileNames,
const std::string &visName,
const std::string &material)Add a visual object to this body.
Parameters
| Parameter | Description |
|---|---|
shape (in) | geometry type |
shapeParam (in) | shape parameters (see VisObject) |
origin (in) | position in the body frame [m] |
rotMat (in) | orientation relative to the body frame |
color (in) | RGBA color |
scale (in) | mesh scale |
meshFileNames (in) | mesh file path (for mesh shapes) |
visName (in) | visual object name |
material (in) | visual material name |
Public attributes
colObj
std::vector<CollisionBody> colObjCollision geometries associated with this body.
visObj
std::vector<VisObject> visObjVisual geometries associated with this body.
mass_
double mass_Body mass in kilograms.
inertia_
Mat<3, 3> inertia_Body inertia matrix about the COM in body frame.
com_
Vec<3> com_Center of mass in body frame.
sensorSet
std::vector<SensorSet *> sensorSetSensor sets attached to this body.