-
Notifications
You must be signed in to change notification settings - Fork 914
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
Shutdown rospy timers cleanly #690
Conversation
Note - to reproduce, these exceptions are only getting thrown in the simulation branch of that sleep function. I am getting them when simulating with gazebo. |
Test passed. |
except rospy.exceptions.ROSInterruptException as e: | ||
if rospy.core.is_shutdown(): | ||
break | ||
else: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the else
line since it is not necessary.
Timers go off and start periodically running in the background, and will throw exceptions when ros shutdown occurs because of the sleep function. These are impossible to catch as they're off in a background thread and can be cleanly handled as in the code change. Others with the same problem: * [baxter examples](RethinkRobotics/baxter_examples#48)
Test failed. |
Test passed. |
Failed because of the rebase? |
r.sleep() | ||
except rospy.exceptions.ROSInterruptException as e: | ||
if rospy.core.is_shutdown(): | ||
break |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the update there was a raise
line in here. My previous comment only referred to the else
line. I think the raise
still needs to stay otherwise this function changes behavior significantly.
Thanks for the patch. Cherry-picked with my previous comment: 2e84880 |
Faster than I was....thanks |
Timers go off and start periodically running in the background, and will throw exceptions when ros shutdown occurs because of the sleep function.
These are impossible to catch as they're off in a background thread and can be cleanly handled as in the code change.
Others with the same problem: