fix(bag): use decode_headerless instead of decode_ros1 for BAG messages #27
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
Fixes #26 - BAG decoder was failing to handle
kuavo_msgs/sensorsDatamessages with error:Root Cause
The BAG parser's
read_recordfunction extracts just the CDR-encoded message data from BAG records, without any wrapper headers. However,decode_ros1was designed to expect a 16-byte header (12-byte ROS record header + 4-byte CDR header) and skips those bytes.When
decode_ros1skips 16 bytes of actual message data, it causes misalignment during decoding. This leads to corrupted values being read as array lengths (e.g., 656114711 instead of a valid array size).Fix
Changed
BagDecodedMessageStream::next()to usedecode_headerless()instead ofdecode_ros1(). Thedecode_headerless()method processes the message data from byte 0 without skipping any header bytes, which is correct for the data format returned by the BAG parser.Test Plan
cargo test)make check)