文章目录
- 一、接线连接
- 二、安装上位机可视化工具
- 三、安装ROS驱动
- 3.1 配置静态IP
- 3.2 安装Livox SDK2
- 3.3 安装ROS驱动
- 3.4 驱动
本文介绍如何在Ubuntu20.04中安装大疆Livox MID-360的ROS1/2驱动
一、接线连接
livox航插一分三线,其中航空母头连接激光雷达,网线连接PC,电源需要DC 9~27 V,推荐使用 12 V,注意正负极
二、安装上位机可视化工具
去官网https://www.livoxtech.com/cn/mid-360/downloads下载上位机软件Livox Viewer 2 - Ubuntu
unzip "LivoxViewer2 for Ubuntu v2.3.0.zip"
cd "LivoxViewer2 for Ubuntu v2.3.0"
chmod +x LivoxViewer2.sh
./LivoxViewer2.sh
三、安装ROS驱动
3.1 配置静态IP
主机配置静态IP为192.168.1.50
3.2 安装Livox SDK2
git clone https://github.com/Livox-SDK/Livox-SDK2.git
cd Livox-SDK2/
mkdir build && cd build
cmake ..
make -j
sudo make install
查看是否安装成功,需要修改Livox-SDK2/samples/livox_lidar_quick_start/mid360_config.json中:
"host_ip" : "192.168.1.50",
运行如下则安装成功:
cd Livox-SDK2/build/samples/livox_lidar_quick_start
./livox_lidar_quick_start ../../../samples/livox_lidar_quick_start/mid360_config.json
3.3 安装ROS驱动
cd ~
git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_ros_driver2
cd ws_livox/src/livox_ros_driver2
# For ros1
./build.sh ROS1
# For ros2
./build.sh ROS2
3.4 驱动
修改ws_livox/src/livox_ros_driver2/config/MID360_config.json中主机IP cmd_data_ip和雷达IP,其中雷达IP 192.168.1.1XX,后两位为雷达S/N码(可以在雷达包装盒和雷达下面找到)的最后两位
"cmd_data_ip" : "192.168.1.50",
"ip" : "192.168.1.140",
启动
cd ws_livox
source install/setup.sh
ros2 launch livox_ros_driver2 rviz_MID360_launch.py
如果遇到类似的报错:what(): Could not load library dlopen error: liblivox_lidar_sdk_shared.so: cannot open shared object file: No such file or directory, at /tmp/binarydeb/ros-galactic-rcutils-4.0.4/src/shared_library.c:99
,说明缺少Livox SDK2库,已安装但不可用,因为不在 LD_LIBRARY_PATH 环境变量中。所以将 /usr/local/lib 目录添加到变量.bashrc中:
sudo gedit ~/.bashrc
# 添加:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
ROS1驱动
cd ws_livox
source devel/setup.sh
roslaunch livox_ros_driver2 rviz_MID360.launch