DWA suddenly stops when it arrives to the goal
I am using move_base and dwa_local_planner. Robot moves smoothly at start but when it arrives to goal it suddenly stops instead of slowing down when getting closer to the goal. I have tried different acceleration values but it didn't effect the behavior. My planner parameters are set like this
DWAPlannerROS:
max_vel_trans: 1.0
min_vel_trans: 0.1
max_vel_x: 1.0
min_vel_x: -1.0
max_vel_theta: 1.0
min_vel_theta: 0.1
max_vel_y: 0.0
min_vel_y: 0.0
acc_lim_x: 0.15
acc_lim_y: 0.0
acc_lim_theta: 0.35
acc_lim_trans: 0.15
prune_plane: true
xy_goal_tolerance: 0.5
yaw_goal_tolerance: 6.28
latch_xy_goal_tolerance: false
sim_time: 1.5
sim_granularity: 0.1
angular_sim_granularity: 0.1
vx_samples: 20
vy_samples: 1
vth_samples: 20
path_distance_bias: 32.0
goal_distance_bias: 15.0
occdist_scale: 0.02
forward_point_distance: 0.325
stop_time_buffer: 0.2
scaling_speed: 0.25
max_scaling_factor: 0.2
oscillation_reset_dist: 0.05
publish_traj_pc : true
publish_cost_grid_pc: true
controller_frequency: 1.0
Example of this behavior can be seen from rqt plots
Edit 1: I have noticed that yaw goal tolerance is too high which prevents rotating_to_goal behavior in computeVelocityCommandsStopRotate function at the end and directly sets cmd_vel to 0. However, it still doesn't fix sudden stop problem if the goal yaw and final position yaw is in the given tolerance
Why do we not see cmd_vel.linear.x in these plots? What is the black line?
Black line is cmd_vel actually I have changed the plot style manually but I think rqt didn't update the legend
A couple thoughts on your DWAPlanner config:
Your
controller_frequency
is insanely low, and is not consistent with the black dots in first plot. Most people prefer to inherit this rate from the parent move_base.Under normal circumstances, DWAPlanner will linearly ramp the x velocity down to 0 once it is a certain distance from the goal. Your very low
acc_lim_x
and very shortstop_time_buffer
might be interfering with this ramp-down mechanism.You are right I forgot to remove
controller frequency
parameter from this config and it is set to 15 in move_base config. So I have changed the parameters you have suggested to and it fixed the problem. Thanks for the advice.