osrf / rmf_core

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

Cancel queued tasks #274

Closed Yadunund closed 3 years ago

Yadunund commented 3 years ago

This PR enables cancellation of of a queued task. Support for cancelling an active task is left for future work.

Details of the implementation: When a DispatchRequest message with CANCEL method is received by the fleet adapter, it simply re-plans the assignments of all the queued tasks while ignoring the task to be cancelled. The new set of assignments thus will not contain the task to be cancelled. The new assignments are then written to the TaskManager queues thereby effectively "cancelling" the requested task. Along the way several checks are included to ensure that the task to be cancelled, actually exists in a queue and is not active.

Lastly this PR introduces a DispatchAck message which is published by the fleet adapter in response to a received DispatchRequest message. The new message conveys whether the addition or cancellation of a task was successful.

TODO:

Yadunund commented 3 years ago

Thank you for the review @mxgrey! I believe @tanyouliang95 is working on refactoring rmf_task_ros2 so as to move a lot of the logic into rmf_task in a separate PR as recommended.