# Global planner not updating path [closed]

Hello,

I am using Ubuntu 16.04, ROS-kinetic to run the navigation stack (with global_planner and teb_local_planner) on a Youbot (on Gazebo).

Although I am able to send goals and get them executed properly, I have issues under the following scenario (configuration data follows):

When I add an obstacle(unmapped) into the environment(mapped), say blocking a certain path (alternative path available), and give a goal beyond the obstacle. I am running a rolling window for the local planner here, and the alternate path is not covered in the local costmap.

The issues I face:

Case 1: using obstacle layer in global costmap and local costmap: As soon as my laserscan detects the obstacle, marking of the global costmap starts and the planner issues a new global path upon sensing blocked path. Here, obviously the obstacle "avoidance" is being done by the global planner instead of the local planner.

Case 2: using obstacle layer only in the local costmap: The global costmap stays oblivious to the obstacle and upon reaching the blocked path, the local planner starts trying to look for alternative paths while the global planner directs it to continue moving along this path( since it is still unaware of obstacle). [Here, I believed that if unsuccessful in finding the path even after recovery behaviour, the global planner would issue a viable path. However, it never reaches even recovery stage as the local planner keeps probing the rolling window for trajectories.] As mentioned earlier, upon blocking this path, the alternative route is too far away to be included in the local costmap window [It achieves this when the window size is increased, but that takes up too much system processing for me to consider.] and the robot gets stuck.

Is it ok to stick with Case 1 and lower local planner's utility or Case 2 can be improved to cause global planner to take information from local costmap to replan when needed? or would some other plan of action be better?

I did read up similar questions like this one here. However, increasing the planner frequency doesn't seem to have any effect as probably the global planner still does not consider the path blocked?

I also came across this which suggests that a 'false' returned from computeVelocityCommands from localplanner would force globalplanner to consider an alternative route? Considering this, is there a way to allow 'max_controller_retries' after which the local planner would give up and issue this 'False'?

Thanks

The configuration files:

---> move_base_params

oscillation_distance: 0.1
oscillation_timeout: 5.0
base_global_planner: "global_planner/GlobalPlanner"
planner_frequency: 10.0
planner_patience: 1.0

base_local_planner: "teb_local_planner/TebLocalPlannerROS"
controller_frequency: 10.0
controller_patience: 15.0

shutdown_costmaps: true
clearing_rotation_allowed: false

recovery_behaviours:  [{name: potential_field_recovery, type: potential_field_recovery/PotentialFieldRecovery},{name: aggressive_reset, type: clear_costmap_recovery/ClearCostmapRecovery}]
aggressive_reset:
reset_distance: 0.5
layer_names: ["obstacle_layer"]


--> global_costmap_params : set for Case1

global_costmap:

global_frame: /map
robot_base_frame: base_footprint
update_frequency: 4.0
publish_frequency: 2.0
static_map: true
resolution: 0.05
cost_scaling_factor: 10.0

transform_tolerance: 3.0
plugins:
- {name: static_layer,            type: "costmap_2d::StaticLayer"}
- {name: obstacle_layer,          type: "costmap_2d ...
edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by harshal close date 2020-11-04 06:53:55.810272

Hi. Did you find a proper setup to have the global planner take the blocked path into consideration? I have tried very similar settings as yours, but it does not work as intended, especially the static layers for the local costmap makes the costmap non-functional.

( 2020-10-24 05:55:08 -0500 )edit

Hi, I carried on with keeping the obstacle layer in the global costmap as well. Turning the global planner frequency to 0.0 makes the planner use only the data available at plan time, and lets the local planner carry on the "dynamic" obstacle avoidance for anything not reflected in the initial plan. As for the local planner, I let the local planner fail after some tries and this triggers the global planner to plan around the obstacles sanely.

I do still have the static layer in my current local costmap setup (needed). Could you elaborate as to what a non-functional costmap means in your case?

P.S.: This strategy is likely to fail for larger obstacles. Depending upon your configuration, the local planner might continuously keep trying to look for new paths. So if you have a local planner struggling unrelentingly(no timeouts or max no. of attempts, etc ...(more)

( 2020-10-30 08:58:25 -0500 )edit

Sort by » oldest newest most voted

The behaviour you are describing is what I would expect for the given config.

As long as you do not use the obstacles layer with the global costmap, it has no way in knowing the current path is not feasible. Even if you trigger recovery behaviors, the map will be pretty much the same, so the global plan is unlikely to change.

"Is it ok to stick with Case 1 and lower local planner's utility or Case 2 can be improved to cause global planner to take information from local costmap to replan when needed? or would some other plan of action be better?"

Yes, it is ok to use Case 1. If you want to "increase the utility" of your local planner, you can try to reduce the global planner frequency (but with obstacles layer active) to something like 0.1Hz, so you will allow the local to try to find an alternative, before replanning the global path.

It is hard to envision any improvements in case 2. What you are proposing pretty much falls into activating the obstacle layer in global costmap. The best I can think of is writing an external node that activate or deactivate the obstacle layer in global costmap according to some info from your local planner. But I do not see the advantage on that.

more

Hi, Thank you for the answer. I had just been testing setting planner frequency to (actually) 0.1 Hz. Actually if the obstacle is detected in the 10th second or so, it amounts to case1 itself & of course there is no way of controlling the detection! But still worth the change, I believe!

( 2018-03-06 08:24:57 -0500 )edit

And I had not thought about the fact that even after recovery, map remain the same (original), so nothing should prompt the global planner to change path!!

( 2018-03-06 08:25:57 -0500 )edit