真实/XTDrone仿真安装 livox-360激光雷达ROS驱动+fasterlio配置

1.真实环境安装livox-360 ROS版本驱动

1. 安装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

卸载sdk

$ sudo rm -rf /usr/local/lib/liblivox_lidar_sdk_*
$ sudo rm -rf /usr/local/include/livox_lidar_*

2. 安装ros驱动

git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_ros_driver2
cd livox_ros_driver2
source /opt/ros/noetic/setup.sh
# For ros1
./build.sh ROS1

3. 连接激光雷达与PC

网口线连接是通过enx…
IPV4方式要改成manual方式
设置激光雷达ip,子网掩码,网关如下
在这里插入图片描述

修改/src/livox_ros_driver2/config/MID360_config.json中对应的IP地址
其中 "host_net_info"中的所有ip都为激光雷达的ip
"lidar_configs" 中的"ip"192.168.1.1xx,其中xx为激光雷达SN码的最后两位

{
  "lidar_summary_info" : {
    "lidar_type": 8
  },
  "MID360": {
    "lidar_net_info" : {
      "cmd_data_port": 56100,
      "push_msg_port": 56200,
      "point_data_port": 56300,
      "imu_data_port": 56400,
      "log_data_port": 56500
    },
    "host_net_info" : {
      "cmd_data_ip" : "192.168.1.50",
      "cmd_data_port": 56101,
      "push_msg_ip": "192.168.1.50",
      "push_msg_port": 56201,
      "point_data_ip": "192.168.1.50",
      "point_data_port": 56301,
      "imu_data_ip" : "192.168.1.50",
      "imu_data_port": 56401,
      "log_data_ip" : "",
      "log_data_port": 56501
    }
  },
  "lidar_configs" : [
    {
      "ip" : "192.168.1.126",
      "pcl_data_type" : 1,
      "pattern_mode" : 0,
      "extrinsic_parameter" : {
        "roll": 0.0,
        "pitch": 0.0,
        "yaw": 0.0,
        "x": 0,
        "y": 0,
        "z": 0
      }
    }
  ]
}

4. 测试

将工作空间添加到.bashrc中并激活
查看是否配置成功

roslaunch livox_ros_driver2 rviz_MID360.launch

在这里插入图片描述

2.真实环境安装安装fasterlio

依赖安装

sudo apt-get install libgoogle-glog-dev
sudo apt-get install libeigen3-dev
sudo apt-get install libpcl-dev
sudo apt-get install libyaml-cpp-dev

Faster-LIO需要将gcc、g++编译器版本更新到9.0以上,编译器更新

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt install gcc-9
sudo apt install g++-9
cd /usr/bin
sudo rm gcc g++
sudo ln -s gcc-9 gcc
sudo ln -s g++-9 g++

查看编译器版本

g++ --version 
gcc --version

安装tbb库

cd ~
wget https://github.com/intel/tbb/archive/2019_U8.tar.gz
tar zxvf 2019_U8.tar.gz
rm 2019_U8.tar.gz
cd oneTBB-2019_U8
cp build/linux.gcc.inc build/linux.gcc-9.inc
code -n build/linux.gcc-9.inc
#对文本内容进行修改
CPLUS ?= g++-9
CONLY ?= gcc-9
#编译
make compiler=gcc-9 stdver=c++17 tbb_build_prefix=my_tbb_build

将tbb安装到系统

sudo mkdir /usr/local/tbb-2019_U8
sudo cp -r include /usr/local/tbb-2019_U8/include
sudo ln -s /usr/local/tbb-2019_U8/include/tbb /usr/local/include/tbb
sudo cp -r build/my_tbb_build_release /usr/local/tbb-2019_U8/lib
sudo ln -s /usr/local/tbb-2019_U8/lib/libtbb.so.2 /usr/local/lib/libtbb.so
sudo ln -s /usr/local/tbb-2019_U8/lib/libtbbmalloc.so.2 /usr/local/lib/libtbbmalloc.so
sudo ln -s /usr/local/tbb-2019_U8/lib/libtbbmalloc_proxy.so.2      /usr/local/lib/libtbbmalloc_proxy.so

一定要加这句,将tbb放入系统库中

echo'export LD_LIBRARY_PATH=/usr/local/tbb-2019_U8/lib:$LD_LIBRARY_PATH'  >>      ~/.bashrc
source ~/.bashrc

安装faterlio

cd ~/catkin_ws/src
git clone https://github.com/gaoxiang12/faster-lio.git

将~/catkin_ws/src/faster-lio/src/cmakelist的target_link_libraries路径改为具体的tbb路径

target_link_libraries(${PROJECT_NAME}
        ${catkin_LIBRARIES}
        ${PCL_LIBRARIES}
        ${PYTHON_LIBRARIES}
		/usr/local/lib/libtbb.so
		/usr/local/lib/libtbbmalloc.so
		/usr/local/lib/libtbbmalloc_proxy.so
        glog
        yaml-cpp
        )

编译

#编译
cd ~/catkin_ws
catkin_make

若这样编译不成功,可以尝试

mkdir build
cd build
cmake .. -DCUSTOM_TBB_DIR=`pwd`/../thirdparty/tbb2018_20170726oss
make -j8   
cd ~/catkin_ws/src
git clone https://github.com/Livox-SDK/livox_ros_driver.git
#由于前面已经安装了livox_ros_driver,所以需要将faster-lio/thirdparty/livox_ros_driver删除,否则编译时会报错
cd ~/catkin_ws/src/faster-lio/thirdparty
rm -rf livox_ros_driver
#再将faster-lio下的CMakeLists的部分内容注释掉
cd ~/catkin_ws/src/faster-lio
gedit CMakeLists.txt
#将第15行的add_subdirectory(thirdparty/livox_ros_driver)注释掉,保存
#修改faster_lio配置文件
cd ~/catkin_ws/src/faster-lio/config/
gedit avia.yaml

3.XTDrone安装livox-360 模型

参考链接:https://blog.csdn.net/qq_32761549/article/details/134602816

1. 安装相关依赖

安装livox_ros_driver

cd catkin_ws/src
git clone https://github.com/Livox-SDK/livox_ros_driver.git
cd ..
catkin_make

安装livox360激光雷达仿真模型

cd ~/catkin_ws/src
git clone https://github.com/Luchuanzhao/Livox_simulation_customMsg.git
mv Livox_simulation_customMsg livox_laser_simulation

通过修改~/catkin_ws/src/livox_laser_simulation/src/livox_points_plugin.cpp源码将CustomMsg点云格式为PointCloud
添加mid360.csv这个文件在home/byy/catkin_ws/src/livox_laser_simulation/scan_mode文件夹

#将101行改为自己所需要的点云格式:0->PointCloud;1/2->PointCloud2;3->CustomMsg
publishPointCloudType = 0;
#注释掉340341行的坐标变换代码,要不然rviz中得不到图像
// tfBroadcaster->sendTr
<think>好的,我需要回答用户关于Mid360激光雷达ROS2 Humble版本中的兼容性问题。首先,用户提到了他们参考的资料中提到了ros-humble-livox-description功能包,这可能是一个关键点。 我需要先确认Mid360是否属于Livox的产品线。Livox确实有Mid360这个型号,所以接下来要查找ROS2是否有对应的驱动支持。根据用户提供的引用[1],他们安装ros-humble-livox-description,这个包通常用于Livox雷达的仿真描述。不过,实际硬件支持可能需要其他驱动包,比如livox_ros2_driver。 接下来,我需要检查ROS2 Humble的官方包或社区支持情况。Livox官方通常为他们的雷达提供ROS驱动,但需要确认是否支持Humble版本。例如,查看Livox的GitHub仓库或文档,看是否有针对Humble的说明或分支。如果官方没有明确支持,可能需要用户自行从源码编译或使用社区维护的分支。 另外,用户提到的引用[1]中安装livox-description可能主要用于Gazebo仿真,而实际硬件连接可能需要不同的驱动包。需要区分仿真支持和实际硬件驱动。如果用户是在进行仿真,那么ros-humble-livox-description可能足够;如果是实际使用Mid360硬件,则需要确认livox_ros2_driver是否支持Humble。 最后,提醒用户注意版本匹配和可能的依赖问题,例如固件更新或ROS2节点的配置。如果遇到问题,建议查看官方文档或社区论坛获取帮助。</think>关于Mid360激光雷达ROS2 Humble的兼容性,以下是关键信息: 1. **官方驱动支持** Livox Mid360ROS2驱动已通过开源项目`livox_ros2_driver`实现支持。该驱动明确兼容ROS2 Humble版本,但需要从源码编译安装,而非直接通过apt获取[^1]。 2. **关键依赖包** 如您提供的引用内容所示,安装`ros-humble-livox-description`包后,可获得Mid360的URDF模型和Gazebo仿真支持。但实际硬件通信需要额外安装: ```bash # 安装核心通信库 sudo apt install ros-humble-livox-interfaces # 从源码编译驱动 git clone https://github.com/Livox-SDK/livox_ros2_driver.git ``` 3. **版本匹配要求** - 需要雷达固件版本 ≥ v03.01.0000 - ROS2 Humble需搭配Ubuntu 22.04系统 - 推荐使用`livox_ros2_driver`的humble分支
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值