Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Stateful event callbacks?

Aperta
#809 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python
Ambito
devtools

Direzione di ricerca

Inizia dal comportamento del gestore dell’evento OnProcessExit descritto nell’issue, quindi esamina come funzionerebbero lo stato del callback e il ciclo di vita quando vengono definiti in un launchfile. Confronta le opzioni stateful-callback e topic-publication e considera l’interazione con OnShutdown; done dovrebbe fornire un modo per aggregare i fallimenti dei processi senza mostrare ripetutamente popup bloccanti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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?

Lingua principale
Python
Stelle
155
Fork
189
Merge medio
3g 22h
PR unite (30g)
21

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ros2/launch

Tutte le issue di ros2/launch

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.