Skip to content

Clean up: remove old mrpt version fallback code sections - #121

Merged
jlblancoc merged 2 commits into
developfrom
fix/clean-up-old-mrpt-version-checks
Apr 4, 2026
Merged

Clean up: remove old mrpt version fallback code sections#121
jlblancoc merged 2 commits into
developfrom
fix/clean-up-old-mrpt-version-checks

Conversation

@jlblancoc

@jlblancoc jlblancoc commented Apr 4, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • Chores

    • Standardized point-cloud handling and removed version-dependent code paths for more consistent lidar loading and timestamp/ring field management.
    • Cleaned up includes, whitespace, and legacy fallbacks for consistency.
  • Bug Fixes

    • Fixed Livox timestamp handling so per-point times are read and scaled consistently.

@jlblancoc
jlblancoc enabled auto-merge April 4, 2026 06:04
@coderabbitai

coderabbitai Bot commented Apr 4, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a91c3a01-973c-470f-af82-c921e94dc289

📥 Commits

Reviewing files that changed from the base of the PR and between 6a182b9 and 092f9e5.

📒 Files selected for processing (9)
  • mola_bridge_ros2/src/BridgeROS2.cpp
  • mola_input_kitti360_dataset/src/Kitti360Dataset.cpp
  • mola_input_mulran_dataset/src/MulranDataset.cpp
  • mola_input_paris_luco_dataset/src/ParisLucoDataset.cpp
  • mola_input_rawlog/include/mola_input_rawlog/RawlogDataset.h
  • mola_input_rosbag2/src/Rosbag2Dataset.cpp
  • mola_kernel/CMakeLists.txt
  • mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h
  • mola_metric_maps/src/KeyframePointCloudMap.cpp
💤 Files with no reviewable changes (2)
  • mola_input_kitti360_dataset/src/Kitti360Dataset.cpp
  • mola_input_rosbag2/src/Rosbag2Dataset.cpp
✅ Files skipped from review due to trivial changes (4)
  • mola_bridge_ros2/src/BridgeROS2.cpp
  • mola_kernel/CMakeLists.txt
  • mola_metric_maps/src/KeyframePointCloudMap.cpp
  • mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h
🚧 Files skipped from review as they are similar to previous changes (3)
  • mola_input_rawlog/include/mola_input_rawlog/RawlogDataset.h
  • mola_input_mulran_dataset/src/MulranDataset.cpp
  • mola_input_paris_luco_dataset/src/ParisLucoDataset.cpp

📝 Walkthrough

Walkthrough

Removed MRPT-version conditional compilation across dataset, rosbag2, and map modules: standardized on CGenericPointsMap and unified point-field buffer access patterns; a few include lines received inline comments and a CMake MRPT minimum version was raised.

Changes

Cohort / File(s) Summary
Kitti360 Dataset
mola_input_kitti360_dataset/src/Kitti360Dataset.cpp
Deleted MRPT-version conditional in load_lidar(); always use insertPointFrom(i, ctx) path when generating per-point timestamps.
Mulran Dataset
mola_input_mulran_dataset/src/MulranDataset.cpp
Removed MRPT-version branches; always use mrpt::maps::CGenericPointsMap, register timestamp/ring fields, resize(nPts), and populate Ts/Rs via float/uint16 field buffers.
Paris Luco Dataset
mola_input_paris_luco_dataset/src/ParisLucoDataset.cpp
Eliminated MRPT-version-specific map types; always build CGenericPointsMap, register timestamp/ring fields, and read buffers via generic field accessors before unchanged downstream logic.
Rosbag2 / Bridge ROS2
mola_input_rosbag2/src/Rosbag2Dataset.cpp, mola_bridge_ros2/src/BridgeROS2.cpp
Unified timestamp retrieval to use getPointsBufferRef_float_field(POINT_FIELD_TIMESTAMP) (removed MRPT_VERSION branches). BridgeROS2.cpp include comment added only.
Rawlog & Kernel Headers
mola_input_rawlog/include/mola_input_rawlog/RawlogDataset.h, mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h
Small edits: added inline comment on #include <mrpt/version.h> in two headers and minor whitespace adjustment; existing MRPT-version-controlled members unchanged.
Metric Maps Include
mola_metric_maps/src/KeyframePointCloudMap.cpp
Added inline comment to #include <mrpt/version.h> only.
Build
mola_kernel/CMakeLists.txt
Bumped MRPT required version from 2.1.0 to 2.15.0 in find_package.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Poem

🐰 I hopped through headers, lines aligned,
Version forks folded, tidy and kind.
Points find timestamps, rings take their place,
A nimble hop — one tidy trace.
🍃

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the changeset: systematically removing version-specific fallback code and upgrading MRPT dependency from 2.1.0 to 2.15.0.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clean-up-old-mrpt-version-checks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mola_input_mulran_dataset/src/MulranDataset.cpp`:
- Around line 271-274: The CI failure is due to clang-format complaining about
the multi-line call to lstPointCloudFiles_.erase(std::next(...)) in
MulranDataset.cpp; fix it by reformatting that expression (either collapsing the
call to a single line or adjusting line breaks to match the project's
clang-format rules) and then run clang-format --style=file -i
mola_input_mulran_dataset/src/MulranDataset.cpp to apply the canonical
formatting; ensure the call still uses std::next(lstPointCloudFiles_.begin(),
static_cast<std::vector<std::string>::difference_type>(idx)) and preserves
behavior.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 41e263e4-275e-41ab-8bad-fbb7ba7257c4

📥 Commits

Reviewing files that changed from the base of the PR and between 0163f73 and 5773885.

📒 Files selected for processing (8)
  • mola_bridge_ros2/src/BridgeROS2.cpp
  • mola_input_kitti360_dataset/src/Kitti360Dataset.cpp
  • mola_input_mulran_dataset/src/MulranDataset.cpp
  • mola_input_paris_luco_dataset/src/ParisLucoDataset.cpp
  • mola_input_rawlog/include/mola_input_rawlog/RawlogDataset.h
  • mola_input_rosbag2/src/Rosbag2Dataset.cpp
  • mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h
  • mola_metric_maps/src/KeyframePointCloudMap.cpp
💤 Files with no reviewable changes (1)
  • mola_input_kitti360_dataset/src/Kitti360Dataset.cpp

Comment thread mola_input_mulran_dataset/src/MulranDataset.cpp Outdated
@jlblancoc
jlblancoc force-pushed the fix/clean-up-old-mrpt-version-checks branch from 5773885 to 6e361dc Compare April 4, 2026 19:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h (1)

30-113: ⚠️ Potential issue | 🔴 Critical

Add missing #endif directive to close the preprocessor conditional guard.

Line 30 opens #if MRPT_VERSION >= 0x020f07 but the header has no matching #endif. This is a compilation blocker.

Proposed fix
 }  // namespace mola
+
+#endif  // MRPT_VERSION >= 0x020f07
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h` around lines
30 - 113, The header opens a preprocessor conditional with "#if MRPT_VERSION >=
0x020f07" but never closes it, causing compilation errors; fix by adding the
matching "#endif" at the end of the file (after the closing brace of namespace
mola and before EOF) to close the conditional that guards the RawDataSourceBase
declaration and related includes, ensuring the MRPT_VERSION macro condition
properly wraps the includes, class RawDataSourceBase, and associated
declarations.
♻️ Duplicate comments (1)
mola_input_mulran_dataset/src/MulranDataset.cpp (1)

271-274: ⚠️ Potential issue | 🟡 Minor

CI clang-format failure persists—run formatter to fix.

The pipeline reports a clang-format error around line 268. Although a previous fix was attempted, the CI is still failing.

clang-format --style=file -i mola_input_mulran_dataset/src/MulranDataset.cpp
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mola_input_mulran_dataset/src/MulranDataset.cpp` around lines 271 - 274, Run
the project clang formatter on MulranDataset.cpp to fix the remaining style
issues around the erase call; locate the use of
lstPointCloudFiles_.erase(std::next(lstPointCloudFiles_.begin(),
static_cast<std::vector<std::string>::difference_type>(idx))) and reformat the
file (e.g., run clang-format --style=file -i
mola_input_mulran_dataset/src/MulranDataset.cpp) so the expression spacing/line
breaks conform to the repository clang-format rules.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h`:
- Around line 30-113: The header opens a preprocessor conditional with "#if
MRPT_VERSION >= 0x020f07" but never closes it, causing compilation errors; fix
by adding the matching "#endif" at the end of the file (after the closing brace
of namespace mola and before EOF) to close the conditional that guards the
RawDataSourceBase declaration and related includes, ensuring the MRPT_VERSION
macro condition properly wraps the includes, class RawDataSourceBase, and
associated declarations.

---

Duplicate comments:
In `@mola_input_mulran_dataset/src/MulranDataset.cpp`:
- Around line 271-274: Run the project clang formatter on MulranDataset.cpp to
fix the remaining style issues around the erase call; locate the use of
lstPointCloudFiles_.erase(std::next(lstPointCloudFiles_.begin(),
static_cast<std::vector<std::string>::difference_type>(idx))) and reformat the
file (e.g., run clang-format --style=file -i
mola_input_mulran_dataset/src/MulranDataset.cpp) so the expression spacing/line
breaks conform to the repository clang-format rules.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: ab05d5c9-0cc0-45f8-8894-6ace9a3766da

📥 Commits

Reviewing files that changed from the base of the PR and between 5773885 and 6e361dc.

📒 Files selected for processing (8)
  • mola_bridge_ros2/src/BridgeROS2.cpp
  • mola_input_kitti360_dataset/src/Kitti360Dataset.cpp
  • mola_input_mulran_dataset/src/MulranDataset.cpp
  • mola_input_paris_luco_dataset/src/ParisLucoDataset.cpp
  • mola_input_rawlog/include/mola_input_rawlog/RawlogDataset.h
  • mola_input_rosbag2/src/Rosbag2Dataset.cpp
  • mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h
  • mola_metric_maps/src/KeyframePointCloudMap.cpp
💤 Files with no reviewable changes (1)
  • mola_input_kitti360_dataset/src/Kitti360Dataset.cpp
✅ Files skipped from review due to trivial changes (2)
  • mola_metric_maps/src/KeyframePointCloudMap.cpp
  • mola_bridge_ros2/src/BridgeROS2.cpp
🚧 Files skipped from review as they are similar to previous changes (3)
  • mola_input_rawlog/include/mola_input_rawlog/RawlogDataset.h
  • mola_input_paris_luco_dataset/src/ParisLucoDataset.cpp
  • mola_input_rosbag2/src/Rosbag2Dataset.cpp

@jlblancoc
jlblancoc force-pushed the fix/clean-up-old-mrpt-version-checks branch from 6e361dc to 6a182b9 Compare April 4, 2026 19:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@mola_input_mulran_dataset/src/MulranDataset.cpp`:
- Line 30: The code now uses mrpt::maps::CGenericPointsMap and calls
loadFromKittiVelodyneFile(), which require MRPT >= 2.15.0; update the project's
minimum MRPT version to at least 2.15.0 in the global CMake configuration (the
declared minimum in your CMakeLists) and add an explicit version check in the
input-mulran dataset CMakeLists to enforce find_package(MRPT REQUIRED COMPONENTS
maps VERSION 2.15.0 OR_GREATER) (or the equivalent version check) so builds with
older MRPT (e.g., 2.1.0) fail early rather than causing compile errors when
using CGenericPointsMap/loadFromKittiVelodyneFile.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5f68cf70-1b4b-43cd-85d0-96e15e7438f6

📥 Commits

Reviewing files that changed from the base of the PR and between 6e361dc and 6a182b9.

📒 Files selected for processing (8)
  • mola_bridge_ros2/src/BridgeROS2.cpp
  • mola_input_kitti360_dataset/src/Kitti360Dataset.cpp
  • mola_input_mulran_dataset/src/MulranDataset.cpp
  • mola_input_paris_luco_dataset/src/ParisLucoDataset.cpp
  • mola_input_rawlog/include/mola_input_rawlog/RawlogDataset.h
  • mola_input_rosbag2/src/Rosbag2Dataset.cpp
  • mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h
  • mola_metric_maps/src/KeyframePointCloudMap.cpp
💤 Files with no reviewable changes (2)
  • mola_input_kitti360_dataset/src/Kitti360Dataset.cpp
  • mola_input_rosbag2/src/Rosbag2Dataset.cpp
✅ Files skipped from review due to trivial changes (4)
  • mola_bridge_ros2/src/BridgeROS2.cpp
  • mola_metric_maps/src/KeyframePointCloudMap.cpp
  • mola_kernel/include/mola_kernel/interfaces/RawDataSourceBase.h
  • mola_input_paris_luco_dataset/src/ParisLucoDataset.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • mola_input_rawlog/include/mola_input_rawlog/RawlogDataset.h

Comment thread mola_input_mulran_dataset/src/MulranDataset.cpp
@jlblancoc
jlblancoc force-pushed the fix/clean-up-old-mrpt-version-checks branch from 6a182b9 to 092f9e5 Compare April 4, 2026 20:46
@jlblancoc
jlblancoc merged commit 8851477 into develop Apr 4, 2026
10 checks passed
@jlblancoc
jlblancoc deleted the fix/clean-up-old-mrpt-version-checks branch April 4, 2026 20:54
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