Skip to content

DeepRoboticsLab/fast-livo2-deep-robotics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hardware extension for Lite3 Robot. Reproduce FAST-LIVO2 as an example.

Discord

0. Overview

This repo documents the process of installing and reproducing FAST-LIVO2 on DEEP Robotics Lite3 robot, including camera/lidar installation, onboard compute extension and how to test this in an outdoor environment. Original repo and paper. And you can watch our tutorial videos on Bilibili or Youtube.

System Environment: Ubuntu 22.04, ROS2 Humble, Lite3 Venture (ONLY THIS VERSION!), AGX Jetson Orin (or other onboard compute)

1. Hardware setup

1.1 Onboard compute setup and ROS2 installation

Please setup your onboard compute and install ROS2 on it. For details, please check their websites. We've tested the repo on AGX Jetson Orin with ROS2 Humble. Note: we are using Jetpack 6.1 and the cmake version is 3.22.

1.2 Intergration with Lite3 robot

If you have Lite3 pro/lidar, you don't need further hardware extension cause there is already a Orin NX and you can use that as additional onboard compute. If you have Lite3 venture, you can follow the installation process in our video. For the 3d printed structure parts, you can download them from here.

2. FAST-LIVO2 Installation and Reproduction

2.1 Install Livox_ros_driver2 and Livox-SDK2

2.1.1 Lidar connection

This repo supports two Livox lidar variants:

  • Mid-360 (original): use the MID360 launch files and MID360_config.json.
  • Mid-360s (new variant): use the MID360s launch files and MID360s_config.json. Both the Livox-SDK2 and livox_ros_driver2 in this repo have been extended to support the Mid-360s protocol (new command handler, host net info schema, and dedicated config samples under src/Livox-SDK2/samples/*/mid360s_config.json).

Connect your lidar following the official user manual for your variant: Mid-360 user manual or Mid-360s user manual. You will need a cable like this:

My screenshot

Plug the xt30 end to the 24V xt30 of lite3 and plug the ethernet end to a normal x86 ubuntu system. If you open Livoxviewer2 and see that lidar is connected, this step is successful.

2.1.2 Compiling and installing

First, git clone this repo:

git clone https://github.com/DeepRoboticsLab/fast-livo2-deep-robotics.git
cd fast-livo2-deep-robotics

Compile Livox-SDK2 separately:

cd fast-livo2-deep-robotics/src/Livox-SDK2
mkdir build && cd build
cmake .. && make -j
sudo make install

2.2 Install librealsense and realsense-ros

2.2.1 Install librealsense

Please follow this doc to install intel realsense on your AGX Jetson Orin. It's tested to work in the widest range of cases.

Known issues:

06/11 17:00:12,985 ERROR [281473429722208] (context.cpp:40) No valid configuration file found at : /home/fjwjetson/.realsense-config.json loading defaults
06/11 17:00:13,098 ERROR [281473429722208] (rs.cpp:256) [rs2_create_device( info_list:0xaaab00eb1d90, index:0 ) UNKNOWN] bad optional access
06/11 17:00:13,098 ERROR [281473429722208] (rs.cpp:256) [rs2_delete_device( device:nullptr ) UNKNOWN] null pointer passed for argument "device"
Could not create device - bad optional access . Check SDK logs for details
No device detected. Is it plugged in?

This indicates that the kernel layer has recognized the camera, but the librealsense RSUSB driver lacks permission to access the device node. In simple terms, the permission rules are not being applied correctly. You can try the following command first:

sudo rs-enumerate-devices

If the above command outputs normally, then the root cause is identified: a library version conflict, meaning there are two sets of librealsense in the system:

Path Version Source Status
/usr/local/lib librealsense2.so.2.56.5 Self-compiled (supports RSUSB)
/opt/ros/humble/lib librealsense2.so.2.56.4 Automatically installed by ROS2 (older version)

When launching without sudo, the older library is loaded, preventing the device from being opened.

Library Version Conflict Resolution Method

Force the system to prioritize /usr/local/lib:

echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/99-realsense-local.conf
sudo ldconfig

Then permanently set the environment variable to take effect automatically in all terminals:

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

Verify using the following command:

ldd $(which rs-enumerate-devices) | grep realsense

Successful result:

librealsense2.so.2.56 => /usr/local/lib/librealsense2.so.2.56.5

After this, the launch command should be able to start the depth camera normally.

2.2.2 Install realsense-ros

Please follow this doc to install realsense-ros. For example: sudo apt -y install ros-humble-realsense2-*.

If you can run this ros2 launch realsense2_camera rs_pointcloud_launch.py and see reasonable visualization, this step is successful.

2.3 Build FAST-LIVO2

Install required ROS2 packages:

sudo apt update
sudo apt -y install ros-humble-pcl-ros ros-humble-compressed-image-transport ros-humble-sophus 

Build FAST-LIVO2:

cd fast-livo2-deep-robotics/src/livox_ros_driver2/
source /opt/ros/humble/setup.bash
./build.sh humble

If successful, you should see output indicating completion.

Verify packages:

cd fast-livo2-deep-robotics
source install/setup.bash
ros2 pkg list | grep livo

Expected output should include fast_livo and livox_ros_driver2.

Change the ip in the matching config file to use the ip from step 2.1.1. Fill the host with the actual host ip and the lidar ip with the actual lidar ip.

  • If you are using Mid-360, edit src/livox_ros_driver2/config/MID360_config.json and run:
    ros2 launch livox_ros_driver2 rviz_MID360_launch.py
  • If you are using Mid-360s, edit src/livox_ros_driver2/config/MID360s_config.json and run:
    ros2 launch livox_ros_driver2 rviz_MID360s_launch.py

If you can see lidar points in RViz, this step is successful.

3. Run FAST-LIVO2 through ROS2 bag

You can download the ROS2 dataset from the original FAST-LIVO2 (Retail_Street.bag) here.

Note: The original dataset was recorded using the older livox_ros_driver. Since we are using the newer livox_ros_driver2, you must update the topic type inside the dataset database before playing it. Otherwise, the lidar data will be ignored.

Step 1: Install the sqlite3 tool Open your terminal and install sqlite3 to modify the bag file:

sudo apt update && sudo apt install sqlite3

Step 2: Update the topic type in the dataset Go to the directory where you downloaded the dataset (e.g., data), and run the following command to modify the database:

sqlite3 Retail_Street.db3 "UPDATE topics SET type = 'livox_ros_driver2/msg/CustomMsg' WHERE name = '/livox/lidar';"

Run the algorithm:

cd fast-livo2-deep-robotics
source install/setup.bash
ros2 launch fast_livo mapping_avia.launch.py use_rviz:=True

Go to the place where you download the dataset and open a new terminal:

source install/setup.bash
ros2 bag play Retail_Street.db3  # Use space bar to control play/pause

This should launch the mapping process with RViz visualization.

4. Run FAST-LIVO2 on real Lite3 robot

modify config and recompile on AGX Jetson Orin. then open 3 terminals

# 1 
cd fast-livo2-deep-robotics
source install/setup.bash
# Use msg_MID360_launch.py for Mid-360, or msg_MID360s_launch.py for Mid-360s
ros2 launch livox_ros_driver2 msg_MID360_launch.py
# 2
cd fast-livo2-deep-robotics
source install/setup.bash
ros2 launch realsense2_camera rs_launch.py enable_rgbd:=false enable_sync:=false align_depth.enable:=false enable_color:=true enable_depth:=false
# 3
cd fast-livo2-deep-robotics
source install/setup.bash
ros2 launch fast_livo mapping_avia.launch.py use_rviz:=True

License

This project is licensed under the GNU General Public License v2.0 (GPL-2.0).

This project incorporates or derives from the following open-source projects:

See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors