实现 Mid360 仿真的接入
在虚拟环境中使用 Mid360 驱动,需要编译相应的仿真环境并配置 YAML 文件。
安装 Mid360 仿真环境
git clone https://github.com/Livox-SDK/Livox-SDK2.git
cd ./Livox-SDK2/
mkdir build
cd build
cmake .. && make -j
sudo make install
在主目录下创建工作空间:
mkdir -p catkin_ws/src
cd catkin_ws/src
git clone https://github.com/Livox-SDK/livox_ros_driver2.git
cd livox_ros_driver2
./build.sh ROS1
source ../../devel/setup.bash
roslaunch livox_ros_driver2 [launch file]
在此环境中安装 Mid360 仿真环境:
git clone https://github.com/qiurongcan/Mid360_imu_sim.git
cd ..
catkin_make
source devel/setup.bash
roslaunch livox_laser_simulation livox_simulation.launch
# 或使用带 IMU 版本
roslaunch livox_laser_simulation mid360_IMU_platform.launch
常见报错与解决方案
报错:Protoc、Math 库版本不对
错误日志显示 Gazebo 生成的 protobuf 文件与当前系统版本不兼容。核心原因是 Ubuntu 18 对该包支持度不好,导致 math 和 protoc 版本冲突。
解决步骤:
- 检查版本:
protoc --version dpkg -l | grep protobuf ls /usr/local/include/google/protobuf - 更换库:如果无法强行改版本,建议换用另一个兼容的库。
cd ~/catkin_ws/src
git clone https://github.com/Luchuanzhao/Livox_simulation_customMsg mv Livox_simulation_customMsg livox_laser_simulation cd ~/catkin_ws/src/livox_laser_simulation/src

