Re: [ros-users] handling multiple topics in Python

Forside
Vedhæftede filer:
Indlæg som e-mail
+ (text/plain)
Slet denne besked
Besvar denne besked
Skribent: Brian Mayton
Dato:  
Til: ros-users
Nye-emner: [ros-users] Video streaming node
Emne: Re: [ros-users] handling multiple topics in Python
On Apr 15, 2010, at 10:59 AM, Blaise Gassend wrote:

> Also, if you are using threads, SIGINT will only kill one of them even
> without rospy. You have to make sure that each thread exits after a
> KeyboardInterrupt (or after rospy.is_shutdown() goes true in the case of
> rospy).



You can also call .isDaemon(True) on the threads when you create them. Threads that are marked as "daemon" threads will automatically exit when there are no non-daemon threads remaining (e.g. the main thread has exited after a SIGINT.)