整体的调试思路参考大疆Livox Mid360 使用指南_mid360中的imu内参-CSDN博客这篇博客。
但是在调试过程中出现了ip地址设置不对导致的报错:
1.livox viewer中看不到点云数据
2.livox SDK2 bind error。
joey@joey:~/slam/Livox-SDK2/build/samples/livox_lidar_quick_start$ ./livox_lidar_quick_start ../../../samples/livox_lidar_quick_start/mid360_config.json
[2024-08-29 20:55:58.705] [console] [info] set master/slave sdk to master sdk by default [parse_cfg_file.cpp] [Parse] [82]
[2024-08-29 20:55:58.705] [console] [info] Livox lidar logger disable. [parse_cfg_file.cpp] [Parse] [126]
[2024-08-29 20:55:58.705] [console] [info] Lidar ip:192.168.1.10 point cloud and IMU data multicast ip:224.1.1.5 [params_check.cpp] [CheckLidarMulticastIp] [133]
[2024-08-29 20:55:58.705] [console] [info] Lidar ip:192.168.1.11 point cloud and IMU data multicast ip:224.1.1.5 [params_check.cpp] [CheckLidarMulticastIp] [133]
[2024-08-29 20:55:58.705] [console] [info] Lidar ip:192.168.1.12 point cloud and IMU data multicast ip:224.1.1.5 [params_check.cpp] [CheckLidarMulticastIp] [133]
[2024-08-29 20:55:58.705] [console] [info] Lidar ip:192.168.1.13 point cloud and IMU data multicast ip:224.1.1.5 [params_check.cpp] [CheckLidarMulticastIp] [133]
[2024-08-29 20:55:58.705] [console] [info] Data Handler Init Succ. [data_handler.cpp] [Init] [49]
bind failed
[2024-08-29 20:55:58.706] [console] [error] Create detection socket failed. [device_manager.cpp] [CreateDetectionChannel] [275]
[2024-08-29 20:55:58.706] [console] [error] Create detection channel failed. [device_manager.cpp] [CreateChannel] [242]
[2024-08-29 20:55:58.706] [console] [error] Create channel failed. [device_manager.cpp] [Init] [169]
Livox Init Failed
之后根据【3D激光SLAM】Livox-mid-360激光雷达ip配置_mid360-CSDN博客这一篇博客修改了以太网的ip。(图片来源于Hahalim的博客)修改ip之后上述错误仍然存在。
这时候可以怀疑,是不是livox的ip不是默认ip 192.168.1.1xx,使用Tcpdump命令,来查看连接的livox的ip。可以看到ip 192.168.2.110一直在发送数据,看来应该是之前livox的ip被改过,从192.168.1.110改成192.168.2.110了。
然后我们来修改对于config文件中的ip地址,首先来看livox SDK2中的ip地址,我们要运行livox_lidar_quick_start,要修改mid360_config.json。改一下host_ip,注意修改的ip要和以太网设置的ip一致,“192.168.2.50”其中50可以改,192.168.2与livox的ip保持一致。
{
"MID360": {
"lidar_net_info" : {
"cmd_data_port" : 56100,
"push_msg_port" : 56200,
"point_data_port": 56300,
"imu_data_port" : 56400,
"log_data_port" : 56500
},
"host_net_info" : [
{
"host_ip" : "192.168.2.50",
"multicast_ip" : "224.1.1.5",
"cmd_data_port" : 56101,
"push_msg_port" : 56201,
"point_data_port": 56301,
"imu_data_port" : 56401,
"log_data_port" : 56501
}
]
}
}
将ip改好之后,就不会有bind error和点云数据不显示的情况了。