Class SampleDecoder
Defined in File sample_decoder.hpp
Class Documentation
-
class SampleDecoder
Decoder that accumulates incoming raw packets and marks scan boundaries.
The tutorial implementation emits empty pointclouds so the ROS pipeline can be exercised without inventing fake sensor geometry.
Public Types
-
using pointcloud_callback_t = std::function<void(const NebulaPointCloudPtr &pointcloud, double timestamp_s)>
Callback type for publishing complete point clouds.
- Param pointcloud:
The decoded point cloud
- Param timestamp_s:
Timestamp of the scan in seconds
Public Functions
-
explicit SampleDecoder(FieldOfView<float, Degrees> fov, pointcloud_callback_t pointcloud_cb)
Constructor.
- Parameters:
fov – Field of view to crop the point cloud to
pointcloud_cb – Callback invoked when a full scan is assembled
-
PacketDecodeResult unpack(const std::vector<uint8_t> &packet)
Decode a single UDP packet.
- Parameters:
packet – Raw packet bytes from the sensor
- Returns:
PacketDecodeResult with metadata on success, or DecodeError on failure.
- Post:
performance_counters.decode_time_ns is always set.
-
void set_pointcloud_callback(pointcloud_callback_t pointcloud_cb)
Replace the callback used for completed scans.
-
using pointcloud_callback_t = std::function<void(const NebulaPointCloudPtr &pointcloud, double timestamp_s)>