ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
![]() | 1 | initial version |
You need to remap the /cmd_vel topic in your launch file for nav2 to publish to the topic you want. Relevant snippet from this answer: how-to-remap-topic-in-a-ros2-launch-file
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'),
]
)
The node to republish a topic to a different topic already exists in the topic_tools package, the relay node there specifically, but as I said, in this case you would just want to remap the topic that nav2 outputs.