Class Cloud

Inheritance Relationships

Base Type

Class Documentation

class Cloud : public ouster::sdk::viz::Selectable

Manages the state of a point cloud.

Each point cloud consists of n points with w poses. The ith point will be transformed by the (i % w)th pose. For example for 2048 x 64 Ouster lidar point cloud, we may have w = 2048 poses and n = 2048 * 64 = 131072 points.

We also keep track of a per-cloud pose to efficiently transform the whole point cloud without having to update all ~2048 poses.

Public Functions

explicit Cloud(size_t n, const mat4d &extrinsic = IDENTITY4D)

Unstructured point cloud for visualization.

Call set_xyz() to update

Parameters:
  • n[in] number of points

  • extrinsic[in] sensor extrinsic calibration. 4x4 row-major homogeneous transformation matrix

Cloud(size_t w, size_t h, const float *dir, const float *off, const mat4d &extrinsic = IDENTITY4D)

Structured point cloud for visualization.

Call set_range() to update

Parameters:
  • w[in] number of columns

  • h[in] number of pixels per column

  • dir[in] unit vectors for projection

  • off[in] offsets for xyz projection

  • extrinsic[in] sensor extrinsic calibration. 4x4 row-major homogeneous transformation matrix

Cloud(const ouster::sdk::core::SensorInfo &sensor_info)

Structured point cloud for visualization.

Call set_range() to update

Parameters:

sensor_info[in] information of sensor the range data came from

Cloud(const ouster::sdk::core::XYZLut &xyz_lut)

Structured point cloud for visualization.

Call set_range() to update

Parameters:

xyz_lut[in] XYZLut to transform from range data to 3D

Cloud(const std::shared_ptr<ouster::sdk::core::XYZLut> &xyz_lut)

Structured point cloud for visualization.

Call set_range() to update

Parameters:

xyz_lut[in] XYZLut to transform from range data to 3D

void update_from(const Cloud &other)

Updates this cloud’s state with the state of other, accounting for prior changes to this objects’s state.

Parameters:

other[in] the object to update the state from.

void clear()

Clear dirty flags.

Resets any changes since the last call to PointViz::update()

void dirty()

Set all dirty flags.

Re-sets everything so the object is always redrawn.

inline size_t get_size() const

Get the size of the point cloud.

Returns:

Size of the point cloud.

inline size_t get_cols() const

Get the columns of the point cloud.

Returns:

number of columns in point cloud. (1 - for unstructured)

void set_range(const uint32_t *range)

Set the range values.

Parameters:

range[in] pointer to array of at least as many elements as there are points, representing the range of the points

void set_key(const float *key)

Set the key values, used for coloring.

Parameters:

key[in] pointer to array of at least as many elements as there are points, preferably normalized between 0 and 1

void set_key(const uint8_t *key)

Set the key values, used for coloring.

Parameters:

key[in] pointer to array of at least as many elements as there are points, between 0 and 255

void set_key_rgb(const float *key_rgb)

Set the key values in RGB format, used for coloring.

Parameters:

key_rgb[in] pointer to array of at least 3x as many elements as there are points, normalized between 0 and 1

void set_key_rgb(const uint8_t *key_rgb)

Set the key values in RGB format, used for coloring.

Parameters:

key_rgb[in] pointer to array of at least 3x as many elements as there are points, between 0 and 255

void set_key_rgba(const float *key_rgba)

Set the key values in RGBA format, used for coloring.

Parameters:

key_rgba[in] pointer to array of at least 4x as many elements as there are points, normalized between 0 and 1

void set_key_rgba(const uint8_t *key_rgba)

Set the key values in RGBA format, used for coloring.

Parameters:

key_rgba[in] pointer to array of at least 4x as many elements as there are points, between 0 and 255

void set_mask(const float *mask)

Set the RGBA mask values, used as an overlay on top of the key.

Parameters:

mask[in] pointer to array of at least 4x as many elements as there are points, preferably normalized between 0 and 1

void set_mask(const uint8_t *mask)

Set the RGBA mask values, used as an overlay on top of the key.

Parameters:

mask[in] pointer to array of at least 4x as many elements as there are points, between 0 and 255

void set_xyz(const float *xyz)

Set the XYZ values.

Parameters:

xyz[in] pointer to array of exactly 3n where n is number of points, so that the xyz position of the ith point is i, i + 3, i + 6

void set_offset(const float *offset)

Set the offset values.

TODO: no real reason to have this. Set in constructor, if at all

Parameters:

offset[in] pointer to array of exactly 3n where n is number of points, so that the xyz position of the ith point is i, i + 3, i + 6

void set_pose(const mat4d &pose)

Set the ith point cloud pose.

Parameters:

pose[in] 4x4 row-major homogeneous transformation matrix

void set_point_size(float size)

Set point size.

Parameters:

size[in] point size

void set_column_poses(const float *rotation, const float *translation)

Set the per-column poses, so that the point corresponding to the pixel at row u, column v in the staggered lidar frame is transformed by the vth pose, given as a homogeneous transformation matrix.

Parameters:
  • rotation[in] array of rotation matrices, total size 9 * w, where the vth rotation matrix is: r[v], r[w + v], r[2 * w + v], r[3 * w + v], r[4 * w + v], r[5 * w + v], r[6 * w + v], r[7 * w + v], r[8 * w + v]

  • translation[in] translation vector array, column major, where each row is a translation vector. That is, the vth translation is t[v], t[w + v], t[2 * w + v]

void set_column_poses(const float *column_poses)

Set the per-column poses, so that the point corresponding to the pixel at row u, column v in the staggered lidar frame is transformed by the vth pose, given as a homogeneous transformation matrix.

Parameters:

column_poses[in] array of 4x4 pose elements and length w (i.e. [wx4x4]) column-storage

void set_palette(const float *palette, size_t palette_size)

Set the point cloud color palette.

Parameters:
  • palette[in] the new palette to use, must have size 3*palette_size

  • palette_size[in] the number of colors in the new palette

Friends

friend class impl::GLCloud
friend class PointViz