Skip to content

raisim::PolyLine ​

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

Visual-only polyline streamed by RaisimServer. Consecutive points are connected by straight segments of thickness width. Create with RaisimServer::addVisualPolyLine(); the server owns it.

Public member functions ​

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 polyline.

addPoint ​

cpp
void addPoint(const Eigen::Vector3d &point)

Parameters

ParameterDescription
point (in)new polyline point. append a new point to the polyline.

clearPoints ​

cpp
void clearPoints()

clear all polyline points.

lockMutex ​

cpp
void lockMutex()

Lock this polyline's mutex. The server holds it while serializing this polyline, so lock it while modifying the polyline 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 ​

name ​

cpp
std::string name

Polyline name for lookup in the server.

color ​

cpp
Vec<4> color

RGBA color (0-1 range).

points ​

cpp
std::vector<Vec<3>> points

Ordered polyline points in world coordinates.

width ​

cpp
double width

Polyline width in meters.

RaiSim — physics for robotics and AI.