Class nebula::drivers::RobosenseDecoder
template <typename SensorT>
ClassList > nebula > drivers > RobosenseDecoder
#include <robosense_decoder.hpp>
Inherits the following classes: nebula::drivers::RobosenseScanDecoder
Public Functions
Type | Name |
---|---|
RobosenseDecoder (const std::shared_ptr< const RobosenseSensorConfiguration > & sensor_configuration, const std::shared_ptr< const RobosenseCalibrationConfiguration > & calibration_configuration) Constructor. |
|
virtual std::tuple< drivers::NebulaPointCloudPtr, double > | get_pointcloud () override Returns the point cloud and timestamp of the last scan. |
virtual bool | has_scanned () override Indicates whether one full scan is ready. |
virtual int | unpack (const std::vector< uint8_t > & msop_packet) override Parses RobosensePacket and add its points to the point cloud. |
Public Functions inherited from nebula::drivers::RobosenseScanDecoder
See nebula::drivers::RobosenseScanDecoder
Type | Name |
---|---|
RobosenseScanDecoder (RobosenseScanDecoder && c) = delete |
|
RobosenseScanDecoder (const RobosenseScanDecoder & c) = delete |
|
RobosenseScanDecoder () = default |
|
virtual std::tuple< drivers::NebulaPointCloudPtr, double > | get_pointcloud () = 0 Returns the point cloud and timestamp of the last scan. |
virtual bool | has_scanned () = 0 Indicates whether one full scan is ready. |
RobosenseScanDecoder & | operator= (RobosenseScanDecoder && c) = delete |
RobosenseScanDecoder & | operator= (const RobosenseScanDecoder & c) = delete |
virtual int | unpack (const std::vector< uint8_t > & msop_packet) = 0 Parses RobosensePacket and add its points to the point cloud. |
virtual | ~RobosenseScanDecoder () = default |
Protected Attributes
Type | Name |
---|---|
SensorT::angle_corrector_t | angle_corrector_ Decodes azimuth/elevation angles given calibration/correction data. |
NebulaPointCloudPtr | decode_pc_ The point cloud new points get added to. |
uint64_t | decode_scan_timestamp_ns_ The timestamp of the scan currently in progress. |
bool | has_scanned_ Whether a full scan has been processed. |
int | last_phase_ The last azimuth processed. |
rclcpp::Logger | logger_ |
NebulaPointCloudPtr | output_pc_ The point cloud that is returned when a scan is complete. |
uint64_t | output_scan_timestamp_ns_ The timestamp of the last completed scan in nanoseconds. |
SensorT::packet_t | packet_ The last decoded packet. |
SensorT | sensor_ = {} The sensor definition, used for return mode and time offset handling. |
const std::shared_ptr< const drivers::RobosenseSensorConfiguration > | sensor_configuration_ Configuration for this decoder. |
Protected Functions
Type | Name |
---|---|
bool | check_scan_completed (int current_phase) Checks whether the last processed block was the last block of a scan. |
void | convert_returns (size_t start_block_id, size_t n_blocks) Converts a group of returns (i.e. 1 for single return, 2 for dual return, etc.) to points and appends them to the point cloud. |
float | get_distance (const typename SensorT::packet_t::body_t::block_t::unit_t & unit) Get the distance of the given unit in meters. |
uint32_t | get_point_time_relative (uint64_t packet_timestamp_ns, size_t block_id, size_t channel_id) Get timestamp of point in nanoseconds, relative to scan timestamp. Includes firing time offset correction for channel and block. |
bool | parse_packet (const std::vector< uint8_t > & msop_packet) Validates and parses MsopPacket. Currently only checks size, not checksums etc. |
Public Functions Documentation
function RobosenseDecoder
Constructor.
inline explicit nebula::drivers::RobosenseDecoder::RobosenseDecoder (
const std::shared_ptr< const RobosenseSensorConfiguration > & sensor_configuration,
const std::shared_ptr< const RobosenseCalibrationConfiguration > & calibration_configuration
)
Parameters:
sensor_configuration
SensorConfiguration for this decodercalibration_configuration
Calibration for this decoder calibration_configuration is set)
function get_pointcloud
Returns the point cloud and timestamp of the last scan.
inline virtual std::tuple< drivers::NebulaPointCloudPtr, double > nebula::drivers::RobosenseDecoder::get_pointcloud () override
Returns:
A tuple of point cloud and timestamp in nanoseconds
Implements nebula::drivers::RobosenseScanDecoder::get_pointcloud
function has_scanned
Indicates whether one full scan is ready.
inline virtual bool nebula::drivers::RobosenseDecoder::has_scanned () override
Returns:
Whether a scan is ready
Implements nebula::drivers::RobosenseScanDecoder::has_scanned
function unpack
Parses RobosensePacket and add its points to the point cloud.
inline virtual int nebula::drivers::RobosenseDecoder::unpack (
const std::vector< uint8_t > & msop_packet
) override
Parameters:
msop_packet
The incoming MsopPacket
Returns:
The last azimuth processed
Implements nebula::drivers::RobosenseScanDecoder::unpack
Protected Attributes Documentation
variable angle_corrector_
SensorT::angle_corrector_t nebula::drivers::RobosenseDecoder< SensorT >::angle_corrector_;
variable decode_pc_
NebulaPointCloudPtr nebula::drivers::RobosenseDecoder< SensorT >::decode_pc_;
variable decode_scan_timestamp_ns_
uint64_t nebula::drivers::RobosenseDecoder< SensorT >::decode_scan_timestamp_ns_;
variable has_scanned_
bool nebula::drivers::RobosenseDecoder< SensorT >::has_scanned_;
variable last_phase_
int nebula::drivers::RobosenseDecoder< SensorT >::last_phase_;
variable logger_
rclcpp::Logger nebula::drivers::RobosenseDecoder< SensorT >::logger_;
variable output_pc_
NebulaPointCloudPtr nebula::drivers::RobosenseDecoder< SensorT >::output_pc_;
variable output_scan_timestamp_ns_
uint64_t nebula::drivers::RobosenseDecoder< SensorT >::output_scan_timestamp_ns_;
variable packet_
SensorT::packet_t nebula::drivers::RobosenseDecoder< SensorT >::packet_;
variable sensor_
SensorT nebula::drivers::RobosenseDecoder< SensorT >::sensor_;
variable sensor_configuration_
const std::shared_ptr<const drivers::RobosenseSensorConfiguration> nebula::drivers::RobosenseDecoder< SensorT >::sensor_configuration_;
Protected Functions Documentation
function check_scan_completed
Checks whether the last processed block was the last block of a scan.
inline bool nebula::drivers::RobosenseDecoder::check_scan_completed (
int current_phase
)
Parameters:
current_phase
The azimuth of the last processed block
Returns:
Whether the scan has completed
function convert_returns
Converts a group of returns (i.e. 1 for single return, 2 for dual return, etc.) to points and appends them to the point cloud.
inline void nebula::drivers::RobosenseDecoder::convert_returns (
size_t start_block_id,
size_t n_blocks
)
Parameters:
start_block_id
The first block in the group of returnsn_blocks
The number of returns in the group
function get_distance
Get the distance of the given unit in meters.
inline float nebula::drivers::RobosenseDecoder::get_distance (
const typename SensorT::packet_t::body_t::block_t::unit_t & unit
)
Parameters:
unit
The unit to get the distance from
Returns:
The distance in meters
function get_point_time_relative
Get timestamp of point in nanoseconds, relative to scan timestamp. Includes firing time offset correction for channel and block.
inline uint32_t nebula::drivers::RobosenseDecoder::get_point_time_relative (
uint64_t packet_timestamp_ns,
size_t block_id,
size_t channel_id
)
Parameters:
packet_timestamp_ns
The timestamp of the current MsopPacket in nanosecondsblock_id
The block index of the pointchannel_id
The channel index of the point
function parse_packet
Validates and parses MsopPacket. Currently only checks size, not checksums etc.
inline bool nebula::drivers::RobosenseDecoder::parse_packet (
const std::vector< uint8_t > & msop_packet
)
Parameters:
msop_packet
The incoming MsopPacket
Returns:
Whether the packet was parsed successfully
The documentation for this class was generated from the following file nebula_decoders/include/nebula_decoders/nebula_decoders_robosense/decoders/robosense_decoder.hpp