Class nebula::drivers::SampleDecoder
ClassList > nebula > drivers > SampleDecoder
Decoder that accumulates incoming raw packets and marks scan boundaries. More...
#include <sample_decoder.hpp>
Public Types
| Type | Name |
|---|---|
| typedef std::function< void(const NebulaPointCloudPtr &pointcloud, double timestamp_s)> | pointcloud_callback_t Callback type for publishing complete point clouds. |
Public Functions
| Type | Name |
|---|---|
| SampleDecoder (FieldOfView< float, Degrees > fov, pointcloud_callback_t pointcloud_cb) Constructor. |
|
| void | set_pointcloud_callback (pointcloud_callback_t pointcloud_cb) Replace the callback used for completed scans. |
| PacketDecodeResult | unpack (const std::vector< uint8_t > & packet) Decode a single UDP packet. |
Detailed Description
The tutorial implementation emits empty pointclouds so the ROS pipeline can be exercised without inventing fake sensor geometry.
Public Types Documentation
typedef pointcloud_callback_t
Callback type for publishing complete point clouds.
using nebula::drivers::SampleDecoder::pointcloud_callback_t = std::function<void(const NebulaPointCloudPtr & pointcloud, double timestamp_s)>;
Parameters:
pointcloudThe decoded point cloudtimestamp_sTimestamp of the scan in seconds
Public Functions Documentation
function SampleDecoder
Constructor.
explicit nebula::drivers::SampleDecoder::SampleDecoder (
FieldOfView< float, Degrees > fov,
pointcloud_callback_t pointcloud_cb
)
Parameters:
fovField of view to crop the point cloud topointcloud_cbCallback invoked when a full scan is assembled
function set_pointcloud_callback
Replace the callback used for completed scans.
void nebula::drivers::SampleDecoder::set_pointcloud_callback (
pointcloud_callback_t pointcloud_cb
)
function unpack
Decode a single UDP packet.
PacketDecodeResult nebula::drivers::SampleDecoder::unpack (
const std::vector< uint8_t > & packet
)
Parameters:
packetRaw packet bytes from the sensor
Returns:
PacketDecodeResult with metadata on success, or DecodeError on failure.
Postcondition:
performance_counters.decode_time_ns is always set.
The documentation for this class was generated from the following file src/nebula_sample/nebula_sample_decoders/include/nebula_sample_decoders/sample_decoder.hpp