-
Notifications
You must be signed in to change notification settings - Fork 141
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
fixed ctrl+C on a concurrence container #35
Conversation
…ate -- may or may not be a good idea
As this PR stands, it has one new busy loop that will easily soak up 100% cpu while the concurrence is executing, and another one that will do the same while it's waiting for the others to terminate. I agree that the issue is with this line but there's nothing significant about replacing the The right way to fix this is to have every |
So what function is handling the SIGINT for a concurrence? |
In |
For non-ros use, you can register your own |
(: This would be a nice improvement and could get rid of any other loops that exist simply to check |
I agree that sounds better. However I can't seem to get it to work leaving in the that line. It seems like it's blocking the main thread? Nor does simply checking for smach.is_shutdown() in the state seem to break execution with it in. |
It was blocking the main thread, which ros uses to update signals like sigint and callbacks. I added a starting function which will spin up a state in another thread and handlers for shutdown. To start so it doesn't block you can just do smach_ros.start(sm), where sm is the state you want tot start. |
I also removed the smach.is_shutdown loop in concurrency since it didn't seem necessary any more. All states should now be preempting themselves by default on shutdown and therefore terminate, but I can add it back in if you think it breaks old code. |
We decided not to go with smach for our use case, so I'm closing this. |
I'd still like to merge this in with some testing on my end. So I'm going to leave it open, feel free to unsubscribe if you want, though. |
Closing in favor of #49 |
This change is