rospy exception: 'NoneType' object is not callable [closed]

asked 2012-06-10 09:14:28 -0500

TommyP gravatar image

updated 2014-01-28 17:12:37 -0500

ngrennan gravatar image

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/", line 532, in __bootstrap_inner
  File "/usr/lib/python2.6/", line 484, in run
  File "/opt/ros/fuerte/lib/python2.6/dist-packages/ros_comm-1.8.9-py2.6.egg/rospy/impl/", 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/", 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
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2014-12-24 11:20:23.428618


Doing a time.sleep(5) before exiting seemed to solve the problem. But that cannot be the correct solution...

TommyP gravatar image TommyP  ( 2012-06-10 09:20:41 -0500 )edit

Can you give a little more info on the code you're trying to run?

jbohren gravatar image jbohren  ( 2012-06-10 09:38:31 -0500 )edit

Some more info added. Any more info that can be useful?

TommyP gravatar image TommyP  ( 2012-06-10 10:30:06 -0500 )edit

How about the actual lines of python code (:

jbohren gravatar image jbohren  ( 2012-06-10 10:48:26 -0500 )edit

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.

TommyP gravatar image TommyP  ( 2012-06-10 11:57:17 -0500 )edit