Class Cloud
Defined in File point_viz.h
Class Documentation
-
class Cloud
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 column-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 column-major homogeneous transformation matrix
-
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:
-
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_alpha(const float *key_alpha)
Set the key alpha values, leaving the color the same.
- Parameters:
key_alpha[in] – pointer to array of at least as many elements as there are points, normalized between 0 and 1
-
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_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_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_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 + n, i + 2n
-
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 + n, i + 2n
-
void set_pose(const mat4d &pose)
Set the ith point cloud pose.
- Parameters:
pose[in] – 4x4 column-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 scan 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 scan 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
-
explicit Cloud(size_t n, const mat4d &extrinsic = IDENTITY4D)