davesnowdon / naoutil

A project containing useful utility code for NAO developers (mostly in python). Includes support for i18n and JSON serialisation of arbitrary classes
GNU Lesser General Public License v3.0
9 stars 6 forks source link

Memory callbacks appear to be broken #28

Closed davesnowdon closed 10 years ago

davesnowdon commented 11 years ago

At least this seems to be the case on Fedora18 when the broker is started using an IP address (if I don't use an IP address my robot is not located).

I can reproduce this in the python shell (which previously worked)

from naoutil import broker myBroker = broker.Broker("testy", nao_id="192.168.0.71", nao_port=9559) def my_event_callback(data_name, value, message): print 'Event', data_name, value, message memory.subscribe_to_event('RightBumperPressed', my_event_callback)

davesnowdon commented 11 years ago

In my environment avahi.find_all_naos() returns an empty list

davesnowdon commented 11 years ago

Noticed that my code was using the old memory.subscribeToEvent() function and changed that to use subscribe_to_event() instead but so far no joy.

davesnowdon commented 11 years ago

Having been checking out old versions of the code: at revision 4e2490a it is definitely working and at revision 43f177b it is definitely broken - I get a message that the subscriber module is starting but do not get any events.

davesnowdon commented 10 years ago

For NAO recorder I've reverted the changes to memory.py and init.py and that has got things working again. When I have more time I'll work out exactly why it was broken.

rendeekburns commented 10 years ago

same experience here. rolled back the revision and events work again

davesnowdon commented 10 years ago

Finally got around to fixing this - sorry it took so long. The root cause appears to be that NAOqi can't handle callbacks with names starting with _

AxelVoitier commented 10 years ago

Wow O_O. Thank you for spotting this!

AxelVoitier commented 10 years ago

Looking at the doc I am seeing this is not a documented limitation. I will signal this to Aldebaran.

How did you found it actually?

davesnowdon commented 10 years ago

I did a diff of all the changes between the working and broken versions. I ran my snippet of code that demonstrated the issue while observing the tail of the naoqi log on the robot and watching for errors and repeated this several times until I was able to isolate the cause.