Skip to content

raisim::PointCloud ​

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

Point cloud streamed by RaisimServer. Create with RaisimServer::addPointCloud(); the server owns it. position and color must have the same size when the frame is serialized.

Public member functions ​

serialize ​

cpp
server::BoundedWriter serialize(server::BoundedWriter data) const

Internal: write this cloud to a server frame (wire format). Fatal if position and color differ in size.

Parameters

ParameterDescription
data (in)output position; throws server::SerializationError if the cloud does not fit

Returns the next write position

lockMutex ​

cpp
void lockMutex()

Lock this point cloud's mutex. Note: the server does NOT take this mutex when serializing point clouds; use RaisimServer::lockVisualizationServerMutex() to synchronize with the server. 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).

resize ​

cpp
void resize(size_t size)

Resize both position and color. New points start at the origin with opaque red color.

Parameters

ParameterDescription
size (in)number of points

Public attributes ​

name ​

cpp
std::string name

Point cloud name for lookup in the server.

pointSize ​

cpp
float pointSize

Point size in meters (the rayrai viewer maps it to a clamped pixel size).

position ​

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

Point positions in world coordinates.

color ​

cpp
std::vector<Vec<4>> color

Point colors (RGBA).

visualTag ​

cpp
uint32_t visualTag

Visualizer tag assigned by the server.

mutex_ ​

cpp
std::mutex mutex_

Mutex guarding point cloud updates.

RaiSim — physics for robotics and AI.