Connecting to a remote simulated drone within sphinx-server on a headless computer

Hello everyone,

My setup is a running sphinx-server on a remote headless computer. sphinx-server is running perfectly but I have issues in setting up the network settings so that I can connect to the simulated drone. The current status is that I succeed in connecting, from my client with sphinx-client, to the remote sphinx-server but I fail to contact the drone (which has the 10.202.0.1 on the remote computer).

I may be confused by the --interface or stolen_interface or port_forwarding options ?

Here is my setup :

Server : Ubuntu 16.04, ethernet interface enp4s0 with IP 192.168.10.79
Client : Ubuntu 18.04

on the server, I run :

DISPLAY=:99 sphinx-server --interface=enp4s0 /opt/parrot-sphinx/usr/share/sphinx/worlds/outdoor_1.world /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone::stolen_interface=::with_front_cam=true::firmware=/usr/share/firmwared/firmwares/ardrone3-milos_pc.ext2.zip

no issue to ping 10.202.0.1 directly from the server but obviously this IP is not seen from the client.

On the client, I can do the following :

sphinx-client --server-uri=192.168.10.79:11345

And I see the running gazebo with the bebop2 in the environment.

But then, I want to contact the drone (with ROS/bebop_autonomy), without going through the sphinx-client and this is where I’m not sure what to do. The following command fails “roslaunch bebop_driver bebop_node.launch ip:=192.168.10.79”

Trying stollen_interface

on the server, I define a virtual interface ;

ifconfig enp4s0:1 192.168.10.82

Then I start the server by giving this interface to the --interface option or this IP to --port-forwarding but in both cases, I still cannot reach the drone from my client by contacting 192.168.10.82 but I suppose this is OK and should use stollen_interface .
But the following fails to start :

DISPLAY=:99 sphinx-server --interface=enp4s0:1 /opt/parrot-sphinx/usr/share/sphinx/worlds/outdoor_1.world /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone::stolen_interface=enp4s0:1:eth0:192.168.42.1/24::with_front_cam=true::firmware=/usr/share/firmwared/firmwares/ardrone3-milos_pc.ext2.zip

outputing :
Misformed stolen_interface. Should be:
<host_if>:<remote_if>:<ip_addr/CIDR>
example: wlan0:eth0:192.168.42.1/24

which I suppose is linked to the fact that my virtual interface is called enp4s0:1 and “:” is the field separator.

… I basically tried several combinations but I’m getting lost and not sure which is the right track.

@ndessart , @espetro maybe you have an hint on this ?

Hi,

You’re not crazy, the name of the parameters are confusing, sorry. We will try to clarify a few things in the future.

--interface defines interface name for sphinx-server, sphinx-server listen tcp/11345 on this interface waiting for a sphinx-client --server-uri=<sphinx-server-ip-address>
--port-forwarding defines the IP address of the drone controller (i.e. Olympe / SkyController / FreeFlight / … ) that sphinx needs to forward traffic to.

Basically with –port-forwarding controller-ip-address, on the sphinx-server host the following ports (on all interfaces) will be redirected to:

  • the drone (10.202.0.1) : tcp/44444, udp/54321, udp/2233
  • the controller (IP address of the drone controller) : udp/43210, udp/9988, udp/55004, udp/55005, udp/5004, udp/5005.

This uses socat to perform the necessary port redirections. (We could have use iptables instead but not without sudo privileges…).

The port forwarding feature of sphinx is really what you are looking for and you shouldn’t use the stolen_interface parameter in this case. It’s only useful to pass a wireless interface name for the simulated drone.

Thank you for your feedback @ndessart

So, to be completely sure I get what you mean, given that in my setup my server running sphinx-server has IP 192.168.10.79 , if I run :

DISPLAY=:99 sphinx-server --port-forwarding=192.168.10.79 /opt/parrot-sphinx/usr/share/sphinx/worlds/outdoor_1.world /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone::stolen_interface=::with_front_cam=true::firmware=/usr/share/firmwared/firmwares/ardrone3-milos_pc.ext2.zip

I should then be able to remotely contact the drone with the ParrotSDK (actually I will be using the bebop_autonomy ROS package) by contacting directly the IP 192.168.10.79 . Is that correct ?

Jeremy.

No, here is corrected example:

If the machine were you run sphinx-server has IP address 192.168.10.1 and the machine where you run bebop_autonomy has IP address 192.168.10.2

Then, sphinx-server --port-forwarding=192.168.10.2 will forward the drone controller ports to the bebop_autonomy machine. From the bebop_autonomy machine you’ll then be able to connect to your drone at 192.168.10.1 (the sphinx-server host IP address instead of 10.202.0.1 if everything was done locally).

Indeed that works !
Thanks a lot !