gz_ros2_control
gz_ros2_control copied to clipboard
remap "/diff_drive_base_controller/cmd_vel_unstamped" to "/cmd_vel"
Hi,
In the diff_drive_example.launch.py, how to remap "/diff_drive_base_controller/cmd_vel_unstamped" to "/cmd_vel"?
I am using navigation 2 which publishes commands to /cmd_vel.
Thanks!
add tag:
<ros>
<remapping>/diff_drive_base_controller/cmd_vel_unstamped:=/cmd_vel</remapping>
</ros>
@xibeisiber Where would you add this that XML?
If it helps anyone, I ended up using the topic_tools/relay
node to solve this:
relay_odom = Node(
name="relay_odom",
package="topic_tools",
executable="relay",
parameters=[
{
"input_topic": "/diff_drive_base_controller/odom",
"output_topic": "/odom",
}
],
output="screen",
)
relay_cmd_vel = Node(
name="relay_cmd_vel",
package="topic_tools",
executable="relay",
parameters=[
{
"input_topic": "/cmd_vel",
"output_topic": "/diff_drive_base_controller/cmd_vel_unstamped",
}
],
output="screen",
)
<plugin filename="libign_ros2_control-system.so" name="ign_ros2_control::IgnitionROS2ControlPlugin">
<parameters>$(arg simulation_controllers)</parameters>
<controller_manager_node_name>controller_manager</controller_manager_node_name>
<ros>
<remapping>/diff_drive_base_controller/cmd_vel_unstamped:=/cmd_vel</remapping>
</ros>
</plugin>