-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use ALTracker
of Pepper 2.9 with libqi-python?
#26
Comments
I also have Pepper 2.5 and I found that the same code is fine with Pepper 2.5. Why does the problem occur only with Pepper 2.9? |
Disclaimer: I'm not affiliated with this repository, just a random dude and the following is only from my memory that you'd need to verify yourself. With the NAOqi update to version 2.9, some things have changed in the architecture. Accordingly, version 2.9 no longer includes some services that were still available in version 2.5. There are now also new services, some of which partially replicate old functionality. In your case, you are running into the error because the ALTracker service simply no longer exists in version 2.9. I believe the service that has replaced ALTracker is Human or HumanAwareness. You can view the services and their methods on your robot (even those that are no longer really functional) via qicli and (in some cases) even output a few docstrings using the -show-doc option. For Pepper robots with NAOqi version 2.9, it is actually intended/recommended to use the QiSDK as part of an Android app. You can use the old services (at least those that still work) with libqi-python with the identical code as for NAOqi 2.5 (e.g. ALTextToSpeech or ALLeds). The new services, however, cannot be used this way, as they now also expect a context object. There is (if I remember correctly) a RobotContextFactory (?) service that may be able to provide this. However, there is no official support for this and you should be aware that you are travelling absolutely blind here. Be that as it may, I hope that these explanations will help you a little to understand your problem. If I have misunderstood/interpreted something here, I hope that others can clear up any mistakes. |
@DrR955 you are completely correct with your explanation and answer, thank you for the help 😊 The goal of this design is to ensure exclusive access to some API by the Android activity that uses them, to avoid concurrency issues. The Focus service makes sure that only one client is allowed to have a handle at a time. |
Thank you so much! As @DrR955 said, I found Human Awareness API. This is what I looked for, so I managed to continue on my project. Thanks again. The following data is the output of what we can use for Pepper 2.9 with libqi-python API, and the functions related to a kind of tracking.
|
Unfortunately, I could track people with If my understanding is correct, there is getHumanAround function in Java, but I could not find out such function in Python. I know we have a way to track people with |
I believe there is a |
Have you tried using the humansAround property? Looking at the EngageHuman docs, Regarding your problem with On a side note, if you have already managed to successfully use functions of 2.9 services (that require the context object), would you please share the code? Maybe it will help some poor soul in the future (myself included). |
HumanAwareness and propertiesYou don´t have to go through humanAwareness = app.session.service("HumanAwareness")
humansAround = humanAwareness.humansAround
# Get the current list of detected humans
humans = humansAround.value()
print(f"current humans: {humans}")
# Or connect to changes on human detection. The lambda is called every time the list of humans around changes.
humansAround.connect(lambda humans: print(f"new humans detected: {humans}")) Context and focus objectsHere is how you can build a ctxFactory = app.session.service("ContextFactory")
focus = app.session.service("Focus")
ctx = ctxFactory.makeContext()
focusOwner = focus.take()
ctx.focus.setValue(focusOwner)
ctx.identity.setValue("my-app") # Unsure about this, let me know if it works for you
# You can now use the ctx object for the API that you want
engageHuman = humanAwareness.makeEngageHuman(ctx, human)
engageHuman.run() |
@nyibbang @DrR955 Now, I succeeded in getting
I'll try with |
I want to make my pepper track people, but I got an error.
I tried to subscribe "ALTracker" with your example as follows,
However, I got a following error.
I confirmed that the same error occurs with "ALSonar," "ALExtractor" and so on.
My qi version is 3.1.5 and I use Python 3.8.
How can I solve this error?
The text was updated successfully, but these errors were encountered: