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

Alternate solution for one-shot-subscribe (#666 and #667) #725

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Affonso-Gui
Copy link
Member

Class-closures are a good way for creating closures with global scope in eus9.
However, when rethinking about #666 and #667, I have reached the conclusion that simply enforcing local closures should be enough for dealing with the one-shot-subscribe function.

We can do that by:

  1. Forcing unsubscribe with unwind-protect
  2. Blocking function calls which are done from an incomplete preempted state (i.e. without reset'ing and running the cleanup)

With this change:

1. (one-shot-subscribe ...) -> C-c -> (one-shot-subscribe ...)  ;; [ERROR] please unsubscribe
2. (one-shot-subscribe ...) -> C-c -> (ros::unsubscribe ...) -> (one-shot-subscribe ...)  ;; ok
3. (one-shot-subscribe ...) -> C-c -> (reset) -> (one-shot-subscribe ...)  ;; ok
4. (one-shot-subscribe ...) -> C-c -> (reset) -> (ros::spin-once)  ;; ok

This has minimal changes to the current implementation and is compatible with both eus9 and eus10.

@708yamaguchi @tkmtnt7000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant