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
void setSphereSize(double radius)Parameters
| Parameter | Description |
|---|---|
radius (in) | the raidus of the sphere. set size of the sphere. |
setBoxSize
void setBoxSize(double x, double y, double z)Parameters
| Parameter | Description |
|---|---|
x (in) | length. |
y (in) | width. |
z (in) | height. set size of the box. |
setCylinderSize
void setCylinderSize(double radius, double height)Parameters
| Parameter | Description |
|---|---|
radius (in) | the raidus of the cylinder. |
height (in) | the height of the cylinder. set size of the cylinder. |
setCapsuleSize
void setCapsuleSize(double radius, double height)Parameters
| Parameter | Description |
|---|---|
radius (in) | the raidus of the capsule. |
height (in) | the height of the capsule. set size of the capsule. |
setPosition
void setPosition(double x, double y, double z)Parameters
| Parameter | Description |
|---|---|
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. |
void setPosition(const Eigen::Vector3d &pos)Parameters
| Parameter | Description |
|---|---|
pos (in) | position of the visual object in Eigen::Vector3d. set the position of the visual object. |
setOrientation
void setOrientation(double w, double x, double y, double z)Parameters
| Parameter | Description |
|---|---|
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. |
void setOrientation(const Eigen::Vector4d &ori)Parameters
| Parameter | Description |
|---|---|
ori (in) | unit quaternion (w, x, y, z) of the visual object. set the orientation of the visual object. |
setColor
void setColor(double r, double g, double b, double a)Parameters
| Parameter | Description |
|---|---|
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
Eigen::Vector3d getPosition()Returns the position of the visual object. get the position of the visual object.
getOrientation
Eigen::Vector4d getOrientation()Returns the orientation of the visual object as a quaternion (w, x, y, z).
lockMutex
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
void lock()Lock the mutex (BasicLockable interface for std::lock_guard / std::unique_lock).
try_lock
bool try_lock()Returns true if the mutex was acquired without blocking (Lockable interface).
unlockMutex
void unlockMutex()Unlock the mutex locked by lockMutex(). Same as unlock().
unlock
void unlock()Unlock the mutex (BasicLockable interface).
Public attributes
type
Shape::Type typeVisual geometry type.
name
std::string nameVisual name for lookup in the server.
material
std::string materialMaterial name. Currently not transmitted to the visualizer.
glow
bool glowEnable emissive glow. Currently not transmitted to the visualizer.
shadow
bool shadowEnable shadow casting. Currently not transmitted to the visualizer.
color
Vec<4> colorRGBA color (0-1 range).
size
Vec<4> sizeSize 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}.