Decline new goals in Action Server
I'm looking for an implementation of Actionlib which declines new incoming goals, if the system is already busy completing a previous goal. The default behaviour of SimpleActionServer is instead to cancel current goals and replace them with the newly arrived goal.
Is there a ready-to-use python implementation of such Actionlib server? Similar questions have been asked many years ago, but I've not been able to find any answer.
Accepting (or rejecting) goals is the server's responsibility, not the client.
But re: it preempts the current goal: that's because it's a simple action server. Part of that is the reduced complexity of handling only a single goal, on both ends.
Afaik there have been no changes to the base
actionlib
implementation in this area. Either the simple action server is used, or implementers are responsible for using the full API, which allows you to do anything needed.There may be 3rd party implementations which sit between the simple version and the full, base
actionlib ...
(more)(Perhaps everywhere you've used client it should be server?)
Take a look at #q240056, which did include a link to the code but is now a 404. However, the OP seems to have made enhancements to
goalCallback()
function to get the desired result.There's also an open ticket to expose
setRejected
, but doesn't look like anything's gonna be done about it.The comments under the accepted answer to #q349636 suggest using locks.
Coming back to your question "Is there a ready-to-use python implementation of such Actionlib client?", you'll probably have to look around quite a bit.
Exactly, I'm looking for one of those 3rd party implementations to avoid reinventing the wheel.