Skip to content

raisim::CollisionBody ​

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

Collision geometry description of a Body, used when building an articulated system (see Body::addCollisionObject()).

Constructors & destructor ​

CollisionBody ​

cpp
CollisionBody(
    Shape::Type col_shape,
    const Vec<4> &col_shapeParam,
    const raisim::Vec<3> &col_origin,
    const raisim::Mat<3, 3> &col_rotMat,
    const std::string &col_name,
    const std::string &col_material,
    const std::string &col_visualizedMaterial)

to add a primitive (fatal for Shape::Mesh)

Parameters

ParameterDescription
col_shape (in)choices, Box, Cylinder, Sphere, Capsule
col_shapeParam (in)params associated with shape, for sphere: {radius}, for Box: {lx, ly, lz}, for Cylinder: {radius, height}, for Capsule: {radius, height},
col_origin (in)position of the collision object in the body frame
col_rotMat (in)orientation of the collision object relative to the body frame
col_name (in)name of the collision body,
col_material (in)collision material that defines contact physics
col_visualizedMaterial (in)how the collision body should be visualized
cpp
CollisionBody(
    const std::string &col_meshFileName,
    const raisim::Vec<3> &col_origin,
    const raisim::Mat<3, 3> &col_rotMat,
    const raisim::Vec<3> &col_meshScale,
    const std::string &col_name,
    const std::string &col_material,
    const std::string &col_visualizedMaterial)

to add mesh

Parameters

ParameterDescription
col_meshFileName (in)file location relative to the resource directory of the articulated system,
col_origin (in)position of the collision object in the body frame
col_rotMat (in)orientation of the collision object relative to the body frame
col_meshScale (in)scaling size,
col_name (in)name of the collision body,
col_material (in)collision material that defines contact physics
col_visualizedMaterial (in)how the collision body should be visualized
cpp
CollisionBody(
    Shape::Type col_shape,
    const Vec<4> &col_shapeParam,
    const raisim::Vec<3> &col_origin,
    const raisim::Mat<3, 3> &col_rotMat,
    const raisim::Vec<3> &col_meshScale,
    const std::string &col_name,
    const std::string &col_material,
    const std::string &col_visualizedMaterial,
    const std::string &col_meshFileName)

primitive or mesh

Parameters

ParameterDescription
col_shape (in)choices, Box, Cylinder, Sphere, mesh, Capsule
col_shapeParam (in)params associated with shape, for sphere: {radius}, for Box: {lx, ly, lz}, for Cylinder: {radius, height}, for mesh: None for Capsule: {radius, height},
col_origin (in)position of the collision object in the body frame
col_rotMat (in)orientation of the collision object relative to the body frame
col_meshScale (in)for mesh only, scaling size,
col_name (in)name of the collision body,
col_material (in)collision material that defines contact physics
col_visualizedMaterial (in)how the collision body should be visualized
col_meshFileName (in)file location relative to the resource directory of the articulated system

Public attributes ​

shape ​

cpp
Shape::Type shape

Shape type for the collision geometry.

scale ​

cpp
raisim::Vec<3> scale

Per-axis mesh scale.

shapeParam ​

cpp
raisim::Vec<4> shapeParam

Shape parameters (dimension depends on shape type).

offset ​

cpp
raisim::Vec<3> offset

Position offset from the body frame.

rot ​

cpp
raisim::Mat<3, 3> rot

Orientation offset from the body frame.

name ​

cpp
std::string name

Collision body name.

materialName ​

cpp
std::string materialName

Material name for contact properties.

collisionVisualizationMaterial ​

cpp
std::string collisionVisualizationMaterial

Material name used to visualize collision geometry.

colMeshFileName ​

cpp
std::string colMeshFileName

Mesh file name for mesh collisions.

group ​

cpp
CollisionGroup group

Collision group bits (default 1).

mask ​

cpp
CollisionGroup mask

Collision mask bits (default: all).

RaiSim — physics for robotics and AI.