Skip to content

raisim::VisObject ​

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

visualization definition created by a user or URDF

Constructors & destructor ​

VisObject ​

cpp
VisObject(
    Shape::Type vis_shape,
    const raisim::Vec<4> &vis_shapeParam,
    const raisim::Vec<3> &vis_origin,
    const raisim::Mat<3, 3> &vis_rotMat,
    const raisim::Vec<4> &vis_color,
    const std::string &vis_name,
    const std::string &vis_material)

to add primitive (fatal for Shape::Mesh)

Parameters

ParameterDescription
vis_shape (in)choices, Box, Cylinder, Sphere, Capsule
vis_shapeParam (in)params associated with shape, for sphere: {radius}, for Box: {lx, ly, lz}, for Cylinder: {radius, height}, for Capsule: {radius, height},
vis_origin (in)position of the visualized object in the body frame
vis_rotMat (in)orientation of the visualized object relative to the body frame
vis_color (in)color (RGBA), should be ignored if material is specified,
vis_name (in)name of the visualized body,
vis_material (in)material
cpp
VisObject(
    const std::string &vis_meshFile,
    const std::string &vis_name,
    const raisim::Vec<3> &vis_origin,
    const raisim::Mat<3, 3> &vis_rotMat,
    const raisim::Vec<4> &vis_color,
    const raisim::Vec<3> &vis_scale,
    const std::string &vis_material)

to add mesh

Parameters

ParameterDescription
vis_meshFile (in)file location relative to the resource directory of the articulated system,
vis_name (in)name of the visualized body,
vis_origin (in)position of the visualized object in the body frame
vis_rotMat (in)orientation of the visualized object relative to the body frame
vis_color (in)color (RGBA), should be ignored if material is specified,
vis_scale (in)for mesh only, scaling size,
vis_material (in)material
cpp
VisObject(
    Shape::Type vis_shape,
    const raisim::Vec<4> &vis_shapeParam,
    const raisim::Vec<3> &vis_origin,
    const raisim::Mat<3, 3> &vis_rotMat,
    const raisim::Vec<4> &vis_color,
    const raisim::Vec<3> &vis_scale,
    const std::string &vis_meshFile,
    const std::string &vis_name,
    const std::string &vis_material)

primitive or mesh (fatal for Shape::Mesh with an empty vis_meshFile)

Parameters

ParameterDescription
vis_shape (in)choices, Box, Cylinder, Sphere, mesh, Capsule
vis_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},
vis_origin (in)position of the visualized object in the body frame
vis_rotMat (in)orientation of the visualized object relative to the body frame
vis_color (in)color (RGBA), should be ignored if material is specified,
vis_scale (in)for mesh only, scaling size,
vis_meshFile (in)file location relative to the resource directory of the articulated system,
vis_name (in)name of the visualized body,
vis_material (in)material

Public attributes ​

shape ​

cpp
Shape::Type shape

Shape type for the visual geometry.

visShapeParam ​

cpp
raisim::Vec<4> visShapeParam

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.

color ​

cpp
raisim::Vec<4> color

RGBA color override.

scale ​

cpp
raisim::Vec<3> scale

Per-axis scale (used for mesh shapes).

fileName ​

cpp
std::string fileName

Mesh file name for mesh visuals.

name ​

cpp
std::string name

Visual name.

localIdx ​

cpp
size_t localIdx

Body index within the articulated system (set when the system is built).

material ​

cpp
std::string material

Visual material name.

RaiSim — physics for robotics and AI.