LIO-SAM with mid360 not run
I have a bag file containing /livox/lidar, /livox/imu information of 360 lidar sensor in ros2 humble. Specifically the bag file contains the following topic information:
/events/read_split
/livox/imu
/livox/lidar
/parameter_events
/rosout
with information of those topic:
ros2 topic info /livox/lidar
Type: sensor_msgs/msg/PointCloud2
Publisher count: 1
Subscription count: 0
ros2 topic info /livox/imu
Type: sensor_msgs/msg/Imu
Publisher count: 1
Subscription count: 0
I want to use LIO-SAM to create a map. i tried edit params.conf:
/**:
ros__parameters:
# Topics
pointCloudTopic: "/livox/lidar" #"/points" # Point cloud data
imuTopic: "/livox/imu" #"/imu/data" # IMU data
odomTopic: "odometry/imu" # IMU pre-preintegration odometry, same frequency as IMU
gpsTopic: "odometry/gpsz" # GPS odometry topic from navsat, see module_navsat.launch file
# Frames
lidarFrame: "lidar_link"
baselinkFrame: "base_link"
odometryFrame: "odom"
mapFrame: "map"
# GPS Settings
useImuHeadingInitialization: false # if using GPS data, set to "true"
useGpsElevation: false # if GPS elevation is bad, set to "false"
gpsCovThreshold: 2.0 # m^2, threshold for using GPS data
poseCovThreshold: 25.0 # m^2, threshold for using GPS data
# Export settings
savePCD: false # https://github.com/TixiaoShan/LIO-SAM/issues/3
savePCDDirectory: "/Downloads/LOAM/" # in your home folder, starts and ends with "/". Warning: the code deletes "LOAM" folder then recreates it. See "mapOptimization" for implementation
# Sensor Settings
sensor: livox #ouster # lidar sensor type, either 'velodyne', 'ouster' or 'livox'
N_SCAN: 64 # number of lidar channels (i.e., Velodyne/Ouster: 16, 32, 64, 128, Livox Horizon: 6)
Horizon_SCAN: 512 # lidar horizontal resolution (Velodyne:1800, Ouster:512,1024,2048, Livox Horizon: 4000)
downsampleRate: 1 # default: 1. Downsample your data if too many
# points. i.e., 16 = 64 / 4, 16 = 16 / 1
lidarMinRange: 1.0 # default: 1.0, minimum lidar range to be used
lidarMaxRange: 1000.0 # default: 1000.0, maximum lidar range to be used
# IMU Settings
imuAccNoise: 3.9939570888238808e-03
imuGyrNoise: 1.5636343949698187e-03
imuAccBiasN: 6.4356659353532566e-05
imuGyrBiasN: 3.5640318696367613e-05
imuGravity: 9.80511
imuRPYWeight: 0.01
extrinsicTrans: [ 0.0, 0.0, 0.0 ]
extrinsicRot: [-1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, -1.0 ]
extrinsicRPY: [ 0.0, 1.0, 0.0,
-1.0, 0.0, 0.0,
0.0, 0.0, 1.0 ]
# LOAM feature threshold
edgeThreshold: 1.0
surfThreshold: 0.1
edgeFeatureMinValidNum: 10
surfFeatureMinValidNum: 100
# voxel filter paprams
odometrySurfLeafSize: 0.4 # default: 0.4 - outdoor, 0.2 - indoor
mappingCornerLeafSize: 0.2 # default: 0.2 - outdoor, 0.1 - indoor
mappingSurfLeafSize: 0.4 # default: 0.4 - outdoor, 0.2 - indoor
# robot motion constraint (in case you are using a 2D robot)
z_tollerance: 1000.0 # meters
rotation_tollerance: 1000.0 # radians
# CPU Params
numberOfCores: 4 # number of cores for mapping optimization
mappingProcessInterval: 0.15 # seconds, regulate mapping frequency
# Surrounding map
surroundingkeyframeAddingDistThreshold: 1.0 # meters, regulate keyframe adding threshold
surroundingkeyframeAddingAngleThreshold: 0.2 # radians, regulate keyframe adding threshold
surroundingKeyframeDensity: 2.0 # meters, downsample surrounding keyframe poses
surroundingKeyframeSearchRadius: 50.0 # meters, within n meters scan-to-map optimization
# (when loop closure disabled)
# Loop closure
loopClosureEnableFlag: true
loopClosureFrequency: 1.0 # Hz, regulate loop closure constraint add frequency
surroundingKeyframeSize: 50 # submap size (when loop closure enabled)
historyKeyframeSearchRadius: 15.0 # meters, key frame that is within n meters from
# current pose will be considerd for loop closure
historyKeyframeSearchTimeDiff: 30.0 # seconds, key frame that is n seconds older will be
# considered for loop closure
historyKeyframeSearchNum: 25 # number of hostory key frames will be fused into a
# submap for loop closure
historyKeyframeFitnessScore: 0.3 # icp threshold, the smaller the better alignment
# Visualization
globalMapVisualizationSearchRadius: 1000.0 # meters, global map visualization radius
globalMapVisualizationPoseDensity: 10.0 # meters, global map visualization keyframe density
globalMapVisualizationLeafSize: 1.0 # meters, global map visualization cloud density
and run those command:
# run bag file
ros2 bag play mid360
# run lio-sam in another terminal
ros2 launch lio_sam run.launch.py
and this log of run.launh.py:
ros2 launch lio_sam run.launch.py
[INFO] [launch]: All log files can be found below /root/.ros/log/2025-07-17-09-48-09-323465-ubuntu-19724
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [static_transform_publisher-1]: process started with pid [19725]
[INFO] [lio_sam_imuPreintegration-2]: process started with pid [19727]
[INFO] [lio_sam_imageProjection-3]: process started with pid [19729]
[INFO] [lio_sam_featureExtraction-4]: process started with pid [19731]
[INFO] [lio_sam_mapOptimization-5]: process started with pid [19733]
[static_transform_publisher-1] [WARN] [1752745689.399090601] []: Old-style arguments are deprecated; see --help for new-style arguments
[static_transform_publisher-1] [INFO] [1752745689.448450878] [static_transform_publisher_82ZhvpfDs9lwPRuJ]: Spinning until stopped - publishing transform
[static_transform_publisher-1] translation: ('0.000000', '0.000000', '0.000000')
[static_transform_publisher-1] rotation: ('0.000000', '0.000000', '0.000000', '1.000000')
[static_transform_publisher-1] from 'map' to 'odom'
[lio_sam_imuPreintegration-2] [WARN] [1752745689.472414666] [rcl.logging_rosout]: Publisher already registered for provided node name. If this is due to multiple nodes with the same name then all logs for that logger name will go out over the existing publisher. As soon as any node with that name is destructed it will unregister the publisher, preventing any further logs for that name from being published on the rosout topic.
[lio_sam_featureExtraction-4] [INFO] [1752745689.475440067] [rclcpp]: ----> Feature Extraction Started.
[lio_sam_imageProjection-3] [INFO] [1752745689.478722386] [rclcpp]: ----> Image Projection Started.
[lio_sam_imuPreintegration-2] [INFO] [1752745689.510940916] [rclcpp]: ----> IMU Preintegration Started.
[lio_sam_mapOptimization-5] [INFO] [1752745689.593248001] [rclcpp]: ----> Map Optimization Started.
[lio_sam_imageProjection-3] [ERROR] [1752745689.729475237] [lio_sam_imageProjection]: Point cloud ring channel not available, please configure your point cloud data!
[lio_sam_imageProjection-3] [WARN] [1752745689.730895350] [lio_sam_imageProjection]: Point cloud timestamp not available, deskew function disabled, system will drift significantly!
[lio_sam_imageProjection-3] [INFO] [1752745689.730945287] [lio_sam_imageProjection]: Waiting for IMU data ...
[INFO] [lio_sam_imageProjection-3]: process has finished cleanly [pid 19729]
but it doesn't work, can anyone help me fix it, pls.
Thanks!
it does't straightly support mid360,although it's livox type lidar, you need to change msgs
try these parameters : /**: ros__parameters: # Topics pointCloudTopic: "/converted_points" # Point cloud data imuTopic: "/livox/imu" # IMU data odomTopic: "odometry/imu" # IMU pre-preintegration odometry, same frequency as IMU gpsTopic: "odometry/gpsz" # GPS odometry topic from navsat, see module_navsat.launch file
# Frames
lidarFrame: "livox_frame"
baselinkFrame: "livox_frame"
odometryFrame: "odom"
mapFrame: "map"
# GPS Settings
useImuHeadingInitialization: false # if using GPS data, set to "true"
useGpsElevation: false # if GPS elevation is bad, set to "false"
gpsCovThreshold: 2.0 # m^2, threshold for using GPS data
poseCovThreshold: 50.0 # m^2, threshold for using GPS data
# Export settings
savePCD: false # https://github.com/TixiaoShan/LIO-SAM/issues/3
savePCDDirectory: "/Downloads/LOAM/" # in your home folder, starts and ends with "/". Warning: the code deletes "LOAM" folder then recreates it. See "mapOptimization" for implementation
# Sensor Settings
sensor: livox # lidar sensor type, 'velodyne' or 'ouster' or 'livox' or 'robosense'
N_SCAN: 6 # number of lidar channel (i.e., Velodyne/Ouster: 16, 32, 64, 128, Livox Horizon: 6)
Horizon_SCAN: 1800 # lidar horizontal resolution (Velodyne:1800, Ouster:512,1024,2048, Livox Horizon: 4000)
downsampleRate: 1 # default: 1. Downsample your data if too many points(line). i.e., 16 = 64 / 4, 16 = 16 / 1
point_filter_num: 1 # default: 3. Downsample your data if too many points(point). e.g., 16: 1, 32: 5, 64: 8
lidarMinRange: 0.2 # default: 1.0, minimum lidar range to be used
lidarMaxRange: 40.0 # default: 1000.0, maximum lidar range to be used
# IMU Settings - FIXED FOR G-UNITS
imuType: 0
imuRate: 200.0
imuAccNoise: 1.4967e-05 # Scaled down by 9.81: 1.4667e-04 / 9.81
imuGyrNoise: 1.3120e-04 # Keep same (already in rad/s)
imuAccBiasN: 2.7226e-06 # Scaled down by 9.81: 2.6700e-05 / 9.81
imuGyrBiasN: 1.8150e-05 # Keep same (already in rad/s)
imuGravity: 1.0 # CRITICAL: Change from 9.80511 to 1.0
imuRPYWeight: 0.01
# Extrinsics: T_lb (lidar -> imu) - Remove the extrinsicRPY line
extrinsicTrans: [0.0, 0.0, 0.0]
extrinsicRot: [1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0]
# REMOVE THIS LINE (only for 9-axis IMU):
# extrinsicRPY: [0.0, -1.0, 0.0,
# 1.0, 0.0, 0.0,
# 0.0, 0.0, 1.0]
# voxel filter paprams
mappingSurfLeafSize: 0.1 # default: 0.4 - outdoor, 0.2 - indoor
# robot motion constraint (in case you are using a 2D robot)
z_tollerance: 1000.0 # meters
rotation_tollerance: 1000.0 # radians
# CPU Params
numberOfCores: 8 # number of cores for mapping optimization
mappingProcessInterval: 0.0 # seconds, regulate mapping frequency
# Surrounding map
surroundingkeyframeAddingDistThreshold: 0.5 # meters, regulate keyframe adding threshold
surroundingkeyframeAddingAngleThreshold: 0.2 # radians, regulate keyframe adding threshold
surroundingKeyframeDensity: 1.0 # meters, downsample surrounding keyframe poses
surroundingKeyframeSearchRadius: 50.0 # meters, within n meters scan-to-map optimization (when loop closure disabled)
surroundingKeyframeMapLeafSize: 0.1 # downsample local map point cloud
# Loop closure
loopClosureEnableFlag: true
loopClosureFrequency: 2.0 # Hz, regulate loop closure constraint add frequency
surroundingKeyframeSize: 30 # submap size (when loop closure enabled)
historyKeyframeSearchRadius: 10.0 # meters, key frame that is within n meters from current pose will be considerd for loop closure
historyKeyframeSearchTimeDiff: 20.0 # seconds, key frame that is n seconds older will be considered for loop closure
historyKeyframeSearchNum: 15 # number of hostory key frames will be fused into a submap for loop closure
loopClosureICPSurfLeafSize: 0.2 # downsample icp point cloud
historyKeyframeFitnessScore: 0.2 # icp threshold, the smaller the better alignment
# Visualization
globalMapVisualizationSearchRadius: 1000.0 # meters, global map visualization radius
globalMapVisualizationPoseDensity: 1.0 # meters, global map visualization keyframe density
globalMapVisualizationLeafSize: 0.2 # meters, global map visualization cloud density