ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Navigation stack dwa local planner crashes into dynamic obstacles

asked 2020-09-11 06:25:40 -0500

Yehor gravatar image

updated 2022-08-07 08:53:28 -0500

lucasw gravatar image

Hello,

I have been struggling with dwa local planner and navigation stack mote than 3 months and still can't get it to work. I achieved static navigation without obstacle layer, however, dynamic obstacle avoiding still doesn't work. I have tried almost all parameters with dynamic reconfigure in rqt but the robot still moves very bad. I have attached several videos recorded of my robot motion, please check.

If someone has the suggestion, what can I do to fix it, could you help. Thank you in advance!

Video

https://youtu.be/Res6o5SKb2Y --- Test 1

https://youtu.be/jmpQeBW1zyc --- Test 2

EDIT 1

This is my dwa yaml file:

DWAPlannerROS:

  max_vel_x: 0.8 
  min_vel_x: 0.2 

  max_vel_y: 0.0  
  min_vel_y: 0.0  

  max_trans_vel: 0.8 
  min_trans_vel: 0.2 
  trans_stopped_vel: 0.1

  max_rot_vel: 1.0
  min_rot_vel: 0.4 
  rot_stopped_vel: 0.4

  acc_lim_x: 1.5
  acc_lim_theta: 3.5
  acc_lim_y: 0.0

# Goal Tolerance Parameters
  yaw_goal_tolerance: 0.15 
  xy_goal_tolerance: 0.15
  latch_xy_goal_tolerance: true

# Forward Simulation Parameters
  sim_time: 4.0    
  vx_samples: 8      
  vy_samples: 1
  vtheta_samples: 30

# Trajectory Scoring Parameters
  path_distance_bias: 24.0   
  goal_distance_bias: 24.0    
  occdist_scale: 12.0            
  forward_point_distance: 0.325 
  stop_time_buffer: 0.2        
  scaling_speed: 0.25           
  max_scaling_factor: 0.2       

# Oscillation Prevention Parameters
  oscillation_reset_dist: 0.1 

# Debugging
  publish_traj_pc : true
  publish_cost_grid_pc: true
  global_frame_id: odom

  holonomic_robot: false

EDIT 2

https://www.youtube.com/watch?v=4K-w7... -- Test 3

https://www.youtube.com/watch?v=cKKh0... -- Test 4

I have changed sim_time to 1 sec.

edit retag flag offensive close merge delete

Comments

Test2: What kind of robotbase are you using? diff drive? It seems the base is actually not following the path much of the time?! What is represented by the arrow with the magenta tip? Is this a real robot? If yes, do you maybe have an issue with getting the motorcontroller mcu's updating?

Dragonslayer gravatar image Dragonslayer  ( 2020-09-11 08:23:26 -0500 )edit

@Dragonslayer I am using my custom diff drive robot. The arrow with the magenta tip it is just for 2d Nav Goal Button in rviz.

It is my custom real robot. What is motorcontroller mcu's updating?

Yehor gravatar image Yehor  ( 2020-09-11 09:59:43 -0500 )edit

@Dragonslayer Actually yes, sometimes the robot does not follow the local plan. Could it be because of the low acceleration limits for the driver?

Yehor gravatar image Yehor  ( 2020-09-11 10:01:12 -0500 )edit

Yes the big magenta arrow is nav goal, but there is another arrow with a magenta tip, originating from base_link frame.

The PID thing is complex and if you didnt tune and program it yourself it shouldnt be the issue. But you might want to check if the documentation says anything regarding max frequency and then have a look if you maybe publish to fast.

Maybe you could post your dwa param .yaml ... I dont think its the acceleration limits alone, it seems to stop updating/reacting to the commands, and then after a stop NULL command is received, it seems to start working again for some time. Either move_base isnt updating cmd_vel, which is unlikely, or the hardware interface stops sending commands, or finally the microcontrollers (used as MCU motor control unit) hang somehow.

However the local plan trajectories seem now to do what you want. Seems my suggestion ...(more)

Dragonslayer gravatar image Dragonslayer  ( 2020-09-11 10:24:56 -0500 )edit

@Dragonslayer I understood, this arrow is from tf. (tf relation)

What exactly publish too fast ?? Max frequency of odometry?

I will post the dwa .yaml file.

Yes, it starts to look better trajectories when I change occdist to 12.0 with path and goal dist to 24.0

Yehor gravatar image Yehor  ( 2020-09-11 10:30:33 -0500 )edit

Whats your hardware setup? I assume some sbc or pc for ros and some micrcontroller for motor control. The hardware interface is the software that takes the ros data and "somehow" sends it out the main computer to the microcontrollers, those then do something with the data (often PID) and make the actual motors move. The frequency of the communication between main computer and microcontroller (hardware interface) is what Iam talking about, it can be very limited.

Dragonslayer gravatar image Dragonslayer  ( 2020-09-11 10:36:43 -0500 )edit

@Dragonslayer I have added dwa parameters, could you please check them

Yehor gravatar image Yehor  ( 2020-09-11 11:34:22 -0500 )edit

I dont see anything obviously bad about the parameters. But as mentioned in an earlier post, it now seems there is a communication problem downstream of move_base/cmd_vel. What packages are the hardware interface etc. based on, any documentation?

Dragonslayer gravatar image Dragonslayer  ( 2020-09-11 12:17:51 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-09-13 20:45:49 -0500

firstly, decrease sim_time.

4 sec is too high for your environment. DWA will plan an arc path, so a 4-sec arc is not easy to fit in the free space.

Sim_time should be higher for clean environment like a hallway, you could plan for 4 sec.

In a crowded environment, sim_time should be much lower, maybe 1 sec.

Other params can be fine-tuned later.

edit flag offensive delete link more

Comments

@tianb03 Hello, I have recorded new videos where I have changed the sim_time to 0 as you suggested. However, as you can see on the video sometimes it moves ok, but sometimes not((

Do you have ant other suggestions?

Also I want to notice that my base is 44cm*35cm and I have used inflation radius to 0.8 and cost_scaling_factor 2.5

Yehor gravatar image Yehor  ( 2020-09-14 06:50:14 -0500 )edit

I saw in video3 your robot moves quite well. There is another problem is that your global planner seems not avoid the obstacle. If this is intended then you need to tune path_distance_bias, goal_distance_bias and occdist_scale. Or else check your costmap yaml. But this seems is another problem. better checkout the paper first.

tianb03 gravatar image tianb03  ( 2020-09-21 04:39:08 -0500 )edit

@tianb03 The global planner usually crates a good global plan. It shouldn't create global plan to avoid dynamic obstacles (which the obstacle in the middle is), so the global planner creates the straight plane and local should avoid the dynamic obstacle on the way.

I show video 3, because I can't understand why the robot did the path first time very good, but it failed the second time.

Yehor gravatar image Yehor  ( 2020-09-23 08:10:29 -0500 )edit

if you set "marking" to true in the global cost map, then the global planner should plan to avoid the obstacle as well. You may fine-tune DWA to get better behavior. this is quite tricky.

tianb03 gravatar image tianb03  ( 2020-09-29 02:36:30 -0500 )edit

@tianb03@Yehor@lucasw@Dragonslayer Did dynamic obstacle avoidance with dwa_local_planner end up working?

hunterlineage1 gravatar image hunterlineage1  ( 2023-03-24 16:38:34 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-09-11 06:25:40 -0500

Seen: 946 times

Last updated: Sep 14 '20