外观
教程raw.githubusercontent.com6 天前
Livox MID360:livox_ros_driver2 编译、配置与点云话题实操
> 本文依据以下官方文档整理:raw.githubusercontent.com/Livox-SDK/livox_ros_driver2/master。命令与版本以文档当前版本为准。
前置条件
- Livox LiDAR 产品:MID360
- Ubuntu 20.04 for ROS Noetic and ROS2 Foxy;Ubuntu 22.04 for ROS2 Humble;Ubuntu 24.04 for ROS 2 Jazzy
- ROS noetic recommended;ROS2 foxy or humble recommended
- Desktop-Full installation is recommend
- Colcon is a build tool used in ROS2
- 已完成 Build & install the Livox-SDK2
1. 克隆 livox_ros_driver2 源码
先把源码克隆到工作空间的 src 目录;文档强调必须放在“[work_space]/src/”下,否则会因编译工具限制导致 compilation errors。
bash
git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_ros_driver22. 按 ROS 版本选择编译命令
完成 Livox-SDK2 后,在 livox_ros_driver2 中按实际 ROS 版本执行对应构建。ROS 以 Noetic 为例,ROS2 分 Foxy、Humble、Jazzy。
bash
source /opt/ros/noetic/setup.sh
./build.sh ROS1bash
source /opt/ros/foxy/setup.sh
./build.sh ROS2bash
source /opt/ros/humble/setup.sh
./build.sh humblebash
source /opt/ros/jazzy/setup.sh
./build.sh jazzy3. 选择 MID360 启动文件
ROS 启动文件位于“ws_livox/src/livox_ros_driver2/launch_ROS1”,ROS2 启动文件位于“ws_livox/src/livox_ros_driver2/launch_ROS2”。MID360 可选 rviz_MID360.launch 或 msg_MID360.launch。
4. 运行 livox_ros_driver2
ROS 使用 devel 环境,ROS2 使用 install 环境。[launch file] 选择要用的启动文件;rviz_MID360.launch 会连接 MID360、发布 pointcloud2 format data 并 Autoload rviz。
bash
source ../../devel/setup.sh
roslaunch livox_ros_driver2 [launch file]bash
source ../../install/setup.sh
ros2 launch livox_ros_driver2 [launch file]5. 设置点云发布参数
内部参数都在 launch file。publish_freq 设置点云发布频率,默认 10.0,最大 100.0 Hz;multi_topic 控制点云 topic 是否独立;xfer_format 控制点云格式。
6. 配置 MID360 的 json 文件
LiDAR Configurations 通过 json-style config file 设置。single Mid360 的配置在“config”文件夹中,launch file 里的 user_config_path 指向该 json file path,即 config/MID360_config.json。
验证是否跑通
使用 rviz_MID360.launch 时,文档说明会 Connect to MID360 LiDAR device、Publish pointcloud2 format data、Autoload rviz;使用 msg_MID360.launch 时,会 Publish livox customized pointcloud data。multi_topic 为 0 时所有 LiDAR devices 使用同一 topic,设置为 1 时 Each LiDAR device has its own topic。
文档里点名的注意事项
- Livox ROS Driver is not recommended for mass production but limited to test scenarios.
- Be sure to clone the source code in a '[work_space]/src/' folder, otherwise compilation errors will occur due to the compilation tool restriction.
- Other parameters not mentioned in this table are not suggested to be changed unless fully understood.
- xfer_format 为 2 时,Standard pointcloud2 (pcl :: PointXYZI) pointcloud format in the PCL library 仅 just for ROS。
- MID360 and Mid360s LiDARs use the same port numbers and config structure, only with a different device key.
相关 SDK 条目
来源
本页事实对应的公开页面,以原文为准。