Skip to content

Add LIO-SAM as an odometry strategy#1684

Open
abhi2198 wants to merge 4 commits intointrolab:masterfrom
abhi2198:master
Open

Add LIO-SAM as an odometry strategy#1684
abhi2198 wants to merge 4 commits intointrolab:masterfrom
abhi2198:master

Conversation

@abhi2198
Copy link
Copy Markdown

@abhi2198 abhi2198 commented Apr 6, 2026

Summary:

  1. Add LIO-SAM as a new odometry strategy (Odom/Strategy 14) that uses the [lio_sam_core](https://github.com/abhi2198/liosam_nodelets) library for lidar-inertial odometry, with loop closure disabled (deferred to rtabmap)
  2. Introduce kXYZIRT LaserScan format (x,y,z,intensity,ring,time) so per-point ring and time fields survive the scan pipeline end-to-end
  3. Extend deskewing to support kXYZIRT, preserving ring data through the correction

Details

Build system (CMakeLists.txt, Version.h.in, corelib/src/CMakeLists.txt)

  • WITH_LIOSAM option gated behind find_package(lio_sam)
  • Links lio_sam_core library; defines RTABMAP_LIOSAM when found
  • Status message at configure time

New odometry backend

  • OdometryLIOSAM.h / OdometryLIOSAM.cpp — wraps lio_sam::LioSamCore
  • Accepts async IMU via canProcessAsyncIMU(), feeds addImu() on
    every IMU sample
  • Requires kXYZIRT scans; splits them into the three parallel buffers
    (PointXYZI + ring vector + time vector) that LIO-SAM expects
  • Force-disables base-class deskewing since LIO-SAM handles it internally
  • Returns incremental transform in base frame, with configurable
    linear/angular output variance
  • Exposes LIO-SAM parameters (OdomLIOSAM/*) for sensor type, scan
    geometry, IMU noise, and feature thresholds

Registration in odometry factory

  • Odometry.h: kTypeLIOSAM = 14
  • Odometry.cpp: factory create() case
  • Parameters.h / Parameters.cpp: strategy description updated,
    OdomLIOSAM/* params declared, --info output added

New scan format kXYZIRT

  • LaserScan.h / LaserScan.cpp: enum value 12, 6-channel, with
    hasRing() / getRingOffset() / isScanHasRing() accessors;
    getTimeOffset() corrected for per-format channel layout; validation
    assertions updated
  • util3d.h: PointXYZIRT PCL struct + POINT_CLOUD_REGISTER_POINT_STRUCT
  • util3d.cpp: laserScanFromPointCloud(PointXYZIRT) overloads,
    laserScanToPointCloud2 routing for kXYZIRT

Deskewing

  • deskew() format check relaxed from == kXYZIT to hasTime()
  • Ring channel preserved through deskew when present; time zeroed
    post-correction
  • Existing kXYZIT path unchanged

…ration

Introduce PointXYZIRT point type and kXYZIRT LaserScan format (x,y,z,
intensity,ring,time) so that ring indices survive the scan pipeline.
Update OdometryLIOSAM to require kXYZIRT and properly split ring/time
into the parallel buffers LIO-SAM expects. Extend deskewing to preserve
ring data and disable base-class deskew in OdometryLIOSAM since LIO-SAM
handles it internally.
@matlabbe
Copy link
Copy Markdown
Member

matlabbe commented Apr 6, 2026

Thank you for this PR! Overall it looks good! I've already put some comments. I'll be pretty busy this week on a field test trip but I can make the suggested changes next weekend/week if you don't have time to do it this week.

abhi2198 and others added 2 commits April 8, 2026 23:29
- Add OdomLIOSAM/ConfigPath parameter to load LIO-SAM settings from a
  YAML file. When set, individual params are ignored. Extrinsics from
  sensor local transforms always override config file values.
- Defer LioSamCore initialization until both IMU and lidar local
  transforms are available, computing T_lidar_imu from sensor data.
  IMU samples are buffered and replayed after init.
- Fix deferred init for scan-only messages that arrive after IMU
  local transform is already cached.
- Add LIO-SAM entry to odometry strategy combo box (index 14) with
  full PreferencesDialog panel including config path browse button
  and all parameter widgets.
@abhi2198
Copy link
Copy Markdown
Author

abhi2198 commented Apr 9, 2026

@matlabbe I have addressed all the PR comments. I have updated the Lio_sam fork with a paramserver as well. Let me know if I missed anything. Liosam refactored repo - https://github.com/abhi2198/liosam_library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants