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

Move the ReaderWriterFactory to the rosbag2_cpp layer #1703

Closed
1 task
MichaelOrlov opened this issue Jun 10, 2024 · 5 comments
Closed
1 task

Move the ReaderWriterFactory to the rosbag2_cpp layer #1703

MichaelOrlov opened this issue Jun 10, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@MichaelOrlov
Copy link
Contributor

Description

Move the ReaderWriterFactory to the rosbag2_cpp layer

Currently the ReaderWriterFactory is part of the rosbag2_transport package and part of its namespace.
However, the ReaderWriterFactory doesn't have any dependencies from the rosbag2_transport package.
It will be more appropriate if the ReaderWriterFactory will be located at the rosbag2_cpp package.

Related Issues

Completion Criteria

  • The ReaderWriterFactory moved to the rosbag2_cpp layer and all dependencies in the rosbag2 updated.

Implementation Notes / Suggestions

Since this is an API-breaking change, we can't just move ReaderWriterFactory from the rosbag2_transport namespace to the rosbag2_cpp. Instead, need to add a deprecation flag to the rosbag2_transport::ReaderWriterFactory and add a new rosbag2_cpp::ReaderWriterFactory.

Testing Notes / Suggestions

Move relevant tests if they exist from the rosbag2_transport layer to the rosbag2_cpp layer.

@MichaelOrlov MichaelOrlov added the enhancement New feature or request label Jun 10, 2024
@Jeffxzj
Copy link

Jeffxzj commented Jan 23, 2025

Kindly asked is there anyone working on this issue ? If not, i am glad to undertake it. @MichaelOrlov

@MichaelOrlov
Copy link
Contributor Author

@Jeffxzj Thank you for being willing to help with this task.
No one has taken it so far. Feel free to take it.

Jeffxzj added a commit to Jeffxzj/rosbag2 that referenced this issue Feb 6, 2025
@Jeffxzj
Copy link

Jeffxzj commented Feb 7, 2025

@MichaelOrlov It seems that ReaderWriterFactory still depends on the rosbag2_transport package. The rosbag2_transport::ReaderWriterFactory::make_writer API needs the rosbag2_transport::RecordOptions & record_options as its parameter. Since we need to keep the deprecated rosbag2_transport::ReaderWriterFactory::make_writer API, the rosbag2_transport still needs to depend on the rosbag2_cpp package. Therefore, adding rosbag2_transport to the rosbag2_cpp 's package dependencies when moving the make_writer API can cause circular dependency error when colcon build.

@MichaelOrlov
Copy link
Contributor Author

MichaelOrlov commented Feb 9, 2025

Hi @Jeffxzj,
The way how I envision a solution to break this cyclic dependency is the following

  1. Will need to create a duplicate of the CompressionOptions struct in the rosbag2_cpp package and name it as WriterOptions.
  2. Use rosbag2_cpp::WriterOptions as the input parameter for the
   rosbag2_cpp::ReaderWriterFactory::make_writer(const rosbag2_cpp::WriterOptions & writer_options)
  1. Copy values from the writer_options to the rosbag2_compression::CompressionOptions compression_options inside ReaderWriterFactory::make_writer(..)

Edit:
I'm sorry, but it will not help. In the end, we will still have cyclic dependencies between rosbag2_cpp and rosbag2_compression.

@MichaelOrlov
Copy link
Contributor Author

  • To avoid cyclic dependencies between rosbag2_cpp and rosbag2_compression, the ReaderWriterFactory should be somewhere outside of the rosbag2_cpp package.
  • It seems that currently, due to the aforementioned cyclic dependencies, there is no better place for the ReaderWriterFactory rather than the rosbag2_transport package. Therefore, I am closing this task as it wouldn't be done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants