Repository navigation
fix: ROSBag detects the ROS release by default (release="auto") - #164
Merged
Merged
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 11 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
ROSBag defaulted to release="ROS1_NOETIC", while bagtool's --release already defaulted to "auto". The Noetic default could not read ROS 2 (CDR) messages: on a rosbag2 directory ROSBag(path) raised a SerdeError, and a bag whose messages the Noetic definitions do not match read nothing. "auto" tries the known releases on the first message and keeps the first that decodes it, for ROS 1 and for CDR messages; the choice is then available as the `release` attribute. - The default is "auto". Naming a release still works and skips detection. - The "auto-detect: ..." line it printed when it succeeded is now shown only with verbose=True, since it would otherwise be printed for every bag. The "FAILED ... no matching typestore found" message is still always printed. - The docstring now explains what `release` selects and how "auto" works. Adds tests/test_ros_release_auto.py (8 tests, 6 fail on the old default): the default, the same images as the right explicit release for the ROS 1 bag and the ROS 2 bag directory, the detected release being reported, and quiet unless verbose. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
petercorke
force-pushed
the
fix/rosbag-default-release-auto
branch
from
October 22, 2026 02:36
a8bd0db to
bcd5a30
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ROSBagdefaulted torelease="ROS1_NOETIC", whilebagtool --releasealready defaulted to"auto". The Noetic default cannot read ROS 2 (CDR) messages, so a ROS 2 bag read with the default arguments failed."auto"tries the known releases on the first message and keeps the first that decodes it, for ROS 1 and for CDR messages.release="auto". Naming a release still works and skips detection.auto-detect: ...line printed on success is now shown only withverbose=True, since a default that guesses would otherwise print it for every bag. The "FAILED ... no matching typestore found" message is still always printed.releaseselects (the ROS distribution whose message definitions are used) and how"auto"works.Evidence
On a real ROS 2 recording (rosbag2 directory, MCAP storage, CDR; the example attached to lucasw/ros_one2z#6),
ROSBag(path):main, defaultROS1_NOETICSerdeError: Invalid string length 7364973autoOn every other bag tested (the committed ROS 1 and ROS 2 fixtures, and 13 real bags) the default and an explicit release give identical pixels.
Tests
New
tests/test_ros_release_auto.py(9 tests; 6 of the 8 portable ones fail onmain): the default, the same images as the right explicit release for the ROS 1 bag and the ROS 2 bag directory, the detected release being reported, quiet unless verbose, and a real ROS 2 MCAP bag when it is available locally (skipped otherwise).pytest tests: 1048 passed, 44 skipped.Related
This touches lines in
Sources.pythat #163 also edits (theauto-detectprint statements), so whichever merges second needs a small rebase.Checklist
pytest)🤖 Generated with Claude Code