Skip to content

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 > getPointcloud () override
Returns the point cloud and timestamp of the last scan.
virtual bool hasScanned () 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 > getPointcloud () = 0
Returns the point cloud and timestamp of the last scan.
virtual bool hasScanned () = 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 checkScanCompleted (int current_phase)
Checks whether the last processed block was the last block of a scan.
void convertReturns (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 getDistance (const typename SensorT::packet_t::body_t::block_t::unit_t & unit)
Get the distance of the given unit in meters.
uint32_t getPointTimeRelative (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 parsePacket (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 decoder
  • calibration_configuration Calibration for this decoder calibration_configuration is set)

function getPointcloud

Returns the point cloud and timestamp of the last scan.

inline virtual std::tuple< drivers::NebulaPointCloudPtr, double > nebula::drivers::RobosenseDecoder::getPointcloud () override

Returns:

A tuple of point cloud and timestamp in nanoseconds

Implements nebula::drivers::RobosenseScanDecoder::getPointcloud


function hasScanned

Indicates whether one full scan is ready.

inline virtual bool nebula::drivers::RobosenseDecoder::hasScanned () override

Returns:

Whether a scan is ready

Implements nebula::drivers::RobosenseScanDecoder::hasScanned


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 checkScanCompleted

Checks whether the last processed block was the last block of a scan.

inline bool nebula::drivers::RobosenseDecoder::checkScanCompleted (
    int current_phase
) 

Parameters:

  • current_phase The azimuth of the last processed block

Returns:

Whether the scan has completed


function convertReturns

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::convertReturns (
    size_t start_block_id,
    size_t n_blocks
) 

Parameters:

  • start_block_id The first block in the group of returns
  • n_blocks The number of returns in the group

function getDistance

Get the distance of the given unit in meters.

inline float nebula::drivers::RobosenseDecoder::getDistance (
    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 getPointTimeRelative

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::getPointTimeRelative (
    uint64_t packet_timestamp_ns,
    size_t block_id,
    size_t channel_id
) 

Parameters:

  • packet_timestamp_ns The timestamp of the current MsopPacket in nanoseconds
  • block_id The block index of the point
  • channel_id The channel index of the point

function parsePacket

Validates and parses MsopPacket. Currently only checks size, not checksums etc.

inline bool nebula::drivers::RobosenseDecoder::parsePacket (
    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