Robotics StackExchange | Archived questions

how to let move_base subscribe to (custom) /odom topic?

Hello everyone, I have configured the movebase node (shown in following window) and customized the topic /odom in my odomnode.cpp file according to tutorial http://wiki.ros.org/navigation/Tutorials/RobotSetup/Odom, after I launch my launch file roslaunch car_gazebo car_move_base.launch and run the odomnode.cpp ( it has been compiled ) `rosrun customodom odomnode`, I thought the movebase node would subscribe to the topic /odom, but it didn't, so how to let the move_base subscribe to my custom /odom topic.

 <!-- move_base -->
  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

    <rosparam file="$(find car_description)/param/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find car_description)/param/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find car_description)/param/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find car_description)/param/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find car_description)/param/teb_local_planner_params.yaml" command="load" />


    <param name="base_global_planner" value="center_line/CenterLineROS" />
    <param name="planner_frequency" value="1.0" />
    <param name="planner_patience" value="5.0" />

    <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />
    <param name="controller_frequency" value="5.0" />
    <param name="controller_patience" value="15.0" />
  </node>

 <node pkg="topics_setup" type="cmd_vel_to_ackermann_drive.py" name="cmd_vel_to_ackermann_drive">
    <remap from="ackermann_cmd" to="control_command"/>
 </node>
<node name="map_server" pkg="map_server" type="map_server" args="/maps/map_1.yaml" output="screen">
        <param name="frame_id" value="map"/>
</node>
</launch>

image description Before I planned to modify the source code of move_base by adding code subscribing to the topic, but not recommended. What should I do?

Thank you in advance

Asked by ld898 on 2020-05-09 11:52:52 UTC

Comments

Did you solve this issue?

Asked by JRosa on 2021-09-23 04:33:54 UTC

Answers

Modify your launch file to remap from odom to your custom odom topic. http://wiki.ros.org/roslaunch/XML/remap

Asked by David Lu on 2020-05-13 14:37:43 UTC

Comments

Thank you for answer, but the requirement for remap is that the odom is existing and then remap my custom topic to it. And the problem I face: no odom topic which I can remap from custom odom to.

Asked by ld898 on 2020-05-13 15:58:22 UTC