Conversation
There was a problem hiding this comment.
Pull request overview
Adds dedicated ROS2 topics to publish the estimated IMU pose/odometry at the end of a LiDAR scan, in addition to the existing per-frame pose/odom publications, to improve RViz visualization and downstream consumers that need scan-end timing.
Changes:
- Add new publishers for scan-end odometry/pose, with both uncorrected and corrected variants.
- Compute scan-end relative motion from
imu_rate_trajectoryand publish/odom_scanend*and/pose_scanend*messages using the scan-end timestamp.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
src/glim_ros/rviz_viewer.cpp |
Adds scan-end time/transform computation and publishes new scan-end odom/pose topics. |
include/glim_ros/rviz_viewer.hpp |
Declares the new scan-end publishers (regular + corrected). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (std::abs(imu_end_time - new_frame->stamp) < 1e-3) { | ||
| logger->warn("Scan end time is too close to the frame time (imu_end_time={}, frame_time={})", imu_end_time, new_frame->stamp); |
There was a problem hiding this comment.
The scan-end warning condition looks backwards/noisy: std::abs(imu_end_time - new_frame->stamp) < 1e-3 will be true whenever imu_rate_trajectory is empty (or has a single sample), causing a WARN every frame while still publishing a scan-end pose identical to the frame pose. Consider warning only when imu_rate_trajectory is missing (or when the time delta is unexpectedly large), and/or downgrade to DEBUG/throttle so normal operation doesn’t spam logs.
| if (std::abs(imu_end_time - new_frame->stamp) < 1e-3) { | |
| logger->warn("Scan end time is too close to the frame time (imu_end_time={}, frame_time={})", imu_end_time, new_frame->stamp); | |
| if (std::abs(imu_end_time - new_frame->stamp) > 1e-3) { | |
| logger->warn("Scan end time differs significantly from the frame time (imu_end_time={}, frame_time={})", imu_end_time, new_frame->stamp); |
| if (std::abs(imu_end_time - new_frame->stamp) < 1e-3) { | ||
| logger->warn("Scan end time is too close to the frame time (imu_end_time={}, frame_time={})", imu_end_time, new_frame->stamp); |
There was a problem hiding this comment.
std::abs is used here for doubles, but this file doesn’t include <cmath>. Relying on transitive includes can break builds depending on compiler/standard library; please include <cmath> explicitly (or switch to std::fabs).
|
|
||
| odom_scan_end_pub->publish(odom); | ||
|
|
||
| logger->debug("published odom (stamp={})", new_frame->stamp); |
There was a problem hiding this comment.
The debug log after publishing scan-end odometry logs new_frame->stamp and uses the same message as the regular odom publisher. This is misleading because the published message is timestamped with imu_end_stamp; consider logging imu_end_time (and differentiating it as scan-end odom) so users can diagnose timing correctly.
| logger->debug("published odom (stamp={})", new_frame->stamp); | |
| logger->debug("published scan-end odom (imu_end_time={}, stamp={})", imu_end_time, imu_end_stamp); |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.