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

can we run rosbag2 record / play as a ROS2 node or component? #685

Closed
hakuturu583 opened this issue Mar 19, 2021 · 9 comments
Closed

can we run rosbag2 record / play as a ROS2 node or component? #685

hakuturu583 opened this issue Mar 19, 2021 · 9 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@hakuturu583
Copy link

Description

Hi, I an developing ROS2 application and I found rosbag2 packages has no executable and components to play or record topics.

Implementation Notes / Suggestions

adding player and recorder component by using rosbag2_cpp::Reader and rosbag2_cpp::Write

@hakuturu583 hakuturu583 added the enhancement New feature or request label Mar 19, 2021
@emersonknapp
Copy link
Collaborator

Good call! It makes perfect sense to provide a node/component that can be used, rather than having to call it via the CLI (or write your own program). This should not be hard to implement, the trickiest part will be making it configurable by parameters instead of commandline options.

Implementation notes: create a transport_node component in rosbag2_transport library. Use parameters to configure its options. Setup of the record/playback itself will look similar to https://github.com/ros2/rosbag2/blob/master/rosbag2_transport/src/rosbag2_transport/rosbag2_transport_python.cpp#L224

@emersonknapp emersonknapp added the help wanted Extra attention is needed label Mar 19, 2021
@hakuturu583
Copy link
Author

@emersonknapp Thank you for your advice!

@fujitatomoya
Copy link
Contributor

I guess that we tend to support this feature as general class, that is why @emersonknapp put help wanted tag. (if i am not mistaken...) we would probably keep this open? 🤔

@emersonknapp emersonknapp reopened this Mar 22, 2021
@emersonknapp
Copy link
Collaborator

It's looking like this will probably be possible in the Galactic release - the Recorder and Player are becoming nodes, which could be components, configurable with parameters.

This was referenced Apr 9, 2021
@berndpfrommer
Copy link
Contributor

I'm trying to use the Recorder in Galactic as a node, but alas the constructor throws an UnimplementedError.
The data I'm trying to record is so fast that rmw interprocess communications are too slow and data is dropped.
Using a composable node container would make it possible to record at full speed.

Is there any way to instantiate a Recorder as a composable node container?

From what I understand the composable node has to inherit from rclcpp::Node, and a specific constructor needs to be provided (which is the one that currently throws the UnimplementedError). I tried to instantiate the Recorder inside another node, but got weird errors regarding duplicate nodes.

I can get it to work by inheriting from Recorder, and then setting the right storage options, but only after modifying the rosbag2_transport::Recorder source code, see PR #892

@tonynajjar
Copy link

Hi! Any update on this? I really think it makes sense to offer a node with a service to start recording. We wrote our own Node and I'm sure many other also have, it would make sense to have a standard node we can contribute improvements to.

Some things I'd like to see:

  • receive multiple record requests and process them simultaneously
  • The service offers the same options as the CLI

@MichaelOrlov
Copy link
Contributor

@tonynajjar No updates about this task. I am sorry, don't have resources for that for a while.
Help would be appreciated.

@MichaelOrlov
Copy link
Contributor

This issue will be resolved in the #1419

@hakuturu583
Copy link
Author

Thanks!

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

No branches or pull requests

6 participants