DWA - parameters tuning

asked 2022-10-26 10:46:58 -0500

0novanta gravatar image

updated 2022-10-28 03:51:58 -0500

We have extrapolated dwa_local_planner from move_base in order to use it as stand-alone package.

Our objective is to move a differential drive robot inside an empty map (no obstacles) following an eight-shaped trajectory: to do so we use only a global map. Moreover, we discretized the trajectory as a sequence of 10.000 goals and we provide them to dwa as a single goal one at a time (once a goal has been reached we set the following one as the new goal). Both the trajectory and the robot are small, the trajectory stretches over 2x1 meters while the robot has a footprint of around 20 cm.

We managed to make our robot move as it should, kind of.
However, we have two questions.

QUESTION 1

We struggle to find a correspondence between dwa parameters and the robot's behavior. Currently we have set these dwa parameters:

my_dwa_planner:

  min_vel_y: 0.0
  max_vel_y: 0.0

  min_vel_x: 0.0
  max_vel_x: 10.0

  acc_lim_theta: 10.0

  forward_point_distance: 0.05

  xy_goal_tolerance: 0.15
  yaw_goal_tolerance: 6.3

However when we try to modify some of them some unexpected behaviors happen.
For example, if we modify xy_goal_tolerance with any value different from 0.15 the robot doesn't move from the starting position or moves in circles in the starting position.

Do you have any suggestions about this particular parameter or any other useful parameter?

QUESTION 2

We noticed that the angular velocities of both wheels change instantaneously.

image description

We can't seem to find a way to tune parameters in order to make the velocities change more smoothly. In particular, we tried two ways:

  • increasing vx_samples and vth_samples, which led a slight improvement but still far from a smooth change;
  • reducing acc_lim_theta, which either led to same behavior as in the previous image or in the impossibility of the robot to reach even its first goal (due to a very low curvature radius).

What parameters could we work on to fix this behavior?

EDIT:

Plots of linear velocity and angular velocity provided by DWA, it can be noted that they change abruptly. image description

edit retag flag offensive close merge delete

Comments

Is this a differential robot? Is this simulation or real robot? Are you using ros_control?

If the distance to your goal is less than xy_goal_tolerance, dwa_planner will assume there is no work to do.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-10-26 11:56:24 -0500 )edit

@MikeScheutzow
Yes, it is a differential robot. Yes, it is simulation. No, we do not use ros_control because we implemented our own controller. We know about the distance < xy_goal_tolerance situation, the footprint is around 20cm but the data used to compute left and right angular velocities are coherent with xy_goal_tolerance value, specifically:

  • radius of the wheels is 3cm;
  • distance between wheels is 15cm.
0novanta gravatar image 0novanta  ( 2022-10-27 02:47:36 -0500 )edit

Your 3rd sentence is confusing, because xy_goal_tolerance has nothing to do with the size of the robot body or wheels. This parameter tells dwa_planner when the base_link is "close enough" to the goal. Larger values are needed for robot's that 1) can't make small movements accurately at low velocity, or 2) have unstable localization information.

On a different subject, those rapid velocity changes in the wheel joints are created by your code, so not sure what you expect us to say. Most people use a PID filter to avoid sending large abrupt changes to the motor controller.

Mike Scheutzow gravatar image Mike Scheutzow  ( 2022-10-27 07:44:34 -0500 )edit

@MikeScheutzow
You are correct, we do compute angular_left_velocity and angular_right_velocity on our own, sorry for the confusion.
However, in order to do so, we use the angular and linear velocities provided by DWA.
I have edited the question adding the plots of those velocities and it can be noted that they change abruptly. It can, also, be noted that both velocities have a fixed number of values, for instance linear_velocity has 3 possible values, this behavior should be linked to the parameter vx_samples which has value 3 in the yaml file.
We do not have a PID filter. Should we increase vx_samples and vth_samples values? Or is a PID filter the best thing to do?

0novanta gravatar image 0novanta  ( 2022-10-28 03:50:43 -0500 )edit