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:
Update the Dispatcher node to publish a new BidNotice only after receiving the DispatchAck for the previous bid.
Update the Dispatcher node to cull cancelled tasks from its task registry.
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.
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 withCANCEL
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 theTaskManager
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 receivedDispatchRequest
message. The new message conveys whether the addition or cancellation of a task was successful.TODO:
Update the Dispatcher node to publish a newBidNotice
only after receiving theDispatchAck
for the previous bid.Update the Dispatcher node to cull cancelled tasks from its task registry.