Ask Your Question

Remapping move_base Twist publisher topic.

asked 2018-02-06 14:36:35 -0600

piraka9011 gravatar image

updated 2018-02-14 07:44:24 -0600

Hi all,

I'm working with a Clearpath Husky on ROS Indigo, Ubuntu 14.04. I'm trying to remap the topic that move_base publishes its Twist messages on to ('cmd_vel') to another name that I can use with a topic_tools mux. I was able to do so by changing the move_base.launch file in the jackal_navigation package, however, I want to know if there's a way to do so without changing the source of the original package.

I created my own launch file that launches the jackal_navigation amcl_navigation.launch file and tried to remap the move_base publishing topic using <remap from="cmd_vel" to="/new_cmd_vel"/>, however, this did not work.

Are there any services or parameters that I am unaware of that remap the navigation stacks Twist message publisher?

Thanks in advance!

Edit: Below is the launch file I am using and how I tried to remap the topic

    <include file="$(find jackal_gazebo)/launch/jackal_world.launch">
        <arg name="config" value="front_laser"/>
    <include file="$(find jackal_navigation)/launch/amcl_demo.launch">
        <arg name="map_file" value="/home/river/gazebo_map.yaml"/>
        <!-- This is how I tried to change it -->
        <remap from="cmd_vel" to="/nav_vel"/>
    <include file="$(find jackal_viz)/launch/view_robot.launch">
        <arg name="config" value="localization"/>
    <!-- How I would like to use my renamed topic (in a multiplexer) -->
    <node name="topic_tools_mux" pkg="topic_tools" type="mux" 
        args="/cmd_vel /bsc_jackal/bsc_vel /bsc_jackal/key_vel /bsc_jackal/nav_vel mux:=bsc_mux">

Below is the modified source launch file for Jackal in jackal_navigation/launch/include/move_base.launch:

    <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find jackal_navigation)/params/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find jackal_navigation)/params/costmap_common_params.yaml" command="load" ns="local_costmap" />

    <rosparam file="$(find jackal_navigation)/params/map_nav_params/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find jackal_navigation)/params/map_nav_params/global_costmap_params.yaml" command="load" />

    <rosparam file="$(find jackal_navigation)/params/base_local_planner_params.yaml" command="load" />
    <rosparam file="$(find jackal_navigation)/params/move_base_params.yaml" command="load" />

    <param name="base_global_planner" type="string" value="navfn/NavfnROS" />
    <param name="base_local_planner" value="base_local_planner/TrajectoryPlannerROS"/>

    <remap from="odom" to="odometry/filtered" />
    <!-- Here is where I remapped the topic -->
    <remap from="cmd_vel" to="/bsc_jackal/nav_vel"/>

Below is the output of rostopic list | grep vel as Procopio requested. /bsc_jackal/* are the topics generated from the topic_tools mux. /jackal_velocity_controller/cmd_vel is just a relay to /cmd_vel using topic tools (I found this out by looking at the jackal source launch files).

edit retag flag offensive close merge delete



Can you paste your launch file here so we can see how you're attempting this?

jayess gravatar image jayess  ( 2018-02-06 15:10:15 -0600 )edit

paste the output of rostopic list | grep vel so we can see all the velocity related topics. It may be that they are inside some namespace.

Procópio gravatar image Procópio  ( 2018-02-12 10:14:03 -0600 )edit

@Procopio please see my edit.

piraka9011 gravatar image piraka9011  ( 2018-02-14 07:44:43 -0600 )edit

1 Answer

Sort by » oldest newest most voted

answered 2018-02-08 05:46:32 -0600

Procópio gravatar image

If your first option worked, just copy the modified file to outside the original package and rename it as you like. Launch files do not need to be stored inside a package to work with it, it only contains instructions on what to launch, parameters, remaps, etc...

edit flag offensive delete link more


Since this launch file is being used by other packages, wouldn't I have to make sure that all the other packages can 'see' it? How would I tell the launch file to change its 'include' launch file?

piraka9011 gravatar image piraka9011  ( 2018-02-08 08:41:29 -0600 )edit

Your Answer

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

Add Answer

Question Tools

1 follower


Asked: 2018-02-06 14:36:35 -0600

Seen: 862 times

Last updated: Feb 14 '18