Ask Your Question

DWA Planner gives y velocities although y is set to 0

asked 2016-01-18 11:19:27 -0600

Luki25 gravatar image

updated 2016-01-19 08:02:42 -0600


I checked the DWA Planner wiki page once more and took a look at the subscribed and published topics. I have now discovered a difference between the STAGE simulation and my real robot: The simulation gives odometry twist msg with linear.x and angular.z data. My real robot publishes odometry twist messages with linear.x and linear.y data.

Is it possible that this is causing the problem?

Hello everybody,

i'm writing my masterthesis. We habe a nonholonomic robot (diff-drive) with his base_link 10cm behind the centre of the robot. We use Hydro and i want to get the Navigation-Stack to work.

Everything works fine, just the DWA-Planner makes some trouble. First I simulated everything with STAGE and the DWA Planner worked well. I set all the parameters for the y-velocity to 0 because of the diff-drive. Now I want to run the DWA Planner on the robot with the same parameters, but the robot gets y-velocities (i can see them on the /cmd_vel topic) and because of that the robot doesn't drive properly. Both systems are running Hydro and the version of the DWA_Planner is the same.

I don't understand why the simulated system is working and the real system has some troubles with the DWA.

Here is my dwa_planner yaml file:

  max_trans_vel: 0.8       
  min_trans_vel: 0.05      

  max_vel_x: 0.2      
  min_vel_x: 0.05  

  max_vel_y: 0 
  min_vel_y: 0  

  max_rot_vel: 0.5  
  min_rot_vel: 0.0  

  acc_lim_theta: 5.0  # 3.2 
  acc_lim_x: 5.0    # 2.5
  acc_lim_y: 0   # 2.5
  acc_lim_trans: 5.0   # 

# Goal Tolerance Parameters
  yaw_goal_tolerance: 0.17    # 0.05
  xy_goal_tolerance: 0.2    # 0.10

# Forward Simulation Parameters
  sim_time: 1.7   
  vx_samples: 5 
  vy_samples: 0    
  vtheta_samples: 20  

  meter_scoring: true  
  penalize_negative_x: false  

# Oscillation Prevention Parameters
  oscillation_reset_dist: 0.05  

# Debugging
  publish_traj_pc : true
  publish_cost_grid_pc: true
  global_frame_id: map

# Is this existing?
  sim_granularity: 0.025     
  goal_distance_bias: 32.0   
  path_distance_bias: 24.0   
  occdist_scale: 0.3         
  stop_time_buffer: 0.2      

  forward_point_distance: 0.000 
  scaling_speed: 0.25           
  max_scaling_factor: 0.2       

  rot_stopped_vel: 0.01 
  trans_stopped_vel: 0.01

Here is my move_base launch file:

<!-- Use DWAPlannerROS -->
<param name="/move_base/base_local_planner" value="dwa_local_planner/DWAPlannerROS" />

<!-- move_base -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

    <rosparam file="$(find prai_dsc)/param/costmap/dwa_local_planner_params.yaml" command="load" />
    <rosparam file="$(find prai_dsc)/param/costmap/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find prai_dsc)/param/costmap/local_costmap_params.yaml" command="load" ns="local_costmap"/>

    <rosparam file="$(find prai_dsc)/param/costmap/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find prai_dsc)/param/costmap/global_costmap_params.yaml" command="load" ns="global_costmap" />

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2016-01-21 02:40:08 -0600

Luki25 gravatar image

I have found a solution. The problem was the wrong odometry data. My robot gives the correct odometry position in the odom frame but calculates the velocitys for linear.x and linear.y with two timed poses ( new.x - old.x / dt and new.y - old.y / dt).

Because i don't know how to get the Ticks of the encoders, i just hardcoded the y-velocity to 0 and tested the planner once more. The planner works now fine! No /cmd/linear/y values and the movement of the robot has improved!

I don't know why, but if the DWA Planner receives velocity values in y direction, it will also send /cmd_vel commands in y direction.

Now i only have to correct the calculation of the odometry velocity and i think the movement will improve once more.

edit flag offensive delete link more

answered 2016-01-18 12:51:47 -0600

Akif gravatar image

updated 2016-01-19 03:18:13 -0600

Try setting

holonomic_robot: false

in your yaml file.


Yes you are right, I missed that point. But now looking to your YAML file, there seems an indentation problem if this is exactly the same indentation your yaml file has. YAML is indentation sensitive. Therefore your parameters may not be evaluated in DWAPlannerROS namespace. Try correcting it as;

  max_trans_vel: 0.8       
  min_trans_vel: 0.05      

  max_vel_x: 0.2      
  min_vel_x: 0.05  

  max_vel_y: 0 
  min_vel_y: 0

Also you can check these parameter values from parameter server to be sure that they are set correctly.

edit flag offensive delete link more


Although I'm pretty sure that this parameter is only used whit TrajectoryPlanner, I have the set the parameter anyway. The problem persists. Nothing changed...

Luki25 gravatar image Luki25  ( 2016-01-19 02:40:23 -0600 )edit

Sorry, it was a problem with the editor. I corrected it. I have checked all the parameters more than once, they are set correctly. Also the Dynamic Reconfigure shows the correct parameters and shows the DWA Planner under move_base.

Luki25 gravatar image Luki25  ( 2016-01-19 03:49:30 -0600 )edit

i updated my question ...

Luki25 gravatar image Luki25  ( 2016-01-19 08:19:23 -0600 )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


Asked: 2016-01-18 11:19:27 -0600

Seen: 850 times

Last updated: Jan 21 '16