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

Read topics/services from config file when recording #1581

Open
tonynajjar opened this issue Mar 11, 2024 · 6 comments
Open

Read topics/services from config file when recording #1581

tonynajjar opened this issue Mar 11, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@tonynajjar
Copy link

tonynajjar commented Mar 11, 2024

Description

I'd like to be able to able to run ros2 bag record --record-config-file config-file.yaml (or similar) where config-file.yaml would contain a list of topics and/or services to record. The main benefit of this approach would be to have a config file that is version-controllable, e.g. at some site we want to record different topics.

Related Issues

None that I could find

Completion Criteria

** What needs to be true before we can call this "Done"? Bullet lists are appropriate. **

Implementation Notes / Suggestions

** If you have ideas about how this feature might be accomplished, put them here. Note that this is just a suggestion to the implementer, so feel free to speculate. **

Testing Notes / Suggestions

** All features in this project need tests. Please give some input on cases that will need to be tested - and how the testing might be implemented. **

@tonynajjar tonynajjar added the enhancement New feature or request label Mar 11, 2024
@tonynajjar tonynajjar changed the title Read topics from config file when recording Read topics/services from config file when recording Mar 11, 2024
@fujitatomoya
Copy link
Contributor

fujitatomoya commented Mar 11, 2024

@tonynajjar i think this is useful for supporting 3rd party application when we do debugging.

besides a list of topics and services, maybe the following could be also considered in the configuration file?

@tonynajjar
Copy link
Author

QoS override setting to each topic or service? (i think currently this is not supported yet in rosbag2.)

@fujitatomoya this I believe can be done already:
https://docs.ros.org/en/foxy/How-To-Guides/Overriding-QoS-Policies-For-Recording-And-Playback.html

@MichaelOrlov
Copy link
Contributor

@tonynajjar @fujitatomoya IMO the requested functionality already exists and could be achieved through composition via starting reorder from the launch file. Sorry the documentation about it is still in review. See https://github.com/ros2/rosbag2/pull/1510/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R349-R365 and you are more than welcome with a contribution to improve our documentation in this regards.

The short example would be:
One instead of running command ros2 bag record --record-config-file config-file.yaml can run

$ ros2 launch rosbag2_transport record_all.launch.py

where the record_all.launch.py could be

import launch

def generate_launch_description():
    return launch.LaunchDescription([
        launch.actions.Node(
            package='rosbag2_transport',
            executable='recorder',
            name='rosbag2_recorder',
            output="screen",
            parameters=["/path/to/recorder_params.yaml"],
        )
    ])

Example of the recorder_params.yaml can be found here https://github.com/ros2/rosbag2/blob/rolling/rosbag2_transport/test/resources/recorder_node_params.yaml

@tonynajjar
Copy link
Author

Thanks @MichaelOrlov for the hint, looks indeed promising. I will test it out and get back to you (can't promise when but likely before end of next week)

@tonynajjar
Copy link
Author

Actually it looks like I won't be able to test it since I'm on Humble and the rosbag2_recorder isn't available there. Any plans to backport it?
In any case, if you say it's supported on rolling then feel free to close the issue and I'll report back here if I get to use it and face issues

@MichaelOrlov
Copy link
Contributor

@tonynajjar Backporting is not feasible due to the massive changes that are not API/ABI compatible.
Feedback will be useful.
I am also considering if we could add -record-config-file CLI parameter with a low effort via parsing yaml file as a node parameters on the rosbag2_py layer.

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

3 participants