ros2/rosbag2

Recording a bag file from a launch file.

DLu opened this issue · 5 comments

DLu commented

Feature request

Feature description

The syntax for recording a bag file from a launch file always seemed awkward to me.

https://github.com/ros2/examples/blob/1d97c4fc7445554f6f85f63305d424fc017212a0/launch_testing/launch_testing_examples/launch_testing_examples/record_rosbag_launch_test.py#L43-L46

Passing a raw ExecuteProcess command seems to invite errors.

Instead, there should be a custom launch_ros action that does the same thing.

Implementation considerations

Seems like it could be a straightforward extension of ExecuteProcess.

We think this is possible via registering a launch action. But because this package can't depend on rosbag2 (that would lead to circular dependencies), this would have to be done in rosbag2. I'm going to move the issue over there and mark it as an enhancement.

@DLu Not sure what is expected behavior for the rosbag2 in this case. Could you please clarify or put some examples what would be expected behavior?

We might already be taking care of this enhancements suggestion in #1419 please take a look at it.

#1419 would allow for e.g. (syntax probably not 100% correct)

        launch_ros.actions.Node(
            executable='recorder',
            package='rosbag2',
            name='my_recorder',
            parameters=[{
                'all': True
            }]
        ),

Is that kind of what you were hoping for @DLu , or something different?

DLu commented

Yeah, that syntax would work. The alternative would be something like

      rosbag2.launch_actions.Record(
            name='my_recorder',
            parameters=[{
                'topics': LaunchConfiguration('my_topic_list')
            }]
        ),
  • Closing as a duplicate for #1419