This repository provides a comprehensive setup for mapping reconstruction using the Livox MID360 LiDAR sensor. It includes Dockerized environments for easy deployment and tools for data recording, visualization, and processing.
Ensure the following requirements are met before proceeding:
- Ubuntu: Version 20.04 or higher
- Docker: Recommended Video Installation Guide
- Static IP Address of Host PC: E.g.,
192.168.1.10 - Static IP Address of Livox MID360: E.g.,
192.168.1.100
-
Clone the Repository
# Create directory for Livox MID360 mkdir livox_mid_360 cd livox_mid_360 # Clone the repository into the directory git clone git@github.com:djetshu/LivoxMid360-3DScanEnv.git
-
Build the Docker Image
cd LivoxMid360-3DScanEnv # Build the Docker image ./docker/build.sh
Note: The build step is a one-time process. For subsequent runs, proceed directly to the next step.
-
Run the Docker Container
# Enable permissions for graphics/video # (Optional: Already in run_docker.sh) xhost +local:root # Start the Docker container ./docker/run_docker.sh
Before running, ensure all configurations are properly set (refer to Set Up and Configuration).
- Navigate to the workspace:
cd /livox_mid_360/livox_mid_360_ws - Compile the ros workspace:
colcon build
- Source the workspace:
source install/setup.bash
Depending on your use case, you can launch different setups as described below:
To perform mapping using FastLIO integrated with the Livox MID360 in Real Time:
- Execute the following command:
ros2 launch fast_lio mapping_MID360.launch.py
If you only need to run the FastLIO mapping (wih rosbags recordings):
- Launch the following command:
ros2 launch fast_lio mapping.launch.py
If you only need to run the Livox MID360 ROS driver for data visualization or testing (To corroborate communication of Lidar and PC):
- Launch the required nodes:
# To show Data in Rviz2 ros2 launch livox_ros_driver2 rviz_MID360_launch.py # To get data in Livox custom message ros2 launch livox_ros_driver2 msg_MID360_launch.py
To save LiDAR and IMU data in a ROS bag for later analysis or processing:
- Use the following command, specifying a name for the output bag file:
# Source before recording topics source install/setup.bash # Record only /livox/imu and /livox/lidar topics ros2 bag record /livox/imu /livox/lidar -o /livox_mid_360/livox_mid_360_ws/src/rosbag/<name_of_bag>
To play rosbags recording:
- Use the following command, specifying a name for the rosbag file:
# Source before playing topics source install/setup.bash # Play reosbag with only /livox/imu and /livox/lidar topics ros2 bag play /livox_mid_360/livox_mid_360_ws/src/rosbag/<name_of_bag>
Modify the MID360_config.json file located at livox_mid_360/src/livox_ros_driver2/config to set up the IP addresses for the host PC and the Livox MID360.
Example configuration:
{
"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.10", # host ip (it can be revised)
"cmd_data_port": 56101,
"push_msg_ip": "192.168.1.10", # host ip (it can be revised)
"push_msg_port": 56201,
"point_data_ip": "192.168.1.10", # host ip (it can be revised)
"point_data_port": 56301,
"imu_data_ip": "192.168.1.10", # host ip (it can be revised)
"imu_data_port": 56401,
"log_data_ip": "",
"log_data_port": 56501
}
},
"lidar_configs": [
{
"ip": "192.168.1.100", # ip of the LiDAR you want to config
"pcl_data_type": 1,
"pattern_mode": 0,
"extrinsic_parameter": {
"roll": 0.0,
"pitch": 0.0,
"yaw": 0.0,
"x": 0,
"y": 0,
"z": 0
}
}
]
} - Update the placeholder IP addresses (
192.168.1.5and192.168.1.12) with the actual static IP addresses of your host PC and Livox MID360.
Modify the mid360.yaml file located at livox_mid_360/src/FAST_LIO/config to set up pcd_save:pcd_save_en to true or false for saving FastLIO output frames or not. The .pcd file will be stored at livox_mid_360/src/FAST_LIO/PCD/.
pcd_save:
pcd_save_en: false # True -> .pcd file will be store at 'livox_mid_360/src/FAST_LIO/PCD/'
interval: -1 # how many LiDAR frames saved in each pcd file;
# -1 : all frames will be saved in ONE pcd file, may lead to memory crash when having too much frames. - If this option is enabled ensure you have enough memory space.
- It is recommended to view this file on a high-performance PC to avoid lags.
To visualize the .pcd file, use the following command:
pcl_viewer src/FAST_LIO/PCD/<name_of_pcd_file.pcd>Tips for pcl_viewer:
- Change what to visualize/color by pressing keyboard 1,2,3,4,5 when pcl_viewer is running.
1 is all random
2 is X values
3 is Y values
4 is Z values
5 is intensity
To convert the .pcd file into a .ply file, use the following command:
pcl_pcd2ply src/FAST_LIO/PCD/<name_of_pcd_file.pcd> src/FAST_LIO/PCD/<name_of_ply_file.pcd> -format 0 # 0 = ASCII, 1 = BinaryThis repository contains the following packages: