Skip to content

How should the Destination Server support priorities between robots? #1

@mxgrey

Description

@mxgrey

The most basic implementation of the Destination Server would just assign destinations on a first-come-first-serve basis, which is what the old Open-RMF reservation system currently does. This might not be suitable in cases where some robot tasks are higher priority than others.

An example is if one robot is fetching linens while another robot is fetching medications from the same supply closet. The medications might be higher priority than the linens to the point that fetching the linens should be intentionally delayed in order to ensure the medications are delivered as quickly as possible.

The question is, how should this prioritization be expressed?

Simple integer

A common way to express competing priorities in a distributed system is with an integer priority level. In this case we'll suppose a higher integer value means a higher priority.

Usually in such a priority scheme, higher priority items completely trump lower priority items no matter how large the difference in their priority levels. In the supply closet example, this means fetching the linens could be given a priority level of 1 while fetching medications could be given a priority level of 2, and this would be exactly the same as if linens had a priority of 1 and medications had a priority of 10000.

In this kind of priority scheme, typically anything of a lower priority must completely give way to anything of a higher priority, even if the difference is only 1, and no matter what other circumstances may be ongoing. This means we should expect the robot fetching the linens to always be diverted to give way for the robot fetching medications, even if the linens are just about to be picked up while the robot coming for the medications is still very far away.

While this makes it relatively simple to reason about priority levels and what to expect based on how they're assigned, this easily leads to outcomes that aren't really optimal.

Cost-based Priority

An alternative way to reason about priorities is in terms of makespan cost. We could consider what it would cost the makespan of the overall operation to give priority to a certain task over others, and then the priority level of a task can be based on how much of that added makespan cost we are willing to absorb (ignore) in order for the task to be prioritized.

For example if we measure the makespan cost in seconds, then a prioritization cost of 600.0 would effectively say "It is preferable to delay other tasks by up to 10 minutes in total in order to prioritize this task."

We could also put a lower bound on this such as a prioritization tolerance of 30.0 could mean "I am willing to wait up to 30s to allow other tasks to finish before I take priority from them."

I suspect these cost bounds will be better at reflecting the real intention behind the prioritization than a simple integer representation of priority. We could still consider using integers as a tie breaker in cases where multiple agents simultaneously have elevated priorities.

Where to represent this?

Besides how to represent priorities we should also consider where it should be represented.

One option could be to include it in certain messages such as DestinationGoal.msg. However I can think of two issues with that:

  • Are we confident enough that this priority scheme is general enough to always be how deployments will want to represent priority?
  • What about other places where prioritization may have an impact, such as traffic planning? Do we then need to weave this priority information through the whole chain of messages?

Instead we could consider having a ~/priority topic per robot and then publishing this priority information there to be consumed by both the Destination Server and the Traffic Planning Server. Whenever a priority update occurs, each of these servers should recalculate their current plans to account for this new prioritization.

If we use this structure, we will probably want the priority message to include a session ID that associates it with the original goal message.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions