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
server::BoundedWriter serialize(server::BoundedWriter data) constInternal: write this cloud to a server frame (wire format). Fatal if position and color differ in size.
Parameters
| Parameter | Description |
|---|---|
data (in) | output position; throws server::SerializationError if the cloud does not fit |
Returns the next write position
lockMutex
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
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).
resize
void resize(size_t size)Resize both position and color. New points start at the origin with opaque red color.
Parameters
| Parameter | Description |
|---|---|
size (in) | number of points |
Public attributes
name
std::string namePoint cloud name for lookup in the server.
pointSize
float pointSizePoint size in meters (the rayrai viewer maps it to a clamped pixel size).
position
std::vector<Vec<3>> positionPoint positions in world coordinates.
color
std::vector<Vec<4>> colorPoint colors (RGBA).
visualTag
uint32_t visualTagVisualizer tag assigned by the server.
mutex_
std::mutex mutex_Mutex guarding point cloud updates.