-
Notifications
You must be signed in to change notification settings - Fork 253
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
Add a parallelized bag reader class #1862
Comments
It's a bit more tricky than just publishing the message after reading it from the reader. Also, I don't think you could use publishers concurrently at the moment/with the current implementation (specifically looking at the map of publishers), so each thread would need to have exclusive access to a set of topics/publishers. That being said, feel free to try it out and see if it's possible. I'd recommend waiting until after #1848 is merged, though, since it will change the |
@MaxFleur, could you please clarify what purposes or real use cases you want to use a parallel reader for? Also, what problem are you trying to solve with the parallel reading? Is it a slow readout or an inability to parallel the processing workers due to the sequential readout?
|
@MichaelOrlov |
Ah! You could build something based on |
@christophebedard |
You could start writing messages to disk before your |
Might be an idea. The main problem is however that it takes quite some time to load all necessary data... did not find a good solution to speed up that process so far. :-\ |
Description
Currently, I am writing a tool where I can extract and write sensor images stored in a ROS bag. Because some image writing operations are computationally expensive, I want to parallelize the message reading and image writing. Therefore, I need parallelized access to the bag file.
However and afaik,
rosbag2_cpp::Reader
currently only supports reading a bag file in a sequential way. Thus, reading messages independently is not possible.Because data is often recorded and stored sequentially by design, it makes perfect sense to use a sequential reader for those cases. However, it might be an idea to add a parallelized reader class to speed up various computations relying on reading bag messages.
Related Issues
None so far.
Completion Criteria
parallel_reader.hpp
Implementation Notes / Suggestions
One way to access a parallel reader would be similar to the sequential variant:
Another way might be to provide access using a for loop which could then be combined with, for example, OpenMP:
Testing Notes / Suggestions
None
The text was updated successfully, but these errors were encountered: