Skip to content

Namespace nebula::drivers

Namespace List > nebula > drivers

Namespaces

Type Name
namespace hesai_packet

Classes

Type Name
struct AdvancedFunctionalSafetyConfiguration
class AngleCorrector <typename CorrectionDataT, ChannelN>
Handles angle correction for given azimuth/channel combinations, as well as trigonometry lookup tables.
class AngleCorrectorCalibrationBased <ChannelN, AngleUnit>
class AngleCorrectorCorrectionBased <ChannelN, AngleUnit>
struct CorrectedAngleData
Corrected angles (azimuth, elevation) and their sin/cos values, all spatial angles in radians.
class FunctionalSafetyDecoder <typename PacketT>
Interprets the functional safety part of Hesai pointcloud packets for supported sensor models.
class FunctionalSafetyDecoderBase
class FunctionalSafetyDecoderTypedBase <typename PacketT>
struct HesaiCalibrationConfiguration
struct for Hesai calibration configuration
struct HesaiCalibrationConfigurationBase
struct HesaiCorrection
struct for Hesai correction configuration (for AT)
class HesaiDecoder <typename SensorT>
class HesaiDriver
Hesai driver.
class HesaiHwInterface
Hardware interface of hesai driver.
class HesaiScanDecoder
Base class for Hesai LiDAR decoder.
class HesaiSensor <typename PacketT, AngleCorrection>
Base class for all sensor definitions.
struct HesaiSensorConfiguration
struct for Hesai sensor configuration
struct PacketDecodeResult
class PacketLossDetector <typename PacketT>
class PacketLossDetectorBase
class PacketLossDetectorTypedBase <typename PacketT>
struct PacketMetadata
Metadata for a decoded packet.
class Pandar128E4X
class Pandar40
class Pandar64
class PandarAT128
class PandarAT128P
The AT128P uses the same point cloud packet format as the AT128E2X, but has a wider range and additionally supports the First and Strongest+First return modes.
class PandarQT128
class PandarQT64
class PandarXT16
class PandarXT32
class PandarXT32M
struct PerformanceCounters
Performance information about decode timings.

Public Types

Type Name
enum AngleCorrectionType
enum uint8_t DecodeError
Errors that can occur during packet decoding.
typedef boost::container::static_vector< uint16_t, 16 > FunctionalSafetyErrorCodes
enum uint8_t FunctionalSafetySeverity

Public Attributes

Type Name
const int g_hesai_lidar_gps_clock_source = 0
const int g_hesai_lidar_ptp_clock_source = 1
const uint16_t g_mtu_size = 1500
const int g_pandar_tcp_command_port = 9347
const uint8_t g_ptc_command_dummy_byte = 0x00
const uint8_t g_ptc_command_get_config_info = 0x08
const uint8_t g_ptc_command_get_high_resolution_mode = 0x28
const uint8_t g_ptc_command_get_inventory_info = 0x07
const uint8_t g_ptc_command_get_lidar_calibration = 0x05
const uint8_t g_ptc_command_get_lidar_range = 0x23
const uint8_t g_ptc_command_get_lidar_status = 0x09
const uint8_t g_ptc_command_get_ptp_config = 0x26
const uint8_t g_ptc_command_get_up_close_blockage_detection = 0x59
const uint8_t g_ptc_command_header_high = 0x47
const uint8_t g_ptc_command_header_low = 0x74
const uint8_t g_ptc_command_lidar_monitor = 0x27
const uint8_t g_ptc_command_ptp_diagnostics = 0x06
const uint8_t g_ptc_command_ptp_grandmaster_settings_np = 0x04
const uint8_t g_ptc_command_ptp_port_data_set = 0x02
const uint8_t g_ptc_command_ptp_status = 0x01
const uint8_t g_ptc_command_ptp_time_status_np = 0x03
const uint8_t g_ptc_command_reset = 0x25
const uint8_t g_ptc_command_set_clock_source = 0x1f
const uint8_t g_ptc_command_set_control_port = 0x21
const uint8_t g_ptc_command_set_destination_ip = 0x20
const uint8_t g_ptc_command_set_high_resolution_mode = 0x29
const uint8_t g_ptc_command_set_lidar_range = 0x22
const uint8_t g_ptc_command_set_ptp_config = 0x24
const uint8_t g_ptc_command_set_return_mode = 0x1e
const uint8_t g_ptc_command_set_rotate_direction = 0x2a
const uint8_t g_ptc_command_set_spin_rate = 0x17
const uint8_t g_ptc_command_set_standby_mode = 0x1c
const uint8_t g_ptc_command_set_sync_angle = 0x18
const uint8_t g_ptc_command_set_trigger_method = 0x1b
const uint8_t g_ptc_command_set_up_close_blockage_detection = 0x58
const uint8_t g_ptc_error_code_fpga_comm_failed = 0x06
const uint8_t g_ptc_error_code_invalid_data = 0x03
const uint8_t g_ptc_error_code_invalid_input_param = 0x01
const uint8_t g_ptc_error_code_no_error = 0x00
const uint8_t g_ptc_error_code_other = 0x07
const uint8_t g_ptc_error_code_out_of_memory = 0x04
const uint8_t g_ptc_error_code_server_conn_failed = 0x02
const uint8_t g_ptc_error_code_unsupported_cmd = 0x05
const uint8_t g_ptp_command_get_ptp_lock_offset = 0x3a
const uint8_t g_ptp_command_set_ptp_lock_offset = 0x39
const int g_ptp_log_announce_interval = 1
const int g_ptp_log_min_delay_interval = 0
const int g_ptp_sync_interval = 1
const uint8_t g_tcp_error_incomplete_response = 8
const uint8_t g_tcp_error_timeout = 4
const uint8_t g_tcp_error_unexpected_payload = 2
const uint8_t g_tcp_error_unrelated_response = 1

Public Functions

Type Name
std::string calibration_parameter_name (const SensorModel & sensor_model)
The parameter that holds the path of the sensor model's calibration data.
double get_scan_rate_hz (const SensorModel & sensor_model, uint16_t rotation_speed_rpm)
Get the nominal scan rate of the sensor.
uint8_t get_scans_per_rotation (const SensorModel & sensor_model)
Get the number of scans the sensor outputs per motor rotation.
int int_from_return_mode_hesai (const ReturnMode return_mode, const SensorModel & sensor_model)
Convert ReturnMode enum to return mode number.
std::shared_ptr< HesaiCalibrationConfigurationBase > make_calibration (const SensorModel & sensor_model)
Empty calibration data of the type that the sensor model uses, to be loaded from a file or from bytes.
point_filters::DownsampleMaskFilter make_downsample_mask_filter (const std::string & path, const std::shared_ptr< loggers::Logger > & logger, bool export_dithered_mask)
The downsample mask filter, as the decoder of SensorT applies it.
point_filters::DownsampleMaskFilter make_downsample_mask_filter (SensorModel sensor_model, const std::string & path, const std::shared_ptr< loggers::Logger > & logger)
The downsample mask filter, as the decoder of sensor_model applies it. Unlike the decoder, it does not write the dithered mask.
std::ostream & operator<< (std::ostream & os, nebula::drivers::PtpProfile const & arg)
Convert PtpProfile enum to string (Overloading the << operator).
std::ostream & operator<< (std::ostream & os, nebula::drivers::PtpTransportType const & arg)
Convert PtpTransportType enum to string (Overloading the << operator).
std::ostream & operator<< (std::ostream & os, nebula::drivers::PtpSwitchType const & arg)
Convert PtpSwitchType enum to string (Overloading the << operator).
std::ostream & operator<< (std::ostream & os, HesaiSensorConfiguration const & arg)
Convert HesaiSensorConfiguration to string (Overloading the << operator).
std::ostream & operator<< (std::ostream & os, FunctionalSafetySeverity severity)
PtpProfile ptp_profile_from_string (const std::string & ptp_profile)
Converts String to PTP Profile.
PtpSwitchType ptp_switch_type_from_string (const std::string & switch_type)
Converts String to PTP SwitchType.
PtpTransportType ptp_transport_type_from_string (const std::string & transport_type)
Converts String to PTP TransportType.
ReturnMode return_mode_from_int_hesai (const int return_mode, const SensorModel & sensor_model)
Convert return mode number to ReturnMode enum.
ReturnMode return_mode_from_string_hesai (const std::string & return_mode, const SensorModel & sensor_model)
Convert return mode name to ReturnMode enum (Hesai-specific return_mode_from_string).
bool supports_blockage_mask (const SensorModel & sensor_model)
Whether the given sensor model supports blockage mask output.
bool supports_functional_safety (const SensorModel & sensor_model)
Whether the given sensor model supports functional safety.
bool supports_lidar_monitor (const SensorModel & sensor_model)
Whether the given sensor model supports lidar monitor requests.
bool supports_packet_loss_detection (const SensorModel & sensor_model)
Whether the given sensor model supports packet loss detection.
bool uses_correction_file (const SensorModel & sensor_model)
Whether the sensor model's angles are corrected with a correction file ( HesaiCorrection ) instead of a calibration file (HesaiCalibrationConfiguration ).
util::expected< std::monostate, std::string > validate_decoder_settings (const HesaiSensorConfiguration & config)
Check the settings of a sensor configuration that the decoder uses.

Public Types Documentation

enum AngleCorrectionType

enum nebula::drivers::AngleCorrectionType {
    CALIBRATION,
    CORRECTION
};

enum DecodeError

Errors that can occur during packet decoding.

enum nebula::drivers::DecodeError {
    PACKET_PARSE_FAILED,
    DRIVER_NOT_OK,
    INVALID_PACKET_SIZE,
    PACKET_IGNORED
};


typedef FunctionalSafetyErrorCodes

using nebula::drivers::FunctionalSafetyErrorCodes =  boost::container::static_vector<uint16_t, 16>;

enum FunctionalSafetySeverity

enum nebula::drivers::FunctionalSafetySeverity {
    OK,
    WARNING,
    ERROR
};

Public Attributes Documentation

variable g_hesai_lidar_gps_clock_source

const int nebula::drivers::g_hesai_lidar_gps_clock_source;

variable g_hesai_lidar_ptp_clock_source

const int nebula::drivers::g_hesai_lidar_ptp_clock_source;

variable g_mtu_size

const uint16_t nebula::drivers::g_mtu_size;

variable g_pandar_tcp_command_port

const int nebula::drivers::g_pandar_tcp_command_port;

variable g_ptc_command_dummy_byte

const uint8_t nebula::drivers::g_ptc_command_dummy_byte;

variable g_ptc_command_get_config_info

const uint8_t nebula::drivers::g_ptc_command_get_config_info;

variable g_ptc_command_get_high_resolution_mode

const uint8_t nebula::drivers::g_ptc_command_get_high_resolution_mode;

variable g_ptc_command_get_inventory_info

const uint8_t nebula::drivers::g_ptc_command_get_inventory_info;

variable g_ptc_command_get_lidar_calibration

const uint8_t nebula::drivers::g_ptc_command_get_lidar_calibration;

variable g_ptc_command_get_lidar_range

const uint8_t nebula::drivers::g_ptc_command_get_lidar_range;

variable g_ptc_command_get_lidar_status

const uint8_t nebula::drivers::g_ptc_command_get_lidar_status;

variable g_ptc_command_get_ptp_config

const uint8_t nebula::drivers::g_ptc_command_get_ptp_config;

variable g_ptc_command_get_up_close_blockage_detection

const uint8_t nebula::drivers::g_ptc_command_get_up_close_blockage_detection;

variable g_ptc_command_header_high

const uint8_t nebula::drivers::g_ptc_command_header_high;

variable g_ptc_command_header_low

const uint8_t nebula::drivers::g_ptc_command_header_low;

variable g_ptc_command_lidar_monitor

const uint8_t nebula::drivers::g_ptc_command_lidar_monitor;

variable g_ptc_command_ptp_diagnostics

const uint8_t nebula::drivers::g_ptc_command_ptp_diagnostics;

variable g_ptc_command_ptp_grandmaster_settings_np

const uint8_t nebula::drivers::g_ptc_command_ptp_grandmaster_settings_np;

variable g_ptc_command_ptp_port_data_set

const uint8_t nebula::drivers::g_ptc_command_ptp_port_data_set;

variable g_ptc_command_ptp_status

const uint8_t nebula::drivers::g_ptc_command_ptp_status;

variable g_ptc_command_ptp_time_status_np

const uint8_t nebula::drivers::g_ptc_command_ptp_time_status_np;

variable g_ptc_command_reset

const uint8_t nebula::drivers::g_ptc_command_reset;

variable g_ptc_command_set_clock_source

const uint8_t nebula::drivers::g_ptc_command_set_clock_source;

variable g_ptc_command_set_control_port

const uint8_t nebula::drivers::g_ptc_command_set_control_port;

variable g_ptc_command_set_destination_ip

const uint8_t nebula::drivers::g_ptc_command_set_destination_ip;

variable g_ptc_command_set_high_resolution_mode

const uint8_t nebula::drivers::g_ptc_command_set_high_resolution_mode;

variable g_ptc_command_set_lidar_range

const uint8_t nebula::drivers::g_ptc_command_set_lidar_range;

variable g_ptc_command_set_ptp_config

const uint8_t nebula::drivers::g_ptc_command_set_ptp_config;

variable g_ptc_command_set_return_mode

const uint8_t nebula::drivers::g_ptc_command_set_return_mode;

variable g_ptc_command_set_rotate_direction

const uint8_t nebula::drivers::g_ptc_command_set_rotate_direction;

variable g_ptc_command_set_spin_rate

const uint8_t nebula::drivers::g_ptc_command_set_spin_rate;

variable g_ptc_command_set_standby_mode

const uint8_t nebula::drivers::g_ptc_command_set_standby_mode;

variable g_ptc_command_set_sync_angle

const uint8_t nebula::drivers::g_ptc_command_set_sync_angle;

variable g_ptc_command_set_trigger_method

const uint8_t nebula::drivers::g_ptc_command_set_trigger_method;

variable g_ptc_command_set_up_close_blockage_detection

const uint8_t nebula::drivers::g_ptc_command_set_up_close_blockage_detection;

variable g_ptc_error_code_fpga_comm_failed

const uint8_t nebula::drivers::g_ptc_error_code_fpga_comm_failed;

variable g_ptc_error_code_invalid_data

const uint8_t nebula::drivers::g_ptc_error_code_invalid_data;

variable g_ptc_error_code_invalid_input_param

const uint8_t nebula::drivers::g_ptc_error_code_invalid_input_param;

variable g_ptc_error_code_no_error

const uint8_t nebula::drivers::g_ptc_error_code_no_error;

variable g_ptc_error_code_other

const uint8_t nebula::drivers::g_ptc_error_code_other;

variable g_ptc_error_code_out_of_memory

const uint8_t nebula::drivers::g_ptc_error_code_out_of_memory;

variable g_ptc_error_code_server_conn_failed

const uint8_t nebula::drivers::g_ptc_error_code_server_conn_failed;

variable g_ptc_error_code_unsupported_cmd

const uint8_t nebula::drivers::g_ptc_error_code_unsupported_cmd;

variable g_ptp_command_get_ptp_lock_offset

const uint8_t nebula::drivers::g_ptp_command_get_ptp_lock_offset;

variable g_ptp_command_set_ptp_lock_offset

const uint8_t nebula::drivers::g_ptp_command_set_ptp_lock_offset;

variable g_ptp_log_announce_interval

const int nebula::drivers::g_ptp_log_announce_interval;

variable g_ptp_log_min_delay_interval

const int nebula::drivers::g_ptp_log_min_delay_interval;

variable g_ptp_sync_interval

const int nebula::drivers::g_ptp_sync_interval;

variable g_tcp_error_incomplete_response

const uint8_t nebula::drivers::g_tcp_error_incomplete_response;

variable g_tcp_error_timeout

const uint8_t nebula::drivers::g_tcp_error_timeout;

variable g_tcp_error_unexpected_payload

const uint8_t nebula::drivers::g_tcp_error_unexpected_payload;

variable g_tcp_error_unrelated_response

const uint8_t nebula::drivers::g_tcp_error_unrelated_response;

Public Functions Documentation

function calibration_parameter_name

The parameter that holds the path of the sensor model's calibration data.

inline std::string nebula::drivers::calibration_parameter_name (
    const SensorModel & sensor_model
) 


function get_scan_rate_hz

Get the nominal scan rate of the sensor.

inline double nebula::drivers::get_scan_rate_hz (
    const SensorModel & sensor_model,
    uint16_t rotation_speed_rpm
) 

Parameters:

  • sensor_model Sensor model
  • rotation_speed_rpm The motor rotation speed in RPM

Returns:

The scan rate in Hz


function get_scans_per_rotation

Get the number of scans the sensor outputs per motor rotation.

inline uint8_t nebula::drivers::get_scans_per_rotation (
    const SensorModel & sensor_model
) 

Parameters:

  • sensor_model Sensor model

Returns:

The number of scans per rotation


function int_from_return_mode_hesai

Convert ReturnMode enum to return mode number.

inline int nebula::drivers::int_from_return_mode_hesai (
    const ReturnMode return_mode,
    const SensorModel & sensor_model
) 

Parameters:

  • return_mode target ReturnMode
  • sensor_model Model for correct conversion

Returns:

Corresponding return mode number for the hardware


function make_calibration

Empty calibration data of the type that the sensor model uses, to be loaded from a file or from bytes.

inline std::shared_ptr< HesaiCalibrationConfigurationBase > nebula::drivers::make_calibration (
    const SensorModel & sensor_model
) 


function make_downsample_mask_filter

The downsample mask filter, as the decoder of SensorT applies it.

template<typename SensorT>
point_filters::DownsampleMaskFilter nebula::drivers::make_downsample_mask_filter (
    const std::string & path,
    const std::shared_ptr< loggers::Logger > & logger,
    bool export_dithered_mask
) 

Parameters:

  • export_dithered_mask Whether to write the dithered mask next to the mask file

Exception:

  • std::runtime_error if the mask cannot be read or does not fit the sensor

function make_downsample_mask_filter

The downsample mask filter, as the decoder of sensor_model applies it. Unlike the decoder, it does not write the dithered mask.

point_filters::DownsampleMaskFilter nebula::drivers::make_downsample_mask_filter (
    SensorModel sensor_model,
    const std::string & path,
    const std::shared_ptr< loggers::Logger > & logger
) 

Exception:

  • std::invalid_argument if the sensor model is not supported
  • std::runtime_error if the mask cannot be read or does not fit the sensor

function operator<<

Convert PtpProfile enum to string (Overloading the << operator).

inline std::ostream & nebula::drivers::operator<< (
    std::ostream & os,
    nebula::drivers::PtpProfile const & arg
) 

Parameters:

  • os
  • arg

Returns:

stream


function operator<<

Convert PtpTransportType enum to string (Overloading the << operator).

inline std::ostream & nebula::drivers::operator<< (
    std::ostream & os,
    nebula::drivers::PtpTransportType const & arg
) 

Parameters:

  • os
  • arg

Returns:

stream


function operator<<

Convert PtpSwitchType enum to string (Overloading the << operator).

inline std::ostream & nebula::drivers::operator<< (
    std::ostream & os,
    nebula::drivers::PtpSwitchType const & arg
) 

Parameters:

  • os
  • arg

Returns:

stream


function operator<<

Convert HesaiSensorConfiguration to string (Overloading the << operator).

inline std::ostream & nebula::drivers::operator<< (
    std::ostream & os,
    HesaiSensorConfiguration const & arg
) 

Parameters:

  • os
  • arg

Returns:

stream


function operator<<

inline std::ostream & nebula::drivers::operator<< (
    std::ostream & os,
    FunctionalSafetySeverity severity
) 

function ptp_profile_from_string

Converts String to PTP Profile.

inline PtpProfile nebula::drivers::ptp_profile_from_string (
    const std::string & ptp_profile
) 

Parameters:

  • ptp_profile Profile as String

Returns:

Corresponding PtpProfile


function ptp_switch_type_from_string

Converts String to PTP SwitchType.

inline PtpSwitchType nebula::drivers::ptp_switch_type_from_string (
    const std::string & switch_type
) 

Parameters:

  • switch_type Switch as String

Returns:

Corresponding PtpSwitchType


function ptp_transport_type_from_string

Converts String to PTP TransportType.

inline PtpTransportType nebula::drivers::ptp_transport_type_from_string (
    const std::string & transport_type
) 

Parameters:

  • transport_type Transport as String

Returns:

Corresponding PtpTransportType


function return_mode_from_int_hesai

Convert return mode number to ReturnMode enum.

inline ReturnMode nebula::drivers::return_mode_from_int_hesai (
    const int return_mode,
    const SensorModel & sensor_model
) 

Parameters:

  • return_mode Return mode number from the hardware response
  • sensor_model Model for correct conversion

Returns:

Corresponding ReturnMode


function return_mode_from_string_hesai

Convert return mode name to ReturnMode enum (Hesai-specific return_mode_from_string).

inline ReturnMode nebula::drivers::return_mode_from_string_hesai (
    const std::string & return_mode,
    const SensorModel & sensor_model
) 

Parameters:

  • return_mode Return mode name (Upper and lower case letters must match)
  • sensor_model Model for correct conversion

Returns:

Corresponding ReturnMode


function supports_blockage_mask

Whether the given sensor model supports blockage mask output.

inline bool nebula::drivers::supports_blockage_mask (
    const SensorModel & sensor_model
) 

Blockage mask output is only supported for OT128.

The QT128 datasheet mentions support for blockage detection, but its output does not distinguish between sky (no return) and blockage (too-close return). Thus, the output is not usable in the same way as OT128's.

Parameters:

  • sensor_model Sensor model

Returns:

True if the sensor model supports blockage mask output, false otherwise


function supports_functional_safety

Whether the given sensor model supports functional safety.

inline bool nebula::drivers::supports_functional_safety (
    const SensorModel & sensor_model
) 

Parameters:

  • sensor_model Sensor model

Returns:

True if the sensor model supports functional safety, false otherwise


function supports_lidar_monitor

Whether the given sensor model supports lidar monitor requests.

inline bool nebula::drivers::supports_lidar_monitor (
    const SensorModel & sensor_model
) 

Parameters:

  • sensor_model Sensor model

Returns:

True if the sensor model supports lidar monitor, false otherwise


function supports_packet_loss_detection

Whether the given sensor model supports packet loss detection.

inline bool nebula::drivers::supports_packet_loss_detection (
    const SensorModel & sensor_model
) 

Parameters:

  • sensor_model Sensor model

Returns:

True if the sensor model supports packet loss detection, false otherwise


function uses_correction_file

Whether the sensor model's angles are corrected with a correction file ( HesaiCorrection ) instead of a calibration file (HesaiCalibrationConfiguration ).

inline bool nebula::drivers::uses_correction_file (
    const SensorModel & sensor_model
) 


function validate_decoder_settings

Check the settings of a sensor configuration that the decoder uses.

inline util::expected< std::monostate, std::string > nebula::drivers::validate_decoder_settings (
    const HesaiSensorConfiguration & config
) 

Returns:

Nothing if they are valid, otherwise a description of the first problem.



The documentation for this class was generated from the following file src/nebula_hesai/nebula_hesai_common/include/nebula_hesai_common/hesai_common.hpp