Software Setup Tutorial: Environment and Driver Installation - WilsonGuo/FastLivo_Replication GitHub Wiki

Software Setup Tutorial: Environment and Driver Installation

System Requirements:

  • Ubuntu 18.04
  • ROS Melodic

Please ensure the above system environment and ROS are installed.

Main Tasks:

Main Tasks

Additionally: Additional Tasks

Driver Installation:

1. STM32 Firmware Flashing

Firmware Package

You can use Keil to open and flash the firmware.

2. Mid360 Driver Package

Download these two packages to your ROS workspace directory, for example, livo_driver_ws/src:

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

Wait for the packages to download completely.

First, compile and install Livox-SDK2:

cd ./Livox-SDK2/
mkdir build
cd build
cmake .. && make -j
sudo make install

Next, compile livox_ros_driver2:

cd ./livox_ros_driver2/
source /opt/ros/melodic/setup.sh
./build.sh ROS1

Since you ran the build.sh script, it will compile all packages under the livo_driver_ws directory. Wait for the compilation to complete.

Note: Do not use catkin_make directly in the livo_driver_ws directory at this point.

Additionally, after verifying the lidar is working correctly, modify launch_ROS1/msg_MID360.launch to change the xfer_format attribute value to 1.

Fast LIVO uses a custom point cloud data format, not the conventional PointCloud2 format.

Explanation:

  • xfer_format sets the point cloud format.
    • 0 – Livox PointCloud2 (PointXYZRTL) format.
    • 1 – Livox custom point cloud data format.
    • 2 – Standard PointCloud2 (pcl::PointXYZI) format in the PCL library.

Another area to modify or confirm:

In config/MID360_config.json, ensure the IP addresses in host_net_info and lidar_configs match. Otherwise, communication with the Mid360 will fail. The IP addresses can be checked using the Livox Viewer2 client.

3. Hikvision Camera Driver Package and Configuration

Hikvision does not provide a ROS driver package for the camera, but the Fast LIVO author has provided a corresponding ROS driver package:

mvs_ros_pkg

However, this is for the original NUC X86 driver, which is not suitable for Jetson. Thus, it cannot be used directly.

Fortunately, a third party has provided a corresponding ROS adaptation. It is recommended to use: HIKROBOT-MVS-CAMERA-ROS

Refer to the following blog for guidance: Hikvision Camera MVS Linux SDK ROS Package Development

It is relatively simple to use.

4. Fast LIVO Installation

Official GitHub

  1. Dependencies:

PCL >= 1.6, install as per PCL installation instructions.

Eigen >= 3.3.4, install as per Eigen installation instructions.

OpenCV >= 3.2, install as per OpenCV installation instructions. (It's recommended to install OpenCV version 3.2 to avoid many issues later.)

  1. Install Sophus
git clone https://github.com/strasdat/Sophus.git
cd Sophus
git checkout a621ff
mkdir build && cd build && cmake ..
make
sudo make install
  1. Install Vikit
cd catkin_ws/src
git clone https://github.com/uzh-rpg/rpg_vikit.git

Steps 2 and 3 might have several issues that need to be resolved patiently.

  1. Build Fast LIVO
cd ~/catkin_ws/src
git clone https://github.com/hku-mars/FAST-LIVO
cd ../
catkin_make
source ~/catkin_ws/devel/setup.bash

Compilation Error Summary:

  1. Error: Missing point6D.h file or fatal error: fast_livo/States.h: No such file or directory.

    This is because Fast LIVO references custom message types but does not handle the references properly. This issue is minor and can be resolved by multiple compilations without modifying any code.

  2. Cannot find livox_ros_driver.

    Since Fast LIVO references the first version of livox_ros_driver, and we have replaced it with livox_ros_driver2, you need to search and replace livox_ros_driver with livox_ros_driver2 in the code.