Ask Your Question
5

How to remap topic in a ROS2 launch file?

asked 2021-04-22 05:23:05 -0500

g.bardaro gravatar image

Hi everyone,

I am setting up a navigation2 launch file.

I have used this one as a reference, and everything seems to work.

However, I need to remap the /cmd_vel topic. I am not sure what is the syntax to do so in a top-level launch file to have it propagated to a nested launch file.

Thanks for the help

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2021-12-17 04:53:17 -0500

Richard Mark Haes Ellis gravatar image

Found an example on the ros2 tutorials (Foxy)

https://docs.ros.org/en/foxy/How-To-G...

perform remap so both turtles listen to the same command topic

forward_turtlesim_commands_to_second_turtlesim_node = Node(
        package='turtlesim',
        executable='mimic',
        name='mimic',
        remappings=[
            ('/input/pose', '/turtlesim1/turtle1/pose'),
            ('/output/cmd_vel', '/turtlesim2/turtle1/cmd_vel'),
        ]
    )
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

3 followers

Stats

Asked: 2021-04-22 05:23:05 -0500

Seen: 666 times

Last updated: Dec 17 '21