树莓派Ubuntu22.04 安装ROS2 humble MID360

树梅派安装ROS2 humble MID360

主查考:https://blog.csdn.net/qq_29912325/article/details/130269367
辅助参考:https://github.com/Livox-SDK/livox_ros_driver2

查看官方简介
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.


1. 编译Livox-SDK2
官方地址:https://github.com/Livox-SDK/Livox-SDK2

执行一下命令:

git clone https://github.com/Livox-SDK/Livox-SDK2.git
cd ./Livox-SDK2/
mkdir build
cd build
cmake .. && make
sudo make install


如上就安装完成了Livox-SDK2,会安装如下内容:

-- Installing: /usr/local/lib/liblivox_lidar_sdk_static.a

-- Installing: /usr/local/include/livox_lidar_def.h

-- Installing: /usr/local/include/livox_lidar_api.h

-- Installing: /usr/local/include/livox_lidar_cfg.h

-- Installing: /usr/local/lib/liblivox_lidar_sdk_shared.so


如需删除,执行如下命令:
sudo rm -rf /usr/local/lib/liblivox_lidar_sdk_*
sudo rm -rf /usr/local/include/livox_lidar_*

2.编译livox_ros_driver2
官方地址:https://github.com/Livox-SDK/livox_ros_driver2

2.1.克隆源代码
打开终端执行如下命令,会将源代码clone在/home/ws_livox/src/livox_ros_driver2目录下,这步创建了ROS2需要使用的工作空间。

git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_ros_driver2

cd   /src/livox_ros_driver2
注意目录权限
source /opt/ros/humble/setup.sh
可查看~./bashrc是否添加完成
./build.sh humble
修改对应的配置文件

source ../../install/setup.sh
ros2 launch livox_ros_driver2 [launch file]

测试运行
ros2 launch livox_ros_driver2 rviz_MID360_launch.py

3.编译FAST_LIO

git clone https://github.com/hku-mars/FAST_LIO.git
cd FAST_LIO
git submodule update --init
cd ../..

修改对应CMakelists.txt、package.xml、FAST_LIO/src/preprocess.h、FAST_LIO/src/preprocess.cpp、FAST_LIO/src/laserMapping.cpp中的livox_ros_driver,修改成livox_ros_driver2

catkin_make

source devel/setup.bash

测试运行

roslaunch fast_lio mapping_mid360.launch

问题一
By not providing "Findament_cmake.cmake" in CMAKE_MODULE_PATH this project
  has asked CMake to find a package configuration file provided by
  "ament_cmake", but CMake did not find one.
 
  Could not find a package configuration file provided by "ament_cmake" with
  any of the following names:
 
    ament_cmakeConfig.cmake
    ament_cmake-config.cmake
 
  Add the installation prefix of "ament_cmake" to CMAKE_PREFIX_PATH or set
  "ament_cmake_DIR" to a directory containing one of the above files.  If
  "ament_cmake" provides a separate development package or SDK, be sure it
  has been installed.
————————————————
我错误原因,个人目录权限不对 sudo chmod  777 -R  xxx

问题二
Package 'livox_ros_driver2' not found: "package 'livox_ros_driver2' not found, searching: ['/opt/ros/humble']"
————————————————
没有将source ../../install/setup.sh设置到~./bashrc

问题三

如果遇到类似的报错: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中:
————————————————
版权声明:本文为CSDN博主「ZARD帧心」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/ZARDforever123/article/details/134219903

sudo gedit ~/.bashrc
# 添加:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

问题四

安装FAST_LIO 编译livox_ros_driver2出现下面,一直无法编译100%

make: *** [Makefile:141:all] 错误 2Invoking "make -j4 -l4" failed

 解决方法: 单独安装livox_ros_driver2编译,注册到.baserc中, 再使用官方教程中的FAST_LIO的catkin_make编译

cd ~/$A_ROS_DIR$/src
git clone https://github.com/hku-mars/FAST_LIO.git
cd FAST_LIO
git submodule update --init
cd ../..
catkin_make
source devel/setup.bash

 通过后可以启动livox_ros_driver2和FAST_LIO

<think>好的,我现在需要帮助用户在Ubuntu 22.04上配置和使用Livox激光雷达设备。用户提到了CSDN的一篇关于Ubuntu20.04安装Livox ROS Driver的博客,以及官方的GitHub仓库,但用户现在使用的是Ubuntu 22.04,可能需要一些调整。 首先,我需要确认Livox官方是否已经支持Ubuntu 22.04。根据引用[2]的GitHub页面,Livox ROS Driver2支持ROSROS2,但可能需要特定的ROS版本。Ubuntu 22.04通常对应ROS2 Humble,而Ubuntu20.04对应ROS Noetic或ROS2 Foxy。用户可能需要安装ROS2 Humble。 接下来,步骤可能包括安装依赖项、克隆仓库、编译和配置环境。需要检查依赖项是否兼容,比如CMake版本、库文件等。Ubuntu 22.04的包可能更新,需要调整安装命令中的包名称,比如将`ros-noetic`改为`ros-humble`。 另外,权限问题可能需要使用udev规则来处理USB设备。用户需要将Livox设备添加到规则中,可能需要复制提供的规则文件并重新加载服务。 还需要注意ROS2的工作空间创建和编译步骤,是否使用colcon代替catkin_make。用户可能需要创建src目录,然后使用colcon build进行编译。 最后,测试部分可能需要使用不同的启动文件或命令,特别是ROS2中的节点启动方式可能与ROS不同,比如使用ros2 launch代替roslaunch。 需要提醒用户注意版本兼容性,如果遇到问题,可能需要查看官方文档或社区支持。此外,可能需要安装Livox SDK2,因为驱动可能依赖于特定版本的SDK。</think>### Ubuntu 22.04 上配置 Livox 激光雷达的步骤 #### 1. **安装依赖项** - 安装基础编译工具和 ROS 依赖: ```bash sudo apt update && sudo apt install -y build-essential cmake git libpcap-dev python3-colcon-common-extensions ``` - **ROS2 环境配置**: Ubuntu 22.04安装 **ROS2 Humble**(若未安装,参考[官方教程](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html))[^2]。 #### 2. **克隆 Livox ROS Driver2 仓库** ```bash mkdir -p ~/livox_ws/src && cd ~/livox_ws/src git clone https://github.com/Livox-SDK/livox_ros_driver2.git ``` #### 3. **安装 Livox SDK2(驱动依赖)** ```bash cd ~/livox_ws/src git clone https://github.com/Livox-SDK/Livox-SDK2.git ``` #### 4. **编译驱动** ```bash cd ~/livox_ws rosdep install --from-paths src --ignore-src -r -y # 安装ROS依赖 colcon build --symlink-install # 使用ROS2编译命令 ``` #### 5. **配置设备权限** - 复制 udev 规则并重载服务: ```bash sudo cp ~/livox_ws/src/livox_ros_driver2/config/60-livox.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules && sudo udevadm trigger ``` #### 6. **运行驱动** ```bash source ~/livox_ws/install/setup.bash ros2 launch livox_ros_driver2 rviz_MID360_launch.py # 示例启动文件(根据设备型号调整) ``` #### 注意事项 - **兼容性**:Livox ROS Driver2 主要支持 ROS2 HumbleUbuntu 22.04)和 ROS2 Foxy(Ubuntu 20.04)[^2]。 - **设备型号**:启动文件需根据实际设备(如 Mid-360 或 HAP)选择,可在 `livox_ros_driver2/launch` 目录下查找。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值