Ask Your Question

robot rotates instead of going to the goal (dwa_local_planner)

asked 2015-06-02 15:33:56 -0500

PT gravatar image

updated 2015-06-20 14:55:24 -0500

Please see the following two videos about the behaviour of the robot (video1, video2). The robot sometimes moves pretty well, but sometimes just keep spinning around. Such behaviour really confuses me, and your help to solve it is greatly appreciated.

I use ROS navigation stack with dwa_local_planner. I have two computers: one on the robot the publish odometry and laser scan, and the other desktop running the navigation stack. Both computers are on a local network, and I use chrony to sync their time. However, my hunch is that the negative delay shown in tf_monitor (see videos above) might be the cause of it, but I'm not totally sure. Also, if you find other things in the video don't seem right, please let me know too.

Here is the setting of dwa_local_planner.

  # Robot configuration parameters  
  acc_lim_x: 2.5
  acc_lim_y: 0
  acc_lim_th: 3.2

  max_vel_x: 0.5
  min_vel_x: 0.0
  max_vel_y: 0
  min_vel_y: 0

  max_trans_vel: 0.5
  min_trans_vel: 0.1
  max_rot_vel: 1.0
  min_rot_vel: 0.2

  # Goal Tolerance Parameters
  yaw_goal_tolerance: 0.2
  xy_goal_tolerance: 0.2
  latch_xy_goal_tolerance: false

  # Forward Simulation Parameters
  vy_samples: 0

  # Trajectory scoring parameters
  occdist_scale: 5

Here is the tf_tree

image description

Thanks for your help in advance!


One way that seems to bypass the problem for me is to increase acc_lim_x, acc_lim_th, and acc_lim_trans to really really high, even higher than the true limit of my robot (see video 6). All previous videos showed that, when the robot exists the rotating behavior, all candidate trajectories were somehow pretty short, which means that the velocity is very small. To force dwa_local_planner considering a wider range of velocity (hence wider range of candidate trajectories), one way is to increase acc_lim, because candidate velocities are determined by vel +/- acc_lim. While increasing acc_lim bypass this particular issue, it is still unclear to me why the dwa local planner, when the robot rotates, keeps choosing those trajectories of small velocities and therefore prevents speeding up toward the target.

edit retag flag offensive close merge delete


p.s. Once I increase the publishing rate of /odom to 100Hz, the delay of tf frames improved. However, the rotating behavior persists (see video). I also plotted the /cmd_vel, looks like it is the planner that wants to rotate the robot, instead of motor's problem.

PT gravatar image PT  ( 2015-06-03 16:38:09 -0500 )edit

What version of ROS is this?

David Lu gravatar image David Lu  ( 2015-06-04 21:45:02 -0500 )edit

it's Indigo

PT gravatar image PT  ( 2015-06-04 22:01:04 -0500 )edit

who can recommend a param setting about costmap and dwa params? gravatar image  ( 2020-04-21 05:19:15 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2015-06-04 21:14:59 -0500

David Lu gravatar image

updated 2015-06-04 21:45:41 -0500

As an experiment, can you set forward_point_distance to 0?

Edit: What if you set path_distance_bias to 0?

edit flag offensive delete link more


Thanks for your suggestion. I've tried that, but it did not eliminate the spinning and the robot still behaves similarly.

PT gravatar image PT  ( 2015-06-04 21:32:43 -0500 )edit

Please see video 4. I've set forward_point_distance and path_distance_bias to 0, and plot cost cloud. I also suspect whether the acceleration limitation, sim_time, and vx_samples limited dwa planner, so I increased their values. However, the robot still spins.

PT gravatar image PT  ( 2015-06-05 12:38:14 -0500 )edit

Do you see the same behavior with a lower max_rot_vel?

David Lu gravatar image David Lu  ( 2015-06-09 19:55:19 -0500 )edit

See video 5. I lowered the max_rot_vel from 1 to 0.5. It seems to help a little bit, but it still rotates sometimes. I noticed that the robot always moves smoothly for one direction, but not the other way around. Could it be related to orientation of, say, maps?

PT gravatar image PT  ( 2015-06-18 15:42:56 -0500 )edit

Hi there, my robot seems to exhibit similar behaviour, did you find a solution?

miguel gravatar image miguel  ( 2015-08-03 00:54:15 -0500 )edit

I didn't find the 'true' solution, but see [EDIT] to see the way I bypass the issue.

PT gravatar image PT  ( 2015-08-03 09:39:47 -0500 )edit

Hello there, did you solved your problem?

al_ca gravatar image al_ca  ( 2020-11-19 10:04:48 -0500 )edit

answered 2017-03-26 05:28:12 -0500

yun_bot gravatar image

Hi,my robot have the same problem, did you find a solution?

edit flag offensive delete link more



Setting acc_lim_theta to a high value, e.g. 10, worked for me.

helen gravatar image helen  ( 2017-03-29 09:47:16 -0500 )edit

Thanks.. worked for me too with turtlebot simulation spinning problem..

Imesh gravatar image Imesh  ( 2019-04-02 12:54:40 -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

1 follower


Asked: 2015-06-02 15:33:56 -0500

Seen: 1,953 times

Last updated: Apr 21 '20