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

Support for modifying and writing rosbags #3

Open
ssnover opened this issue Feb 28, 2023 · 4 comments
Open

Support for modifying and writing rosbags #3

ssnover opened this issue Feb 28, 2023 · 4 comments

Comments

@ssnover
Copy link

ssnover commented Feb 28, 2023

Was looking to write a quick program to modify a value on some data in a rosbag I had recorded and realized this nifty crate didn't support writing; only reading.

Would you accept an MR to support modifying data and writing the modified rosbag back to disk?

@newpavlov
Copy link
Owner

newpavlov commented Feb 28, 2023

IIRC there is a lot to consider for implementing proper writing of rosbag files. I would prefer to not add a partial solution.

Do you simply want to tweak the data field in MessageData? Can you guarantee that its size does not change? I think we could add an API for getting offset of data in original file, you then could use it to modify bytes directly using other means.

@ssnover
Copy link
Author

ssnover commented Mar 1, 2023

I agree, best to implement a full solution rather than a partial solution. I've already circumvented my original use case with C++, but this seemed like an opportunity to improve the ecosystem and I've been working with the messages' internals a lot as part of roslibrust.

If you think it's appropriate for this crate to expand to a scope closer to what's offered by the official rosbag package, I'd be happy to come up with an API to review and, if it looks good, take a crack at implementing it. No sweat if not though, it certainly grows the amount of code to be maintained in this repo.

@newpavlov
Copy link
Owner

newpavlov commented Mar 3, 2023

I am not opposed to expanding the scope, but it looks like a sizable undertaking, which probably should be done in cooperation with folks from rosrust and similar projects. I think a higher priority should be to add a proper integration with ROS types instead of returning raw byte slices. Since I do not currently actively work with ROS, I am open to transferring this crate to an organization or developer with the goal of developing pure Rust ROS ecosystem.

Either way, feel free to open a draft PR. I will try to give you my feedback when I can.

@NerdToMars
Copy link

I created a simple rust lib for rosbag2, feel free to comments/advise if you also interested to create similar thing: https://github.com/NerdToMars/rosbag2-rs

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

No branches or pull requests

3 participants