Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RosBag odd padding parsing error fix #23

Merged
merged 5 commits into from
Sep 16, 2021

Conversation

brendangeck
Copy link
Contributor

@brendangeck brendangeck commented Sep 16, 2021

Description of Changes

Currently, we naively iterate through the bagfile records, parsing them one-by-one, assuming the next record always ends flush to the previous record. In some very rare cases, a bagfile will contain junk/padding between the end of the CHUNK and INDEX sections of the bag, breaking the previously stated assumption.

This PR modifies how we parse bags, using a more informed models, where we seek to specific locations in the file that we are certain contain specific record types. This is the same core algorithm as what is used in the official rospy project: https://github.com/ros/ros_comm/blob/noetic-devel/tools/rosbag/src/rosbag/bag.py#L2638-L2668

Meanwhile, I also added gdb to the Dockerfile to easier make use of the --compilation_mode dbg when performing a bazel build.

@liambenson
Copy link
Contributor

Awesome stuff! Would be interested to know how this affects performance at all. Also, I'm not what you would call a good C++ developer, so would like to get some insight on the code from @jaredjxyz or @zig-for. Will look over the general concept though!

Copy link

@jaredjxyz jaredjxyz left a comment

Choose a reason for hiding this comment

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

In general I see no issue here, code is pretty clean and good comments, not too hard to follow along with what rospy does, thanks.

I would really like to see a well thought out testing plan - Can you make sure to test this pretty extensively to ensure it works in all places we're using embag? It could be a pretty big issue if there's a bug in here.

@brendangeck brendangeck merged commit 77bd63c into master Sep 16, 2021
@brendangeck brendangeck deleted the brendangeck/rosbag_parsing_fixes branch September 16, 2021 20:47
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.

3 participants