ros2 bag topic remapping from launch file
Hi,
I'm trying to run the following command from a launch file:
some_remap = '/namespace/rgb/camera_info:=/namespace_test/rgb/camera_info'
remap = f'--remap {some_remap}'
ld = LaunchDescription(
[
ExecuteProcess(
cmd=['ros2', 'bag', 'play', str(rosbag_file), remap],
output='screen'
),
ReadyToTest(),
]
This results in the following command:
ros2 bag play /.../rosbag.db3 --remap /namespace/rgb/camera_info:=/namespace_test/rgb/camera_info
For some reason Ros2 complains about unrecognized arguments:
ros2: error: unrecognized arguments: --remap /namespace/rgb/camera_info:=/namespace_test/rgb/camera_info
But according to this answer and ros2 bag play -h
the above command should work. Without the remapping things work fine. So what's wrong here?
And if I copy-paste the resulting command directly into the terminal it works fine...
Thanks in advance!
(Ros2 Humble on Ubuntu 22.04)
It works for my case. maybe you try to update your rosbag2 version?
Sorry updating makes no difference.