文件rs_driver/src/rs_driver/driver_param.h
中, 定义了rs_driver的配置参数。
rs_driver的参数主要保存在RSDriverParam、RSDecoderParam、和RSInputParam三个结构中。
RSDriverParam中包括RSDecoderParam和RSInputParam。
typedef struct RSDriverParam
{
LidarType lidar_type = LidarType::RS16; ///< Lidar type
InputType input_type = InputType::ONLINE_LIDAR; ///< Input type
RSInputParam input_param;
RSDecoderParam decoder_param;
} RSDriverParam;
enum LidarType
{
RS16 = 1,
RS32,
RSBP,
RS128,
RS80,
RSHELIOS,
RSROCK,
RSM1
};
enum InputType
{
ONLINE_LIDAR = 1,
PCAP_FILE,
RAW_PACKET
};
RSDecoderParam指定雷达的Packet解析器如何工作。
typedef struct RSDecoderParam
{
bool use_lidar_clock = false;
bool dense_points = false;
bool wait_for_difop = true;
RSTransformParam transform_param;
bool config_from_file = false;
std::string angle_path = "";
float min_distance = 0.2f;
float max_distance = 200.0f;
// The following parameters are only for mechanical Lidars.
SplitFrameMode split_frame_mode = SplitFrameMode::SPLIT_BY_ANGLE;
float split_angle = 0.0f;
uint16_t num_blks_split = 1;
float start_angle = 0.0f;
float end_angle = 360.0f;
} RSDecoderParam;
如下参数针对所有雷达。
use_lidar_clock
=true
,则使用雷达写入Packet中的时间戳;如果use_lidar_clock
=false
,则使用rs_driver在主机端产生的时间戳。dense_points
=false
, 则点云中包含NAN点;如果dense_points
=true
,则去除点云中的NAN点。wait_for_difop
=false
,有助于定位问题的位置。ENABLE_TRANSFORM
=ON
时才有效。typedef struct RSTransformParam
{
float x = 0.0f; ///< unit, m
float y = 0.0f; ///< unit, m
float z = 0.0f; ///< unit, m
float roll = 0.0f; ///< unit, radian
float pitch = 0.0f; ///< unit, radian
float yaw = 0.0f; ///< unit, radian
} RSTransformParam;
如下参数仅针对机械式雷达。
SPLIT_BY_ANGLE
是按用户指定的角度
分帧;SPLIT_BY_FIXED_BLKS
是按理论上的每圈BLOCK数
分帧;SPLIT_BY_CUSTOM_BLKS
按用户指定的BLOCK数
分帧。默认值是SPLIT_BY_ANGLE
。一般不建议使用其他两种模式。enum SplitFrameMode
{
SPLIT_BY_ANGLE = 1,
SPLIT_BY_FIXED_BLKS,
SPLIT_BY_CUSTOM_BLKS
};
split_frame_mode
=SPLIT_BY_ANGLE
, 则split_angle
指定分帧的角度num_blks_split - 如果split_frame_mode
=SPLIT_BY_CUSTOM_BLKS
,则num_blks_split
指定每帧的BLOCK数。
start_angle、end_angle - 机械式雷达一般输出的点云的水平角在[0
, 360
]之间,这里可以指定一个更小的范围[start_angle
, end_angle
)。
RSInputParam指定rs_driver得到有关雷达的Packet源的参数。
如下参数针对ONLINE_LIDAR
和PCAP_FILE
。
如下参数仅针对ONLINE_LIDAR。
host_address
指定的网卡加入这个组播组,以便接收MSOP/DIFOP Packet。如下参数仅针对PCAP_FILE。
理论上的雷达帧率
播放PCAP文件。pcap_rate
可以在这个速度上指定一个比例值,加快/放慢播放速度。use_vlan
=true
,跳过这一层。typedef struct RSInputParam
{
uint16_t msop_port = 6699;
uint16_t difop_port = 7788;
std::string host_address = "0.0.0.0";
std::string group_address = "0.0.0.0";
// The following parameters are only for PCAP_FILE
std::string pcap_path = "";
bool pcap_repeat = true;
float pcap_rate = 1.0;
bool use_vlan = false;
} RSInputParam;