rospy exception: 'NoneType' object is not callable [closed]
I am running ROS on a Gumstix Overo. Python code that works on X86 throws an exception:
Exception in thread /lrs_quadconnect/0/queue_info (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
File "/usr/lib/python2.6/threading.py", line 484, in run
File "/opt/ros/fuerte/lib/python2.6/dist-packages/ros_comm-1.8.9-py2.6.egg/rospy/impl/tcpros_pubsub.py", line 174, in robust_connect_subscriber
File "/opt/ros/fuerte/lib/python2.6/dist-packages/ros_comm-1.8.9-py2.6.egg/rospy/impl/tcpros_base.py", line 752, in receive_loop
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
Any ideas if this is a bug in the ROS python code or my bug? Is there a work around?
The Python code is a client that that listen on a topic to see when a task is finished. When the task is finished the Python script just ends. When I added a sleep before ending the exception did not occur. Here is the function that is executed just before the script is ended (and this function is finished):
def wait_for_flyq(unit):
rospy.init_node('queues_run_client', anonymous=True)
run_finished = 0
while (not run_finished):
qi = rospy.wait_for_message ("/lrs_quadconnect/{0}/queue_info".format(unit),
LQQueueInfo, timeout=None)
if qi.queue == 0:
print "QUEUEINFO: ", qi.queue, " - ", qi.index
if qi.queue == 0 and qi.index < 0:
run_finished = 1
Doing a time.sleep(5) before exiting seemed to solve the problem. But that cannot be the correct solution...
Can you give a little more info on the code you're trying to run?
Some more info added. Any more info that can be useful?
How about the actual lines of python code (:
Yeah, I know that the best things is to give all the code. But I cannot do that. And even if I could I think most of the code is irrelevant... But I was wrong as you see above. I polled a topic.