Closed ComanderKai77 closed 2 years ago
Hello,
Thank you for your report. Which version of NAOqi are you using, and which version of libqi-python is shipped with it ?
Thank you for your fast response.
I'm using NAOqi v. 2.5.8 (found in /var/log/naoqi/servicemanager/system.Naoqi.log
) and libqi-python v. 3.0.0 (from https://pypi.org/project/qi/).
Please let me know if you need more info.
Are you running libqi-python from your desktop to connect to the robot ?
I'm currently using libqi-python in a debian virtual machine on my desktop.
Okay, can you try passing Python arguments to the Application:
-pepper = qi.Application()
+pepper = qi.Application(sys.argv)
pepper.start()
session = pepper.session
memory = session.service("ALMemory")
then raise the log-level of your application by passing --qi-log-level verbose
to the command-line.
Unfortunately I don't have access to a real robot at the moment so I can't send you the logs until monday but I really appreciate your help.
With the following code we get the error log from below.
import qi
import sys
def touch_event(*args, **kwargs):
pass
pepper = qi.Application(sys.argv, url="tcp://192.168.0.104")
pepper.start()
session = pepper.session
memory = session.service("ALMemory")
subscriber = memory.subscriber("ALTouch/TouchChanged") # throws invalid signature
if subscriber:
subscriber.signal.connect(touch_event)
[W] 1664131647.412879 8 qi.path.sdklayout: No Application was created, trying to deduce paths
[V] 1664131647.415289 8 qi.applicationsession: Connect URL is now: tcp://192.168.0.104:9559
[V] 1664131647.415701 8 qi.applicationsession: Listen URLs are now: tcp://127.0.0.1:0
[V] 1664131647.419556 8 qi.eventloop: start: thread count limits: initial (minimum, maximum) before any adjustment = (-1, 0)
[V] 1664131647.419789 8 qi.eventloop: start: thread count limits: min <- 2 (read from environment variable QI_EVENTLOOP_MIN_THREADS, with default 2)
[V] 1664131647.419871 8 qi.eventloop: start: thread count limits: max <- 150 (read from environment variable QI_EVENTLOOP_MAX_THREADS, with default 150)
[V] 1664131647.419900 8 qi.eventloop: start: thread count limits: final (minimum, maximum) after potential adjustment = (2, 150)
[V] 1664131647.419916 8 qi.eventloop: start: number of threads that will be launched = 3 (between (min, max) = (2, 150))
[V] 1664131647.421269 8 qitype.type: Shared pointer to unknown type N2qi13MessageSocketE, assuming object not yet registered
[V] 1664131647.421556 8 qitype.type: Shared pointer to unknown type N2qi13MessageSocketE, assuming object not yet registered
[V] 1664131647.423943 8 qitype.type: Shared pointer to unknown type N2qi13MessageSocketE, assuming object not yet registered
[V] 1664131647.426540 8 qitype.type: registerType: access to type factory before registration detected for type N2qi16ServiceDirectoryE
[V] 1664131647.426835 8 qitype.type: registerType: access to type factory before registration detected for type N2qi6FutureImEE
[V] 1664131647.427422 8 qitype.type: registerType: access to type factory before registration detected for type N2qi6FutureINS_8AnyValueEEE
[V] 1664131647.428908 8 qitype.type: registerType: access to type factory before registration detected for type N2qi11BoundObjectE
[V] 1664131647.432652 8 qi.eventloop: start: thread count limits: initial (minimum, maximum) before any adjustment = (1, 1)
[V] 1664131647.432810 8 qi.eventloop: start: thread count limits: final (minimum, maximum) after potential adjustment = (1, 1)
[V] 1664131647.432840 8 qi.eventloop: start: number of threads that will be launched = 1 (between (min, max) = (1, 1))
[V] 1664131647.433015 8 qimessaging.messagesocket: (ResolverUrlList)0x562c90abe030: Trying to connect to 192.168.0.104:9559
[V] 1664131647.447622 11 qimessaging.remoteobject: Requesting metaobject
[V] 1664131647.470106 9 qimessaging.remoteobject: Fetched metaobject
[V] 1664131647.484641 9 qimessaging.server: 0x562c90a9e088 - New socket 0x562c90abc660 added to the server.
[V] 1664131647.490206 11 qimessaging.session: Inserting sd to cache for b7c6b309-1e88-4e5b-9f17-fd9baa4595ed tcp://192.168.0.104:9559
[V] 1664131647.493854 8 qitype.type: registerType: access to type factory before registration detected for type N2qi10FutureSyncINS_8AnyValueEEE
[V] 1664131647.494712 8 qitype.type: registerType: access to type factory before registration detected for type N2qi7PromiseINS_8AnyValueEEE
[V] 1664131647.500076 8 qimessaging.sessionservice: Asynchronously asking service 'ALMemory' to SD client. requestId = 1
[V] 1664131647.510860 9 qitype.genericvalue: Conversion glitch: tuple size mismatch between DefaultTupleType<Ss,j,Ss,j,DefaultListType<Ss>(0x7f5b14001b30),Ss,>(0x7f5b2400f8d0) and N2qi11ServiceInfoE
[V] 1664131647.511757 9 qimessaging.sessionservice: Received answer from SD client for service 'ALMemory'. requestId = 1
[V] 1664131647.511960 9 qimessaging.sessionservice: Requesting socket from cache. service = 'ALMemory', requestId = 1
[V] 1664131647.512047 9 qimessaging.sessionservice: Got transport socket for service. requestId = 1
[V] 1664131647.512254 9 qimessaging.remoteobject: Requesting metaobject
[V] 1664131647.512865 9 qimessaging.sessionservice: Fetching metaobject (2) for requestId = 1
[V] 1664131647.542183 9 qimessaging.remoteobject: Fetched metaobject
[V] 1664131647.544755 9 qimessaging.sessionservice: Got metaobject for request id = 1
[V] 1664131647.548516 8 qimessaging.sessionservice: Found service 'ALMemory' in the registered remote objects.
Traceback (most recent call last):
File "test.py", line 12, in <module>
subscriber = memory.subscriber("ALTouch/TouchChanged") # throws invalid signature
RuntimeError: Invalid signature
[V] 1664131647.575554 15 qimessaging.server: Closing server...
[V] 1664131647.579308 15 qi.eventloop: Waiting for the ping thread ...
[V] 1664131647.934475 15 qi.eventloop: Waiting threads from the pool "MainEventLoop", remaining tasks: 7 (0 active)...
[V] 1664131647.934878 15 qi.eventloop: Waiting threads from the pool "EventLoopNetwork", remaining tasks: 0 (0 active)...```
I'm not sure what's wrong. I'm betting there is too much of a difference between the libqi version your libqi-python is embedding with the libqi version of your NAOqi, but as far as I know it should be compatible.
Could you try printing the metaobject of the ALMemory service :
memory = session.service("ALMemory")
print(memory.metaObject())
I also tested Python 2.7
with qi 1.5.0
but it gives me the same error.
I don't see the problem from the metaobject, so it's probably an error from the metaobject of the return value of subscriber
.
I'm sorry there's not much I can do for you, as we lack debugging tools or logs in the library that would enable us to have more information. One thing you could try is to capture the TCP packets with Wireshark with our custom dissector and see what the meta object is and why it's causing the error directly from the packets.
I've used Wireshark but it seems that the lib crashed before the network communication.
I've also tested the qi-js wrapper and that works.
Just to be clear: I used the qi.js lib from the robot ([ROBOT_IP]/libs/qi/2/qi.js
) and libqi-python from pypy (all versions).
Is the libqi-python version also available directly from the robot or what is the "normal" way to get it?
I'm sorry, I don't have access to a robot at the moment, even less a robot on v2.5.8. There should be a version of libqi-python somewhere in the /nao
(or /aldebaran
) directory, have you tried an import qi
in the python interpreter of the robot ?
You should take a look to our documentation about the Python SDK : https://developer.softbankrobotics.com/pepper-naoqi-25/naoqi-developer-guide/sdks/python-sdk/python-sdk-installation-guide.
You can download one with the correct version of libqi-python from the download page.
Using libqi-python directly on the robot works fine. It is Python 2.7 but less annoying than using an extra JS environment to get the events.
Thank you for your quick and helpful responses.
You're welcome ! good luck with your robotic developments !
I'm using Python 3.5 with the Pepper robot. I want to subscribe to events with
The fifth line throws an RuntimeError: Invalid signature. Does anyone know how to make this work?