rospy.sleep doesn't get awaken
Only on one of my machine, this elementary subscribe/publishing tutorial (WritingPublisherSubscriber(python)) doesn't work. In talker.py, thread never returns from rospy.sleep(t)
(t
can be double number). On my other machine this doesn't happen. Any idea?
Environment:
- where problem occurs:
Ubuntu 11.04, electric, Python 2.7.1+
- where does not:
Ubuntu 10.10, electric, Python 2.6.6
Looking at these diff, I just tried to use python
2.6.6 (by downgrading like this), and found no effect.
Source code (exactly the same with the one in the tutorial page):
#!/usr/bin/env python
import roslib; roslib.load_manifest('beginner_tutorials')
import rospy
from std_msgs.msg import String
def talker():
pub = rospy.Publisher('chatter', String)
rospy.init_node('talker')
while not rospy.is_shutdown():
str = "hello world %s"%rospy.get_time()
rospy.loginfo(str)
pub.publish(String(str))
rospy.sleep(1.0)
if __name__ == '__main__':
try:
talker()
except rospy.ROSInterruptException: pass
Update) It also occurred when I use C++ version of the same tutorial.