ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

how is rosh's ok() different from rospy.is_shutdown()?

asked 2011-07-08 07:54:27 -0500

updated 2014-01-28 17:10:00 -0500

ngrennan gravatar image

Specifically, what's the difference with how they handle a KeyboardInterrupt/SIGINT?

I would expect these two snippets to act the same, but they don't:

#!/usr/bin/env python
import rospy
r = rospy.Rate(10)
while not rospy.is_shutdown():
    print 'ok...'


#!/usr/bin/env rosh
r = Rate(10)
while ok():
    print "ok..."

The first example exits on Ctrl+C, but the second does not. What am I missing?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2011-07-08 10:01:46 -0500

kwc gravatar image

Most likely this is a bug in rosh. Can you file a ticket here with exact details on how you run your rosh sample?

In general, rosh tries to handle SIGINT differently so that it can be used in an interactive interpreter. rosh is not as tested when running outside of iteractive mode.

edit flag offensive delete link more


Question Tools


Asked: 2011-07-08 07:54:27 -0500

Seen: 6,578 times

Last updated: Jul 08 '11