ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Unable to correctly use teb_local_planner for turtlebot3

asked 2022-01-12 12:28:28 -0600

distro gravatar image

updated 2022-01-14 01:28:51 -0600

I have been trying to test out the teb_local_planner in place of the DWA_local planner that the ROS navigation stack uses. I'm basicalIy trying to see if teb_local_planner is better for creating paths when there are obstacles involved in certain scenarios. I have been using the Tutorial found in the ROS wiki to figure out how to get it to work (http://wiki.ros.org/teb_local_planner...). I can set goal on rviz and a path is created but the robot is unable to move to them, for instance the robot moves but is unable to get to the goal and behaves like obstacles are in its way so it just moves back and forth. Inother cases the robot reaches the goal but then moves passed it or away from it for some reason. here is a picture of an instance where the robot is unable to complete it's journey: Robot_cant_move_to_goal

I have tried to attach pictures of relevant .launch files and .yaml files which might contain parameters I don't know how to change to fix my issues. Any help would be much appreciated.

Here is my turtlebot3_navigation.launch file below

<launch>
  <!-- Arguments -->
  <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="map_file" default="$(find turtlebot3_navigation)/maps/map.yaml"/>
  <arg name="open_rviz" default="true"/>
  <arg name="move_forward_only" default="false"/>

  <!-- Turtlebot3 -->
  <include file="$(find turtlebot3_bringup)/launch/turtlebot3_remote.launch">
    <arg name="model" value="$(arg model)" />
  </include>

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

  <!-- AMCL -->
  <include file="$(find turtlebot3_navigation)/launch/amcl.launch"/>

  <!-- move_base -->
  <include file="$(find turtlebot3_navigation)/launch/move_base.launch">
    <arg name="model" value="$(arg model)" />
    <arg name="move_forward_only" value="$(arg move_forward_only)"/>
  </include>

  <!-- rviz -->
  <group if="$(arg open_rviz)"> 
    <node pkg="rviz" type="rviz" name="rviz" required="true"
          args="-d $(find turtlebot3_navigation)/rviz/turtlebot3_navigation.rviz"/>
  </group>
</launch>

which opens up the rviz when you roslaunch. I get these Warning and error messages in my terminal("TebOptimalPlanner::getVelocityCommand() - timediff<=0 is invalid") here:

[ WARN] [1642015893.008329450, 157.973000000]: Control loop missed its desired rate of 10.0000Hz... the loop actually took 0.1560 seconds
[ WARN] [1642015893.008403174, 157.973000000]: Map update loop missed its desired rate of 10.0000Hz... the loop actually took 0.1560 seconds
[ WARN] [1642015893.153565037, 158.116000000]: Control loop missed its desired rate of 10.0000Hz... the loop actually took 0.1990 seconds
[ WARN] [1642015893.297226947, 158.259000000]: Control loop missed its desired rate of 10.0000Hz... the loop actually took 0.2420 seconds
[ WARN] [1642015893.297362902, 158.259000000]: Map update loop missed its desired rate of 10.0000Hz... the loop actually took 0.3420 seconds
[ WARN] [1642015893.426782063, 158.388000000]: Control loop missed its desired rate of 10.0000Hz... the loop actually took 0.1290 seconds
[ WARN] [1642015893.564398820, 158.524000000]: Control loop missed its desired rate of 10 ...
(more)
edit retag flag offensive close merge delete

Comments

Hi @distro, any reason why you commented cost_scaling_factor: 1.5?

osilva gravatar image osilva  ( 2022-01-12 17:12:07 -0600 )edit

@osilva, the # infront of the cost factor comments it out so I'm not using that at all

distro gravatar image distro  ( 2022-01-12 19:06:57 -0600 )edit

Take a look at this guide for navigation for turtlebot3: https://emanual.robotis.com/docs/en/p...

It also includes this guide that explains step by step how to adjust each parameter and it’s purpose: https://kaiyuzheng.me/documents/navgu...

osilva gravatar image osilva  ( 2022-01-12 19:23:34 -0600 )edit

But cost scaling factor is important so I was surprised to see it commented

osilva gravatar image osilva  ( 2022-01-12 19:24:26 -0600 )edit

@osilva when I was using the DWA_local_planner I also had the cost scaling factor commented out, it didnt affect anything,everything ran smoothly. I dont think thats what the issue is

distro gravatar image distro  ( 2022-01-12 19:53:29 -0600 )edit

1 Answer

Sort by » oldest newest most voted
3

answered 2022-01-27 19:46:48 -0600

distro gravatar image

updated 2022-01-27 19:48:10 -0600

I figured it out, for turtlebot3 this is how you edit your move_base.launch file to use teb_local_planner :

    <launch>
      <!-- Arguments -->
      <arg name="model" default="$(env TURTLEBOT3_MODEL)" doc="model type [burger, waffle, waffle_pi]"/>
      <arg name="cmd_vel_topic" default="/cmd_vel" />
      <arg name="odom_topic" default="odom" />
      <arg name="move_forward_only" default="false"/>

      <!-- move_base -->
      <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
        <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS"/>
        <param name="base_global_planer" value="global_planner/GlobalPlanner"/>
        <param name="controller_frequency" value="10.0" />
        <rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find turtlebot3_navigation)/param/costmap_common_params_$(arg model).yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find turtlebot3_navigation)/param/local_costmap_params.yaml" command="load" />
         <rosparam file="$(find turtlebot3_navigation)/param/base_local_planner_params.yaml" command="load" />
        <rosparam file="$(find turtlebot3_navigation)/param/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find turtlebot3_navigation)/param/move_base_params.yaml" command="load" />
        <remap from="cmd_vel" to="$(arg cmd_vel_topic)"/>
        <remap from="odom" to="$(arg odom_topic)"/>
      </node>
      <node pkg="teb_local_planner" type="cmd_vel_to_ackermann_drive.py" name="cmd_vel_to_ackermann"> 
      </node>
</launch>
edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2022-01-12 12:28:28 -0600

Seen: 610 times

Last updated: Jan 27 '22