Use ZStd compression by default (for MRPT>=2.15.7)#37
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis PR introduces MRPT version-gated compression support across the codebase, enabling newer CCompressedInputStream/CCompressedOutputStream APIs (MRPT >= 0x020f07) while maintaining backward compatibility with legacy CFileGZInputStream/CFileGZOutputStream. Command-line applications gain error handling for save operations and timing instrumentation for map loading. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
6052835 to
a7d8550
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
mp2p_icp/src/LogRecord.cpp (1)
149-153:⚠️ Potential issue | 🟡 MinorCopy-paste error in error message.
The error message incorrectly references
save_to_filewhen this is theload_from_filefunction.Proposed fix
catch (const std::exception& e) { - std::cerr << "[LogRecord::save_to_file] Error: " << e.what(); + std::cerr << "[LogRecord::load_from_file] Error: " << e.what(); return false; }
🤖 Fix all issues with AI agents
In `@apps/sm2mm/main.cpp`:
- Around line 74-85: The CLI help/default for arg_compression_method uses scoped
enum names like "CompressionType::Zstd" but
TEnumType<CompressionType>::name2value() expects unscoped names (e.g., "Zstd"),
causing parse failures; update the TCLAP::ValueArg<std::string>
arg_compression_method to use unscoped names in both the help/options list and
the default (e.g., "Zstd", "Gzip", "None") or alternatively normalize the input
before parsing by stripping any "CompressionType::" prefix when resolving via
TEnumType<CompressionType>::name2value(); adjust the help text to list the
unscoped enum identifiers to match the parser.
🧹 Nitpick comments (2)
mp2p_icp_map/src/metricmap.cpp (1)
630-642: Consider catching serialization exceptions to honor the bool contract.
save_to_file()now returns a bool that callers check; uncaught exceptions will still abort the caller. Align withLogRecord::save_to_file()by returningfalseon exceptions.Suggested change (guard serialization and return false on errors)
bool metric_map_t::save_to_file( `#if` MRPT_VERSION >= 0x020f07 const std::string& fileName, const mrpt::io::CompressionOptions& co `#else` const std::string& fileName `#endif` ) const { `#if` MRPT_VERSION >= 0x020f07 auto f = mrpt::io::CCompressedOutputStream(fileName, mrpt::io::OpenMode::TRUNCATE, co); `#else` auto f = mrpt::io::CFileGZOutputStream(fileName); `#endif` if (!f.is_open()) { return false; } - auto arch = mrpt::serialization::archiveFrom(f); - arch << *this; + try + { + auto arch = mrpt::serialization::archiveFrom(f); + arch << *this; + } + catch (const std::exception& e) + { + std::cerr << "[metric_map_t::save_to_file] Error: " << e.what(); + return false; + } return true; }apps/sm2mm/main.cpp (1)
137-145: Avoid relying on transitive includes formrpt::Clock.
Please verify that a direct header providesmrpt::Clock::nowDouble(); if not, include the appropriate MRPT header explicitly to keep this compile‑safe.
Summary by CodeRabbit
Release Notes
Bug Fixes
New Features
Chores