Robotics StackExchange | Archived questions

DWA - parameters tuning

We have extrapolated dwalocalplanner 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:

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

Asked by 0novanta on 2022-10-26 10:46:58 UTC

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.

Asked by Mike Scheutzow on 2022-10-26 11:56:24 UTC

@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.

Asked by 0novanta on 2022-10-27 02:47:36 UTC

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.

Asked by Mike Scheutzow on 2022-10-27 07:44:34 UTC

@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?

Asked by 0novanta on 2022-10-28 03:50:43 UTC

Answers