Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Canceling an action synchronously #2449

Open
akir94 opened this issue Mar 13, 2024 · 2 comments
Open

Canceling an action synchronously #2449

akir94 opened this issue Mar 13, 2024 · 2 comments
Assignees
Labels
more-information-needed Further information is required

Comments

@akir94
Copy link

akir94 commented Mar 13, 2024

Feature request

Feature description

Currently, an action server's handle_cancel can only return ACCEPT and move the state to CANCELING. If the server has no cleanup to wait for, it still has to cancel the goal asynchronously, which is inconvenient.

This could be improved by adding a new return value, ACCEPT_AND_CANCEL, that would have similar behavior to returning ACCEPT_AND_EXECUTE from handle_goal.

@fujitatomoya
Copy link
Collaborator

I am not sure the original design, but it looks like canceled is expected to be called on user application with progress report since it is likely that action is in progress when it tries to cancel. on the other hand, it can be up to user application if it returns ACCEPT_AND_CANCEL and then call _canceled internally? but what if _canceled failed after _cancel_goal? probably we need to change cancel service interface to return the response that says it is now canceling, but could not be canceled. may be i am missing something...

@fujitatomoya fujitatomoya self-assigned this Mar 21, 2024
@fujitatomoya fujitatomoya added the more-information-needed Further information is required label Mar 21, 2024
@akir94
Copy link
Author

akir94 commented Apr 3, 2024

You're right, I forgot handle_cancel needs to return a result. This probably can't be done without big API changes.
I guess I can get the behavior I want by creating a timer with a callback that will call canceled with the correct result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-information-needed Further information is required
Projects
None yet
Development

No branches or pull requests

2 participants