Ask Your Question

Use teb local planner for turtlebot

asked 2020-09-22 16:23:32 -0500

protoGuy gravatar image

Hi guys, I want to use the teb local planner for the turtlebot instead of the dwa planner. However, I am a bit confused about how to setup the navigation stack discussed on tutorial 3:

According to the tutorial, one can use the teb planner by adding the following line to the move_base.launch file:

<param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />

However, even after doing so the published plan is "/move_base/TrajectoryPlannerROS/local_plan". So I am confused about what I did wrong as I closely followed the tutorial. My custom launch file can be seen below:


<include file="$(find turtlebot_navigation)/launch/includes/velocity_smoother.launch.xml"/> 

<arg name="odom_frame_id"   default="odom"/>
<arg name="base_frame_id"   default="base_footprint"/>
<arg name="global_frame_id" default="map"/>
<arg name="odom_topic" default="odom" />
<arg name="laser_topic" default="scan" />

<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find turtlebot_navigation)/param/costmap_common_params.yaml" command="load" 
ns="global_costmap" />
    <rosparam file="$(find turtlebot_navigation)/param/costmap_common_params.yaml" command="load" ns="local_costmap" />   
    <rosparam file="$(find turtlebot_navigation)/param/local_costmap_params.yaml" command="load" />   
    <rosparam file="$(find turtlebot_navigation)/param/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find teb_local_planner_tutorials)/launch/custom/dwa_local_planner_params.yaml" command="load" /> 

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

    <remap from="cmd_vel" to="navigation_velocity_smoother/raw_cmd_vel"/> 
    <remap from="odom" to="$(arg odom_topic)"/>
    <remap from="scan" to="$(arg laser_topic)"/>


In order to load the map I have created a custom amcl launch file (modified version of amcl_demo.launch):

 <!-- Map server -->
 <arg name="map_file" default="$(env TURTLEBOT_GAZEBO_MAP_FILE)"/>
 <arg name="3d_sensor" default="$(env TURTLEBOT_3D_SENSOR)"/>  <!-- r200, kinect, asus_xtion_pro -->

 <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

 <!-- Localization -->
 <arg name="initial_pose_x" default="0.0"/>
 <arg name="initial_pose_y" default="0.0"/>
 <arg name="initial_pose_a" default="0.0"/>
 <arg name="custom_amcl_launch_file" default="$(find turtlebot_navigation)/launch/includes/amcl/$(arg 3d_sensor)_amcl.launch.xml"/> 

 <include file="$(arg custom_amcl_launch_file)">
 <arg name="initial_pose_x" value="$(arg initial_pose_x)"/>
 <arg name="initial_pose_y" value="$(arg initial_pose_y)"/>
 <arg name="initial_pose_a" value="$(arg initial_pose_a)"/>

<!-- teb -->
<include file="$(find teb_local_planner_tutorials)/launch/custom/turtle_teb.launch"/>

To run Gazebo : "roslaunch turtlebot_gazebo turtlebot_world.launch",

AMCL: "roslaunch teb_local_planner_tutorials amcl_teb.launch map_file:=/opt/ros/kinetic/share/turtlebot_gazebo/maps/playground.yaml "

The example itself ("roslaunch teb_local_planner_tutorials robot_diff_drive_in_stage.launch") seems to work fine. I would really appreaciate any help, as I have no idea on how to solve this issue.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-09-22 18:19:40 -0500

JackB gravatar image

updated 2020-09-22 18:20:22 -0500

Instead of <param name="dwa_local_planner" value="teb_local_planner/TebLocalPlannerROS" /> in your launch file you should have <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />?

edit flag offensive delete link more


Wow, thanks for the quick answer. I thought I have to use the dwa yaml file since the im using turtlebot 2 and the base planner was located in the turtlebot 3 folder. I initially thought you have to use the yaml file provided by the bot you are using ...

protoGuy gravatar image protoGuy  ( 2020-09-24 09:42:57 -0500 )edit

@protoGuy I am so glad I could help! So the ROS parameter server essentially stores variable name for you. So when you ran the command you previously had, it loaded the name "teb_local_planner/TebLocalPlannerROS" into a parameter on the server called "dwa_local_planner". But the parameter name move_base looks for is called "base_local_planner". So before there was no "base_local_planner" at all, but now if you fixed it, there should be a parameter in the move_base name space called base_local_planner with the value teb_local_planner/TebLocalPlannerROS.

To prove it, after the program launches you can run rosparam list and you should see all the available parameters in the parameter server. To get the value of "base_local_planner" you can probably just run rosparam get /move_base/base_local_planner. Depending on namespaces the command might change a little, but that is a good start to understand the parameter server better.

JackB gravatar image JackB  ( 2020-09-24 10:07:56 -0500 )edit

@JackB I have a related question where I am also trying to use the teb_local_planner with turtlebot3 here, if you could spare some time.

distro gravatar image distro  ( 2022-01-12 13:42:16 -0500 )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



Asked: 2020-09-22 16:23:32 -0500

Seen: 852 times

Last updated: Sep 22 '20