ubuntu18.04 配置 mid360并测试fast_lio

1.在买到Mid360之后,我们可以看到mid360延伸出来了三组线。

     第一组线是电源线,包含了红色线正极,和黑色线负极。一般可以用来接9-27v的电源,推荐接12v的电源转换器,或者接14.4v的电源转换器。

     第二组线是信号线,共5根线,包含了2根pps线,秒脉冲;包含了2根GPS信号输入和GPS信号输出线,和一根地线。

    第三组线是数据线,是一个网线,直接连接笔记本就可以了

2.IP配置

2.1 先把mid360的电源线接上,通上电;把数据线也就是网线插入到笔记本的网口上。

首先点屏幕右上角的向下箭头,找到【以太网连接】,点开后找到【有线设置】,在PCI以太网选项中,点击【齿轮】按钮,点ipv4,地址:192.168.1.50   子网掩码 255.255.255.0  网管 192.168.1.254

然后就可以用  Livox VIewer2 来显示了。

3. livox mid360配置指南

cd ~
# Download Livox Viewer 2
wget https://terra-1-g.djicdn.com/65c028cd298f4669a7f0e40e50ba1131/Mid360/LivoxViewer2%20for%20Ubuntu%20v2.3.0.zip
# Unzip
unzip "LivoxViewer2 for Ubuntu v2.3.0.zip"
# Go to Livox
cd "LivoxViewer2 for Ubuntu v2.3.0"
# Grant permission
chmod +x LivoxViewer2.sh
# Run Livox Viewer 2
./LivoxViewer2.sh

这时候,就直接可以看到mid360所采集的点云了。

4. livox sdk2 的配置

    (1) 修改mid360_config.json中的IP地址

   首先进入到livox_sdk2/Samples/Livox_lidar_quick_start文件夹中,打开mid360_config.json,把host_ip设置为:192.168.1.50   和之前设置在IPV4中的网址是一样的。

(2)配置livox_sdk2

# Install cmake
sudo apt install cmake -y
# Go to Home
cd ~
# Download Livox SDK2
git clone https://github.com/Livox-SDK/Livox-SDK2.git
# Go to the SDK2 package
cd Livox-SDK2
# Create build folder
mkdir build
cd build
# Compile
cmake .. && make -j
# Install SDK2 in system
sudo make install
# Go to demo1
cd samples/livox_lidar_quick_start
# WARNING: 
# Remember to modify the mid360_config.json with your PC IP 192.168.1.50

(3)运行demo

# Run demo
./livox_lidar_quick_start ../../../samples/livox_lidar_quick_start/mid360_config.json

就可以看到mid360所发出的消息。

5. Livox Ros配置

(1)配置livox ros

# Download the Livox ROS Driver 2 Package to ws_livox_src
git clone https://github.com/Livox-SDK/livox_ros_driver2.git ws_livox/src/livox_ros_driver2
# Update ros dependencies
rosdep install --from-paths src --ignore-src -r -y
# Build the package
source /opt/ros/noetic/setup.sh
# Go to livox
cd livox_ros_driver2/
./build.sh ROS1
# Source workspace
echo "source ws_livox/devel/setup.sh" >> ~/.bashrc
source ~/.bashrc
# Warning:
# Remember to modify the mid360_config.json with your PC IP 192.168.1.50
# and your lidar IP 192.168.1.1XX (xx is the last two digits of the SN code)

(2).修改IP地址

1)首先找到mid360_config.json,在src/Livox_ros_driver2/config文件夹中,host_net_info的子项cmd_data_ip, push_msg_ip, point_data_ip,imu_data_ip这四个都改成192.168.1.50

 2)然后把lidar_configs子项 ip 改为192.168.1.1xx,其中xx为 mid360上的SN码后两位。

(3).运行

roslaunch livox_ros_driver2 rviz_MID360.launch

6. fast-lio安装指南

(1) 安装eigen3

#安装eigen3
sudo apt install libeigen3-dev
#查看版本
$ pkg-config --modversion eigen3

(2)安装pcl

#安装PCL
sudo apt install libpcl-dev
#查看版本
apt-cache show libpcl-dev
#对照如下
#Ubuntu20.04   ——>   1.10.0
#Ubuntu18.04   ——>   1.8.1
#Ubuntu16.04   ——>   1.7.2

(3)安装sophus

# 安装非模版类Sophus
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff  #版本回溯
mkdir build && cd build && cmake .. && sudo make install

报错:

***/sophus/so2.cpp:32:26: error: lvalue required as left operand of assignment
   unit_complex_.real() = 1.;
                          ^~
***/sophus/so2.cpp:33:26: error: lvalue required as left operand of assignment
   unit_complex_.imag() = 0.;

解决:打开so2.cpp修改构造函数:

//unit_complex_.real() = 1.;
//unit_complex_.imag() = 0.;
unit_complex_.real(1.); 
unit_complex_.imag(0.);

安装结果如下:

-- Install configuration: "Release"
-- Up-to-date: /usr/local/include/sophus
-- Installing: /usr/local/include/sophus/se3.h
-- Installing: /usr/local/include/sophus/scso3.h
-- Installing: /usr/local/include/sophus/se2.h
-- Installing: /usr/local/include/sophus/so2.h
-- Installing: /usr/local/include/sophus/sim3.h
-- Installing: /usr/local/include/sophus/so3.h
-- Installing: /usr/local/lib/libSophus.so

(4)FAST_LIO编译

#首先创建一个ROS1的工作空间,在工作空间下的src中运行

cd src

git clone https://github.com/zlwang7/S-FAST_LIO.git --recursive

(5)修改FAST_LIO代码

原因:FAST_LIO默认支持livox_ros_driver但是我们用的是livox_ros_driver2

     1)修改FAST_LIO的CMakelists.txt

添加:

set(Sophus_LIBRARIES "/usr/local/lib/libSophus.so")

修改:

find_package(catkin REQUIRED COMPONENTS
  geometry_msgs
  nav_msgs
  sensor_msgs
  roscpp
  rospy
  std_msgs
  pcl_ros
  tf
  livox_ros_driver                # <-修改这里
  message_generation
  eigen_conversions
)

修改后:

find_package(catkin REQUIRED COMPONENTS
  geometry_msgs
  nav_msgs
  sensor_msgs
  roscpp
  rospy
  std_msgs
  pcl_ros
  tf
  livox_ros_driver2                # <-修改这里
  message_generation
  eigen_conversions
)

  2)修改FAST_LIO的package.xml

修改前:

<build_depend>livox_ros_driver</build_depend><run_depend>livox_ros_driver</run_depend>

修改后:

<build_depend>livox_ros_driver2</build_depend><run_depend>livox_ros_driver2</run_depend>

3)修改FAST_LIO的头文件引用

分别打开FAST_LIO/src/preprocess.h 、FAST_LIO/src/laserMapping.cpp

修改前:

#include <livox_ros_driver/CustomMsg.h>

修改后:

#include <livox_ros_driver2/CustomMsg.h>

4)修改FAST_LIO的命名空间

分别打开FAST_LIO/src/preprocess.hFAST_LIO/src/preprocess.cppFAST_LIO/src/laserMapping.cpp、FAST_LIO/src/laserMapping_re.cpp 中的命名空间,有多处需要修改

修改前:

livox_ros_driver::

修改后:

livox_ros_driver2::

(6)编译

catkin_make

成功后:

如果还有编译错误提示,那就说明livox_ros_driver::没有全部改成livox_ros_driver2:: ,如下图:

(7)运行demo

source devel/setup.bash
roslaunch livox_ros_driver2 msg_MID360.launch
#再开一个终端
source devel/setup.bash
roslaunch fast_lio mapping_mid360.launch

参考文献:

https://zhuanlan.zhihu.com/p/668966629

相关推荐

  1. 【Livox激光MID-360】调试记录

    2024-06-13 19:32:03       40 阅读
  2. ubuntu nginx配置密码访问下载

    2024-06-13 19:32:03       81 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-06-13 19:32:03       98 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-06-13 19:32:03       106 阅读
  3. 在Django里面运行非项目文件

    2024-06-13 19:32:03       87 阅读
  4. Python语言-面向对象

    2024-06-13 19:32:03       96 阅读

热门阅读

  1. 在 Ubuntu 上取消登录密码和锁屏功能的简易指南

    2024-06-13 19:32:03       40 阅读
  2. MySQL(2)

    2024-06-13 19:32:03       23 阅读
  3. AForge.NET介绍

    2024-06-13 19:32:03       25 阅读
  4. tar cjf xx.tar.bz2 xx,命令参数的含义

    2024-06-13 19:32:03       30 阅读
  5. MySQL bin-log日志恢复数据

    2024-06-13 19:32:03       32 阅读
  6. LVS ipvsadm命令的使用(二)

    2024-06-13 19:32:03       28 阅读
  7. CVE-2020-1472域渗透 NetLogon 权限提升漏洞

    2024-06-13 19:32:03       34 阅读
  8. 在 Visual Studio 调试器中指定符号 (.pdb) 和源文件

    2024-06-13 19:32:03       32 阅读
  9. Android 调用系统相册、系统相机拍照

    2024-06-13 19:32:03       26 阅读
  10. 新视野大学英语2 词组 6.13

    2024-06-13 19:32:03       33 阅读
  11. Hutool有哪些常用方法

    2024-06-13 19:32:03       24 阅读