Class LidarScan

Nested Relationships

Nested Types

Class Documentation

class LidarScan

Datastructure for efficient operations on aggregated lidar data.

Stores each field (range, intensity, etc.) contiguously as a H x W block of 4-byte unsigned integers, where H is the number of beams and W is the horizontal resolution (e.g. 512, 1024, 2048).

Note: this is the “staggered” representation where each column corresponds to a single measurement in time. Use the destagger() function to create an image where columns correspond to a single azimuth angle.

Public Types

enum Field

Data fields reported per channel

Values:

enumerator RANGE
enumerator INTENSITY
enumerator AMBIENT
enumerator REFLECTIVITY
using raw_t = uint32_t
using ts_t = std::chrono::nanoseconds
using data_t = Eigen::Array<raw_t, Eigen::Dynamic, N_FIELDS>
using DynStride = Eigen::Stride<Eigen::Dynamic, Eigen::Dynamic>
using Points = Eigen::Array<double, Eigen::Dynamic, 3>

XYZ coordinates with dimensions arranged contiguously in columns

Public Functions

LidarScan() = default

The default constructor creates an invalid 0 x 0 scan

inline LidarScan(size_t w, size_t h)

Initialize an empty scan with the given horizontal / vertical resolution.

Parameters:
  • w – horizontal resoulution, i.e. the number of measurements per scan

  • h – vertical resolution, i.e. the number of channels

inline std::vector<LidarScan::ts_t> timestamps() const

Access timestamps as a vector.

Returns:

copy of the measurement timestamps as a vector

inline BlockHeader &header(size_t m_id)

Access measurement block header fields.

Returns:

the header values for the specified measurement id

inline const BlockHeader &header(size_t m_id) const

Access measurement block header fields.

Returns:

the header values for the specified measurement id

inline Eigen::Map<data_t, Eigen::Unaligned, DynStride> block(size_t m_id)

Access measurement block data.

Parameters:

m_id – the measurement id of the desired block

Returns:

a view of the measurement block data

inline Eigen::Map<const data_t, Eigen::Unaligned, DynStride> block(size_t m_id) const

Access measurement block data.

Parameters:

m_id – the measurement id of the desired block

Returns:

a view of the measurement block data

inline Eigen::Map<img_t<raw_t>> field(Field f)

Access a lidar data field.

Parameters:

f – the field to view

Returns:

a view of the field data

inline Eigen::Map<const img_t<raw_t>> field(Field f) const

Access a lidar data field.

Parameters:

f – the field to view

Returns:

a view of the field data

Public Members

std::ptrdiff_t w = {0}
std::ptrdiff_t h = {0}
data_t data = {}
std::vector<BlockHeader> headers = {}
int32_t frame_id = {-1}

Public Static Attributes

static constexpr int N_FIELDS = 4
struct BlockHeader

Measurement block information, other than the channel data

Public Members

ts_t timestamp
uint32_t encoder
uint32_t status