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

Global Planning and Stop Replanning

asked 2021-07-30 06:19:02 -0600

bfdmetu gravatar image

updated 2021-07-30 06:19:25 -0600

I have a ros robot working on Melodic devel.

When i start navigation, my robot generates global plan. When the robot see any obstacle in global plan, Robot replans the path and try to escape obstacle. It is normal behavior.

What I would like to do is to get the robot to stop if there is any obstacle in its global path. In this case, either the obstacle moves and the robot again continues to move towards the goal along the original path or the obstacle doesn't move and the robot keeps staying in its position.

Is there any parameters related about that? Or how can we do that ?

edit retag flag offensive close merge delete


With move_base I don't see how and personally I also don't see why you want that. But maybe move_base_flex can do that with a custom state machine. You might also need to tell the local planner to stop replanning.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2021-08-01 02:11:49 -0600 )edit

2 Answers

Sort by » oldest newest most voted

answered 2021-07-30 09:37:53 -0600

Werewolf_86 gravatar image

updated 2021-07-30 22:31:07 -0600

Actually, i wanted to do the reverse :) My robot just stops when a dynamic obstacle is detected along the way. Was wondering how i change the behavior to recompute the plan and move past the obstacle through an alternate route. Which local planner are you using ? I'm using DWA. These are my parameters:

  # Robot configuration parameters
  acc_lim_x: 0.1
  acc_lim_y: 0
  acc_lim_theta: 1.0
  acc_lim_trans: 0.15
  max_vel_x: 2.0
  min_vel_x: 0.001
  max_vel_y: 0
  min_vel_y: 0
  max_vel_trans: 2.0
  min_vel_trans: 0.001
  max_vel_theta: 1.0
  min_vel_theta: 0.0

  # Goal Tolerance Parameters
  yaw_goal_tolerance: 0.3
  xy_goal_tolerance: 0.1 #0.2
  latch_xy_goal_tolerance: false

  # Forward Simulation Parameters
  sim_time: 4.0
  sim_granularity: 0.02
  vx_samples: 20
  vy_samples: 1
  vth_samples: 50

  # Trajectory scoring parameters
  path_distance_bias: 4.0
  goal_distance_bias: 0.05
  occdist_scale: 3.0
  forward_point_distance: 0
  stop_time_buffer: 0.2
  scaling_speed: 0.25 
  max_scaling_factor: 0.2
  oscillation_reset_dist: 0.25
  publish_traj_pc : true
  publish_cost_grid_pc: true
edit flag offensive delete link more


I think you should decrease sim_time and path_distance_bias. TrajectoryPlannerROS # for details see:

acc_lim_x: 0.6
acc_lim_theta:  0.9
max_vel_x: 0.55
min_vel_x: -0.5

max_vel_theta: 0.55
min_vel_theta: -0.55
min_in_place_vel_theta: 0.8    
holonomic_robot: false
escape_vel: -0.2
yaw_goal_tolerance: 0.4         
xy_goal_tolerance: 0.4
latch_xy_goal_tolerance: false
sim_granularity: 0.025
angular_sim_granularity: 0.025
vx_samples: 20                       
vtheta_samples: 20
meter_scoring: true            
path_distance_bias: 0.6 
goal_distance_bias: 0.8          
occdist_scale: 0.01              
heading_lookahead: 0.325 
oscillation_reset_dist: 0.05
bfdmetu gravatar image bfdmetu  ( 2021-08-05 02:57:44 -0600 )edit

answered 2021-08-01 18:57:48 -0600

miura gravatar image

Assume that the planner_frequency is 0.0 and the obstacle escape is done by global plan replanning.

In that case, it should be possible to stop (abort) the robot by obstacle detection by setting recovery_behavior_enabled to false. You may also need to empty the list of recovery_behaviors.


edit flag offensive delete link more


From the linked documentation:

 If the frequency is set to 0.0, the global planner will only run when a new goal is received or the local planner reports that its path is blocked.

so I read that planner_frequency does not help here. The recovery behaviors are for the case that no plan is found, but from what I have read in the question the goal is to stop when an obstacle is on the original planned path.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2021-08-03 00:14:32 -0600 )edit

local planner may determine that the path is blocked because "an obstacle is on the planned path". Therefore, I think that we may be able to achieve this goal.

miura gravatar image miura  ( 2021-08-03 18:27:11 -0600 )edit

Doubt. Unless you try e.g. pose_follower as local planner it constantly replans and if only the direct path is blocked it will find another path. Only if all allowed motions are blocked it does go to recovery.

Humpelstilzchen gravatar image Humpelstilzchen  ( 2021-08-04 00:30:13 -0600 )edit

I expected from the following that all the local planners might be blocked and the recovery might be replanning.

When i start navigation, my robot generates global plan. When the robot see any obstacle in global plan, Robot replans the path and try to escape obstacle.

In that case, the answer is that it would be possible to stop it by stopping the recovery. Depending on the situation of @bfdmetu's robot, this response may not be a solution.

miura gravatar image miura  ( 2021-08-04 18:47:49 -0600 )edit

ah ok I read the question wrong then. I read "escape obstacle" as "evade obstacle" not as "running recovery"

Humpelstilzchen gravatar image Humpelstilzchen  ( 2021-08-05 00:30:31 -0600 )edit

Thank you for your answer. When i set the planner_frequency=0.0, global plan stop make a new plan. However Local planner try to escape obstacle. After that i set planner_frequency=0.0 and increase the path_distance_bias 2.2 , robot try to find suitable path but could not find so stop moving. Today i will continue at that point.

bfdmetu gravatar image bfdmetu  ( 2021-08-05 03:20:32 -0600 )edit

Question Tools



Asked: 2021-07-30 06:19:02 -0600

Seen: 802 times

Last updated: Aug 01 '21