moveit2 icon indicating copy to clipboard operation
moveit2 copied to clipboard

[Planning Pipeline] Make planning pipeline respect the max. planning time

Open sjahr opened this issue 7 months ago • 4 comments

Planning time is currently checked in the planner plugin under the assumption that this is the only process time in the pipeline that consumes a meaningful amount of time. This assumption was wrong and got even more invalidated with the recent refactoring that enables chaining planners.

Planning time should be measured and tracked at the pipeline level when the planning algorithms are called

sjahr avatar Dec 06 '23 22:12 sjahr

This issue is being labeled as stale because it has been open 45 days with no activity. It will be automatically closed after another 45 days without follow-ups.

github-actions[bot] avatar Jan 22 '24 12:01 github-actions[bot]

Hi @sjahr, I'm interested in working on this issue and have several questions regarding the requirements:

  1. Should we take the request and response adapter processing time into account?
  2. For chained planners, how should we distribute the allowed_planning_time among all planners? It seems to be not optimal if we just let the previous planner use up all the available time. Maybe the planners can share the available time evenly?

For implementation details, it seems like we can directly modify the allowed_planning_time before passing it into the planner here so that we don't need to add extra parameters to the planning request. Does this solution sound viable to you?

TomCC7 avatar Feb 11 '24 15:02 TomCC7

@TomCC7 Thanks for your interest! Feel free to open a WIP PR with your proposed changes and we can discuss based on the code. Regarding your questions:

Should we take the request and response adapter processing time into account?

Yes! That is one of the biggest shortcomings of the current implementations. Planning time should be the sum of each pipeline component's processing time.

For chained planners, how should we distribute the allowed_planning_time among all planners? It seems to be not optimal if we just let the previous planner use up all the available time. Maybe the planners can share the available time evenly?

That's a good question. For a first implementation I would propose a naive time distribution: e.g. evenly distributing the time between the planners. The planners usually require significantly more time than the adapters with the current implementations that's why I think we can give each adapter the full remaining budget and it is very unlikely that a large fraction of it is used.

For implementation details, it seems like we can directly modify the allowed_planning_time before passing it into the planner here so that we don't need to add extra parameters to the planning request.

Yes that's a good idea. Make sure that we manage the remaining budget on the pipeline level. So if planner A is quicker than the max. allowed planning time, the "gained" time can be distributed to the other planners. The exact approach to distribute the time can be discussed in the PR itself. I am pretty sure other maintainers have ideas there too

sjahr avatar Feb 13 '24 10:02 sjahr

Thanks for replying! I'll work on this then

TomCC7 avatar Feb 13 '24 22:02 TomCC7