Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remap "/diff_drive_base_controller/cmd_vel_unstamped" to "/cmd_vel" #125

Open
xibeisiber opened this issue Feb 28, 2023 · 3 comments
Open

Comments

@xibeisiber
Copy link

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!

@xibeisiber
Copy link
Author

xibeisiber commented Feb 28, 2023

add tag:

      <ros>
        <remapping>/diff_drive_base_controller/cmd_vel_unstamped:=/cmd_vel</remapping>
      </ros>

@azazdeaz
Copy link

@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",
)

@xibeisiber
Copy link
Author

    <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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants