How to program NAO Robot remotely - webserver

For my internship I have to create a new framework on ROS2 to control NAO remotely. I have to use Python 3 so I can't use the Python SDK furnished by the constructor because the latest version is 2.7, which makes the things more complex.
My tutor told me to try to use a web server instead. Concretely, the ROS2 message would be sent to a web server and then sent from it to Nao. I succeeded to send them to a server but I don't know how to make Nao understand the message received from the server, and even how to send them.
Do you have any ideas which could help me please ?

Haru.
I am quite new with Nao Robot, but as far as I know, you can use C++ to create a ROS package.
Can you consider this option?
Good luck !

Instead of sending it to a web server, use libQi (either C++ or Python), to connect directly to NAOqi. Note that there is a ROS 1 component for NAOqi already.
In a nutshell, wherever you would use an ALProxy(...) with the NAOqi SDK, instead you would retrieve get a service from a session with session->service(...).

Related

REST Server without GUI

I've started working with delphi quite some while ago but I would say I'm still a newbie in all this.
So basically I tried creating REST Server, which can validate license keys. I got in working with Indy, but one thing bothers me. The GUI. The Server shouldn't have any kind of gui so it can work on any OS (Win, Linux, etc). Is there a way to make a REST Server without any GUI/FMX/VCL?
BTW: Working in Delphi 10.2.3 Professional.
Any advice is appreciated.
EDIT: I forgot to mention one thing: the server is supposed to run on an independent Data Center away from any user.
You can create the WebServer as a Windows Service.
You can use DelphiMVCFramework or any other Framework to create it.
With DMVC you can create console application, Windows Service, Linux daemon, Apache module (Windows and Linux) and IIS ISAPI (Windows).
With Intraweb you can also create Services.
Take a look at our mORMot Open Source REST framework, which works on Delphi but also on FPC/Lazarus.
FPC support ensures that you can target Linux with this free compiler. No need to upgrade to a newer version of Delphi Architect, which supports Linux, and is very pricey - and less stable (to my knowledge) since Linux support is quite new.
As you requested, the mORMot REST server has no UI part. You define your services as interface and class - like you do e.g. with DotNet - and you will have full JSON/REST support generated.
mORMot is used on production since years for very high performance and stability, hosted on both Windows and Linux. A version 2 is on its way, which would be even easier to use for new projects.
And you can create a Windows service or Linux daemon without using any third party framework. Delphi include everything you need. However, it is possible that third party framework will facilitate your programming. Don't forget you'll have to learn those third party framework.
Creating a Linux daemon service in Delphi
Creating a Windows Service in Delphi
In both cases, you can use the sample code you've found that make use of TIdTCPServer.

How can I add audio call to rocket chat

I installed rocket chat on my server and now I need to install some app, that will allowed me to call. So, I tried to install jitsi, but it doesn't work on my 3d domain (meet.myurl.com, rocket chat is working on myurl.com) and now I tried to install WebRTC, but it doesn't work for me. I haven't any notification, when I call. On mobile version I haven't some button to call. I don't know need I do some configuration with my server? I didn't find any documentation. Or may be someone know some easy variant to do voice call in rocketchat? Thanks
In my case. I just turned it on as in the picture. And video calls became possible on Android and Web-browser clients. There is no need to restart the server.
Server on Docker
Version 3.2.0-develop
PID 1
Running Instances 1
OpLog Enabled
Branch HEAD
Tag 3.1.2
OS Platform linux
OS Release 3.10.0-1062.18.1.el7.x86_64
Node Version v12.16.1
Mongo Version 4.0.18

Native messaging or http

I want to be able to execute local shell commands in a web application.
Chrome Native messaging api seems to be good for that, but as it needs also a service in background, I do not see a real difference with a little http server.
Is there a real structural difference between them? As I see there is somewhere a socket used as an interface.
Is there any other solutions for that?
Chrome Native messaging does not work by calling a running daemon. Instead, it spawns a new process each time sendMessage or connect is called.
While you can keep the process you opened with connect running, if you want to do one-shot commands the sendMessage approach is good.
Do note that you will still need a Chrome App or Extension installed to be able to do it, as well as a (separately installed) Native Host module.

Can I use sockets on Appengine without a special lib?

I'm confused by the GAE documentations. It says App Engine supports sockets without requiring you to import any special App Engine libraries or add any special App Engine code. but it seems misleading as just above it says App Engine supports outbound sockets through the appengine/socket package.
I would like to connect to an IMAP server using the standard net package. Is that possible or I'm stuck with the GAE sockets API?
https://cloud.google.com/appengine/docs/go/sockets/
It is not possible to open an outbound socket without going through the appengine/socket api. This is because it works through RPC and an appengine.Context is needed to do that. You can still use the IMAP library you linked, though, as it provides a function to create a client with a given net.Conn. You can get a net.Conn from appengine/socket and pass it to NewClient to do your business. The reason it works on python and java is because they both use thread local memory to manage request state implicitly, whereas the go runtime does not.
Nothing stops you from connecting to an Imap server, since you will initiate an outbound connection. For java, the standard java mail packages work out of the box.
Only for paid apps though, i.e. you need to have billing enabled.

iPhone HTTP Server

Can someone give me simple code to help with creating an HTTP server for the iPhone. Something simple with much documentation would be appreciated. Anything you have please share.
There are sample codes from Apple and open source community such as cocoahttpserver TouchHTTPD.
Here's a summary blog
Another open-source HTTP server for iPhone is the lightweight GCDWebServer which is built on top of Grand Central Dispatch. It's only a few source code files and offers a simple and extensible API.
If you're unfamiliar with network programming your best bet is to first read Beej's Guide to Network Programming and then read the HTTP 1.1 spec before you look at source code (as you should have an understanding of the protocol before you start looking at implementations).
A simple Google search turned up cocoahttpserver and iSpit. Otherwise, you could download Apache and look at its source code, but that's not exactly a simple implementation.
It is possible to run a simple file server on iPhone/iOS.
I was able to use this method successfully. Here are the steps to create a simple file server which works on http protocol.
1. Install TestFlight app for iOS
2. Install iSH app from the Apple store or side load it from their website, as this app might not be available in the store depending on your country. I tried it from india in May 2020, and the app was not available in the store. So i did side load it from their website.
3. With iSH app, one has access to linux kernel of the iPhone. I did use a simple http server module from python and executed it on the linux shell.
4. Command to run the python based server on iPhone :
Python -m http.server 8080
5. Access the file server using the local ip that’s assigned to the iPhone in the network you are connected to. That means, if iPhone is connected to a WiFi SSID, depending on whether the router is configured to use static IP address assignment based on MAC address or using DHCP protocol, your iPhone will have an internal IP assigned by the router.
6. Command to access the file server :
http://192.168.1.3:8080 - modify the address depending on IP address of the iPhone and the port that server running on iPhone is configured to use. Paste this in a browser - one should be able to see the files listed in the directory where the server is running in.
Hope this was clear enough, for running a simple http based file server on iPhone using http.server module in python, over linux shell of the underlying kernel, using iSH.