Can I use NAOqi 2.5 (C++/Python SDK) features on a NAOqi 2.9 (QiSDK) robot (Pepper)? - robot

I have the Pepper robot running NAOqi 2.9, which is meant to use the QiSDK for its Android tablet. Things have been going well, but the photo capture rate is surprisingly slow (at most 2 fps), so I've got to use the C++ (or Python) SDKs available for NAOqi 2.5 for this particular task.
I've been trying to get it to work for a few days with no success. I have setup both the C++ and Python SDKs up and running, but the problem I'm facing is connection to the robot.
I've run the simple following code (using the robot's IP) found on the official website here
from naoqi import ALProxy
tts = ALProxy("ALTextToSpeech", "<IP of your robot>", 9559)
tts.say("Hello, world!")
and I'm getting the following output stream
after the second line
The connection problem occurs running either C++ on Ubuntu, or Python on Windows.
I can connect to the robot via SSH, FTP, QiSDK in Android Studio, but not in any way through the NAOqi 2.5 SDKs for C++ or Python. Since QiSDK was most probably build on top of the C++ SDK, there surely has to be a way to make this to work.
Any information will help immeasurably.

As far as I know, in NAOqi 2.5, the tablet (JavaScript) and the "brain" (Choregraphe i.e. Python / C++) of the robot were two independent devices and had to communicate and cooperate with each other. In NAOqi 2.9, the "brain" was moved to the tablet and the only way to program Pepper is by using Android Studio.
On the download page for Pepper NAOqi 2.9 (https://www.softbankrobotics.com/emea/en/support/pepper-naoqi-2-9/downloads-softwares), there is a comment regarding the Python SDK:
This is for old NAOqi 2.5.10 and NAOqi 2.5.5.
And the following is stated for NAOqi 2.9 / Pepper SDK Plugin [for Android Studio]:
This is all you need for Pepper NAOqi 2.9.
Therefore, according to Softbank Robotics' documentation, using Python / C++ to program a NAOqi 2.9 Pepper is not possible.
I hope this information answers your question.

Edit
There's another way, you can use the qi Python library inside Pepper's head, in order to use services, such as ALTextToSpeech or ALMotion, with a simple example here. One could also only use SSH to start a Python server, which would give access to these functionalities through endpoints.
import qi
app = qi.Application()
app.start()
session = app.session
tts = session.service("ALTextToSpeech")
tts.say("Hello Word")
If you run the above snippet inside Pepper's head it produces the expected output(saying Hello world). There are almost all the services that are documented here. You can also list them all by calling .services() on the session object
End of Edit
I finally found a way to hack into it. If you connect to the robot via SSH you can use the qicli binary. Its documentation is here
qicli info lists all services available, for example ALVideoDevice or ALMotion
qicli info ALMotion displays the available methods of that service
qicli info ALMotion.setAngles displays info about that method's parameters
qicli call ALMotion.setAngles HeadYaw 0.7 0.3 calls the function in the module with given parameters
So one could write a wrapper to this binary and call it programmatically via SSH, it seems like a lot of work for this kind of task but I haven't found anything else.
I've got Python's Paramiko library to work:
import paramiko
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname='ip-of-robot', username='nao', password='your-pass')
stdin, stdout, stderr = client.exec_command('pwd')
print(stdout.read())
client.exec_command('qicli call ALMotion.setAngles HeadYaw -0.7 0.2')
client.close()
I've also tried .NET's SSH.NET library, with little to no success.

Related

Is there an alternative module for `simplegui` that can work in Google Colaboratory?

I need to find an alternative to simplegui module that can run in both Python and Google Colaboratory. It works in CodeSkulptor platform but gives errors in the other!
By Google collaboratory I guess that you mean CodeSkulptor:
https://py3.codeskulptor.org/
I reimplemented SimpleGUI in Python, with Pygame library, in the library SimpleGUICS2Pygame:
https://simpleguics2pygame.readthedocs.io/
With that you can run the same program both in CodeSkulptor and in standard Python 2 or 3.

Fiddler for mac: bad CPU type in executable: mono32

I'm trying to use Fiddler on mac and I download mono, everything is ok. But when I type mono Fiddler.exe, something goes wrong. I try to google and realized Fiddler‘s graphical interface can just run on 32bit environment. So I run mono --arch=32 Fiddler.exe but the command has changed to mono32 and when I type mono32, it shows bad CPU type in executable: mono32. And I read some news about MacOS Catalina doesn't support 32 bit application any more. Does this mean I can't use Fiddler on mac or I just need to close graphical interface? If I just need to close the graphical interface, What should I do? Please help me!Thanks!
The old Fiddler for Mac was using Mono WinForms to run the user interface on macOS, which is both buggy and 32 bit only. Due to the macOS update, 32 bit apps are no longer feasible.
Telerik is now moving to an Electron based Fiddler UI, called Fiddler Everywhere,
https://www.telerik.com/fiddler-everywhere
You can try it out, but it is still in preview and lacks certain features.

Connect to WiFi from QML

Is it possible to connect to WiFi from QML (without writing some C++ code)?
According to this article it is possible. And this article starts right away with import B2Qt.Wifi 1.0, implying that such module is available, but I get an error module "B2Qt.Wifi" is not installed.
I have a commercial Qt 5.7 and I installed all the components, so it should be there. However, there is no module with such name in the entire installation directory.
I tried to do it on Windows and Linux with the same result.
Maybe I need to download this module from somewhere else? That would be weird though.
B2Qt means 'Boot to Qt'. It's for the devices where you prepare an image and then flash it onto the device.
So, it uses a specific network manager that is built into that image. And there is a B2Qt.Wifi module to configure that specific network manager.
I think it won't work with the network managers on desktop Linux, Mac or Windows.

Twitter API 1.1 on Older Mac Systems

I'm maintaining an app that is required to support Macs running 10.5 and above. With Twitter's switch to version 1.1 of their API I've been unable to locate a solid library that supports these older systems.
I've tried STTwitter, oauthconsumer, and gtm-oauth to no avail.
My only requirement is that I be able to GET three tweets from a user's public timeline. I was previously using this end point :
NSString *urlString = [NSString stringWithFormat:#"http://api.twitter.com/1/statuses/user_timeline.json?exclude_replies=true&count=10&screen_name=%#", [_prefs objectForKey:#"twitterHandle"]];
Is it time to kick my 10.5.x users to the curb?
OS X 10.5 comes installed with Ruby. You can call the ruby gem "twurl" (using a command line call and parsing the results).
Plenty of example are available here: https://github.com/marcel/twurl
I used something like this for a Python project before the popular Python libraries had been updated to support API v1.1.
Good luck!

Safari3 and Safari4 side by side

I've just read about the release of Safari4 (beta) and its much improved Javascript engine.
I was planning to start playing with it, but I am wondering if anybody knows if both Safary 3 and Safari 4 can be run side by side.
You could run Safari 3 and use the nightly builds of Webkit to test the new engine. You'd be still missing the new features like Cover Flow and Top Sites though.
Try this
Safari normally use the Web Kit
framework found inside Mac OS X to
render web pages and execute
javascript. This means that if you
preserve an old version of Safari to
run it on a newer version of Mac OS,
it will use the newer Web Kit found in
the system and you will get the same
results as with the newer version.
However, the link has some stand alone versions that you can install.
There's also this which shows how to create your own stand alone version.
Beatnik Pad has a quick tutorial that shows how running Safari 4 Beta and Safari 3 side by side can be accomplished.