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

Stateful event callbacks? #809

Open
TSNoble opened this issue Nov 16, 2024 · 0 comments
Open

Stateful event callbacks? #809

TSNoble opened this issue Nov 16, 2024 · 0 comments

Comments

@TSNoble
Copy link

TSNoble commented Nov 16, 2024

Feature request

(This is more of a series of question, but ros-answers seems to be down currently)

Problem

Most of our nodes are required, and on shutdown, I'd like to detect any unsuccessful exit codes and display a popup with a link to support for our software (essentially a kind of crashpad background service). I'm wondering if this is possible using OnProcessExit event handlers within roslaunch.

I've tried a few adding OnProcesExit event handlers to our top-level launch construct but, since the callback is stateless, this displays a popup for every failed process. These popups are also blocking, which then causes SIGINT escalation, leading to more popups for the nodes that were blocked on shutting down.

Feature description

  • Adding the ability to use stateful callbacks OR
  • Adding the ability for a callback to publish to a topic, so a node can handle the state.

Implementation considerations

  • I've considered creating a custom node which launches outside of our main launchfile to keep state, but this relies on being able to publish the OnProcessExit information within the event handler callback. This also feels like a lot of un-necessary boilerplate on the node side.

  • I'm wondering if it's already possible to implement stateful callbacks by defining a class in the launchfile and using a method as the callback, but I'm unsure where this class would be instantiated and what its lifecycle would be tied to

  • Alternatively, I'm wondering if it's possible to achieve the above by using a reentrant function as the callback for collecting the state, and a separate event handler (OnShutdown?) to terminate the function and use the results?

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

No branches or pull requests

1 participant