I’m working on extending LidarView to integrate live external odometry data from my robot into the SLAM (Online) pipeline.
The goal is to let the SLAM algorithm fuse both LiDAR point cloud and odometry information for improved mapping accuracy and trajectory stability.
What I’m trying to achieve
I have a custom LiDAR plugin that publishes PointCloud2 data in real time.
Separately, I also have odometry data (from wheel encoders) available as ROS 2 messages.
I would like the SLAM (Online) module in LidarView to use this odometry as a motion prior / initial pose estimate during scan matching — effectively improving SLAM convergence and reducing drift.
What I have implemented
I’ve created a custom class derived from vtkPacketInterpreter that handles LiDAR data and also initializes a ROS 2 node.
Inside this interpreter, I’ve implemented a function:
”void vtkCustomPacketInterpreter::SetManualSlamConnect(bool enable);”
This function sets up the communication between my odometry publisher and the SLAM pipeline.
Now, I would like this function to be called automatically when the user selects “SLAM (Online)” from the LidarView GUI.
I found the corresponding XML proxy definition:
and I’m considering either:
-
Calling
SetManualSlamConnect()inside thevtkSlamconstructor, or -
Adding this to the XML:
-
so that the method is triggered when the SLAM filter is instantiated.
My questions
-
What is the recommended way to trigger a function (like
SetManualSlamConnect()) when a filter such as SLAM (Online) is created or selected from the GUI?
Should this be done via XML hints, directly in thevtkSlamconstructor, or through a manager class likepqLidarSlamManager? -
If my external ROS 2 odometry data is successfully connected,
will the SLAM (Online) module actually consume and use odometry as an additional input (e.g., as an initial guess for registration)?
Or is the current implementation designed to rely solely on LiDAR-based pose estimation? -
Are there any additional parameters or configuration options (in the SLAM
.xmlor.jsonfiles) that must be enabled for SLAM to accept external odometry?
-
Expected outcome
Once integrated, I expect the SLAM trajectory in LidarView to become smoother and more stable, particularly during slow rotations or when re-localizing after loop closure, since odometry will provide a reliable motion prior alongside the point cloud data.
Environment
-
LidarView built from source (Superbuild)
-
Custom plugin derived from
vtkPacketInterpreter -
ROS 2 Humble
-
External odometry published as
nav_msgs/Odometry