Skip to content

raisim::Visuals ​

struct · #include <raisim/server/Visuals.hpp>

Derived by: raisim::VisualMesh

Visual-only primitive (sphere, box, cylinder, capsule, arrow or mesh) streamed by RaisimServer. Create with RaisimServer::addVisualSphere() and friends; the server owns it.

Public member functions ​

setSphereSize ​

cpp
void setSphereSize(double radius)

Parameters

ParameterDescription
radius (in)the raidus of the sphere. set size of the sphere.

setBoxSize ​

cpp
void setBoxSize(double x, double y, double z)

Parameters

ParameterDescription
x (in)length.
y (in)width.
z (in)height. set size of the box.

setCylinderSize ​

cpp
void setCylinderSize(double radius, double height)

Parameters

ParameterDescription
radius (in)the raidus of the cylinder.
height (in)the height of the cylinder. set size of the cylinder.

setCapsuleSize ​

cpp
void setCapsuleSize(double radius, double height)

Parameters

ParameterDescription
radius (in)the raidus of the capsule.
height (in)the height of the capsule. set size of the capsule.

setPosition ​

cpp
void setPosition(double x, double y, double z)

Parameters

ParameterDescription
x (in)x coordinate of the visual object.
y (in)y coordinate of the visual object.
z (in)z coordinate of the visual object. set the position of the visual object.
cpp
void setPosition(const Eigen::Vector3d &pos)

Parameters

ParameterDescription
pos (in)position of the visual object in Eigen::Vector3d. set the position of the visual object.

setOrientation ​

cpp
void setOrientation(double w, double x, double y, double z)

Parameters

ParameterDescription
w (in)scalar part of the unit quaternion.
x (in)x component of the quaternion vector part.
y (in)y component of the quaternion vector part.
z (in)z component of the quaternion vector part. set the orientation of the visual object.
cpp
void setOrientation(const Eigen::Vector4d &ori)

Parameters

ParameterDescription
ori (in)unit quaternion (w, x, y, z) of the visual object. set the orientation of the visual object.

setColor ​

cpp
void setColor(double r, double g, double b, double a)

Parameters

ParameterDescription
r (in)red value of the color (max=1).
g (in)green value of the color (max=1).
b (in)blue value of the color (max=1).
a (in)alpha value of the color (max=1). set the color of the visual object.

getPosition ​

cpp
Eigen::Vector3d getPosition()

Returns the position of the visual object. get the position of the visual object.

getOrientation ​

cpp
Eigen::Vector4d getOrientation()

Returns the orientation of the visual object as a quaternion (w, x, y, z).

lockMutex ​

cpp
void lockMutex()

Lock this visual's mutex. The server holds it while serializing this visual, so lock it while modifying the visual from another thread. Same as lock().

lock ​

cpp
void lock()

Lock the mutex (BasicLockable interface for std::lock_guard / std::unique_lock).

try_lock ​

cpp
bool try_lock()

Returns true if the mutex was acquired without blocking (Lockable interface).

unlockMutex ​

cpp
void unlockMutex()

Unlock the mutex locked by lockMutex(). Same as unlock().

unlock ​

cpp
void unlock()

Unlock the mutex (BasicLockable interface).

Public attributes ​

type ​

cpp
Shape::Type type

Visual geometry type.

name ​

cpp
std::string name

Visual name for lookup in the server.

material ​

cpp
std::string material

Material name. Currently not transmitted to the visualizer.

glow ​

cpp
bool glow

Enable emissive glow. Currently not transmitted to the visualizer.

shadow ​

cpp
bool shadow

Enable shadow casting. Currently not transmitted to the visualizer.

color ​

cpp
Vec<4> color

RGBA color (0-1 range).

size ​

cpp
Vec<4> size

Size parameters for the selected shape type: sphere {radius}, box {x, y, z lengths}, cylinder/capsule {radius, length}, arrow {radius, length}, mesh {x, y, z scale}.

RaiSim — physics for robotics and AI.