参考资料
【3D激光SLAM】Livox-mid-360激光雷达ip配置_Hahalim的博客-CSDN博客
关于在ROS1下用MID360配置FAST-LIO2备忘-CSDN博客
ROStopic——话题命令详解及简单演示(图文讲解)-CSDN博客
RLException:Unable to contact my own server at-CSDN博客
1、设置静态ip
首先在Ubuntu18.04.3 LTS下将本机IP地址置于和雷达IP同一局域网下
sudo ifconfig
sudo ifconfig enp2s0 192.168.1.50 //将enp6s0换成雷达和电脑的以太网有线连接的名称
2、检测ros1是否安装正常
如果出现RLExeption错误通过一下方法解决
1、在主文件夹中显示隐藏文件,Ctrl+h
2、直接打开文件.bashrc
3、修改其中的两行内容
$ export ROS_HOSTNAME=localhost
$ export ROS_MASTER_URI=http://localhost:11311
4、命令:source ~/.bashrc 更新 .bashrc
3、下载SDK
查看官方简介
Livox-SDK 和 livox_ros_driver: Drivers for receiving LiDAR data and more, support Lidar Mid-40, Mid-70, Tele-15, Horizon, Avia.
Livox-SDK2 和 livox_ros_driver2: Drivers for receiving LiDAR data and controlling lidar, support Lidar HAP and Mid-360.
3.1、安装Livox-SDK2
git clone https://github.com/Livox-SDK/Livox-SDK2.git
cd ./Livox-SDK2/
mkdir build
cd build
cmake .. && make -j8
sudo make install
3.2、安装livox_ros_driver2:
git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_ros_driver2
cd ws_livox
source /opt/ros/melodic(自己的ros版本)/setup.sh
./build.sh ROS1
ros版本查询命令 rosversion -d
4、配置参数
接下来修改 livox_ros_driver2中的一些config,蓝色划线与静态ip一致;红色划线为192.168.1.1xx,后两位为MID360最后两位广播码,比如我的是47MDL1C0010081(14位),那么就写192.168.1.181。
livox_ros_driver2/config/MID360_config.json
livox_ros_driver2/launch_ROS1/rviz_MID360.launch
livox_ros_driver2/launch_ROS1/msg_MID360.launch
5、rviz显示点云
!需要更改livox_ros_driver2/config/MID360_config.json文件内参数
!需要更改livox_ros_driver2/launch_ROS1/msg_MID360.launch文件内参数
!需要更改livox_ros_driver2/launch_ROS1/rviz_MID360.launch文件内参数
source devel/setup.bash
roslaunch livox_ros_driver2 msg_MID360.launch
#再开一个终端
source devel/setup.bash
roslaunch livox_ros_driver2 rviz_MID360.launch
6、输出话题数据
source devel/setup.bash
rostopic echo <topic_name> #查看话题内容
rostopic echo /livox/lidar
rviz_MID360.launch会发送sensor_msgs/PointCloud2话题类型的/livox/lidar,是rviz可以显示的点云类型
msg_MID360.launch会发送livox_ros_driver2/CustomMsg话题类型的/livox/lidar,是fast_lio要求输入的数据类型
xfer_format | launch文件 xfer_format 可修改话题类型 |
0 | Livox pointcloud2(PointXYZRTLT) pointcloud format |
1 | Livox customized pointcloud format |
2 | Standard pointcloud2 (pcl :: PointXYZI) pointcloud format in the PCL library (just for ROS) |