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

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

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

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

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...'
    r.sleep()

and

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

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
1

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

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?

https://code.ros.org/trac/ros/newticket

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

Comments

Question Tools

Stats

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

Seen: 7,354 times

Last updated: Jul 08 '11