Livox_Mid360驱动安装指南与实战评测
前言
本文记录了Livox_Mid360驱动安装及配置本地网络的过程,并对Mid360做简单测试。
参考链接:
Jetsonano搭载ros1(melodic/noetic)获取Livox-mid-360激光雷达数据并输出保存到txt文件
在Linux上安装其他版本的cmake 或 升级cmake
安装驱动
需要安装Livox-SDK2和livox_ros_driver2,经测试发现在catkin_ws/src目录下无法正常安装,会报fatal error: livox_ros_driver/CustomMsg.h:No such file and directory错误,怀疑是多线程编译导致,因此选择在其他目录下安装这两个包。
cd ~
mkdir livox_ws/src
安装Livox-SDK2
cd livox_ws/src
git clone https://github.com/Livox-SDK/Livox-SDK2.git
cd Livox-SDK2
mkdir build
cd build
cmake .. && make -j8
sudo make install
过程中产生报错:
CMake 3.14 or higher is required. You are running version 3.10.2 #需升级cmake版本
安装version–3.14.1 https://cmake.org/files/ ,解压到任意路径,文件已经编译过了,解压后就可以用
卸载旧版本
sudo rm -rf /usr/bin/cmake
建立软链接
sudo ln -s /your_directory_path/bin/cmake /bin/cmake /usr/bin/cmake
查看版本
cmake --version
安装livox_ros_driver2
cd livox_ws/src
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
参数配置
接下来修改 livox_ros_driver2中的一些config,host_net_info与静态ip一致;lidar_configs为192.168.1.1xx,后两位为MID360最后两位广播码,比如我的是47MDM540020550(14位),那么就写192.168.1.150。
livox_ros_driver2/config/MID360_config.json
修改bd_list中的default,改成自己的码,以下两个文件都需要修改
livox_ros_driver2/launch_ROS1/rviz_MID360.launch、livox_ros_driver2/launch_ROS1/msg_MID360.launch
测试
先配置.bashrc
gedit .bashrc
#将下面这行代码加入其中,再source
source ~/livox_ws/src/ws_livox/devel/setup.bash
运行
#点云输出格式为CustomMsg
roslaunch livox_ros_driver2 msg_MID360.launch
#点云输出格式为PointCloud2
roslaunch livox_ros_driver2 rviz_MID360.launch
#再运行自己的脚本文件,接受话题为/livox/lidar的点云信号即可
测试过程
open3d共显示2次,第一次显示:找反射率130以上的点云,在长40cm,宽10cm的范围内,此类点云的数量超过12个,则将其显示到open3d中,若存在多个这样的矩形区域,则只显示点云数量最多的那一个区域;第二次显示:显示所有点云,反射率130以上的用红色,130以下的用蓝色
测试结果
包含高反射率点最多的矩形区域(40*20,17个)
环境点云图
反光条所在处点云图(17个)
open3d安装
pip install open3d
ERROR: Could not find a version that satisfies the requirement comm>=0.1.3 (from ipywidgets->open3d) (from versions: 0.0.1) ERROR: No matching distribution found for comm>=0.1.3 (from ipywidgets->open3d)
解决方法:
pip install ipywidgets==7.6.3
pip install open3d
作者:夜雨拾年