Function OS1::make_xyz_lut
Defined in File OS1_util.hpp
Function Documentation
-
inline std::vector<double> OS1::make_xyz_lut(int W, int H, const std::vector<double> &azimuth_angles, const std::vector<double> &altitude_angles)
Generate a matrix of unit vectors pointing radially outwards, useful for efficiently computing cartesian coordinates from ranges. The result is a n x 3 array of doubles stored in row-major order where each row is the unit vector corresponding to the nth point in a lidar scan, with 0 <= n < H*W. The index into the lidar scan of a point can be obtained by H * j + i (where i is the index to nth_px, and j is the measurement_id of the column, when reading from a packet).
- Parameters:
W – number of columns in the lidar scan. One of 512, 1024, or 2048.
H – number of rows in the lidar scan. 64 for the OS1 family of sensors.
beam_azimuth_angles – azimuth offsets in degrees for each of H beams
beam_altitude_angles – altitude in degrees for each of H beams
- Returns:
xyz direction unit vectors for each point in the lidar scan