osrf / rmf_core

Provides the centralized functions of RMF: scheduling, etc.
Apache License 2.0
102 stars 41 forks source link

Priority in Task Allocation #278

Closed Yadunund closed 3 years ago

Yadunund commented 3 years ago

This PR aims to introduce the notion of priority in the task allocation framework.

In the proposed method, abstract class rmf_task::Request has a new priority attribute which takes a boolean value (true if high priority). Then, in rmf_task::agv::TaskPlanner, the total cost of a node is multiplied by a priority_penalty (arbitrary large number) if the order of assignments is invalid. Two checks are performed inside valid_assignment_priority(): 1) Check if any agent is not assigned a high priority task while other agents are assigned more than one 2) Within the assignments for an agent, check if the sequence of assigned tasks contains a high priority task after a low priority one. The entry for this function is here. The proposed method works and some tests are included to prove the same.

Opening this PR as a draft to discuss this approach or receive advice on other approaches.

Once the suitable approach is confirmed, I can make changes to rmf_task_msgs to include a priority field and relevant changes to FleetUpdateHandle.cpp

Yadunund commented 3 years ago

Thanks for all the review suggestions @mxgrey. I think I've addressed the remaining points.