Running sphinx remotely

This tutorial explains how to start a simulation using a centralized server, with multiple clients running the same scene.

Say we want to run a server / client simulation across two machines with IP addresses 172.20.220.1 and 172.20.220.2. Before proceeding to the next step, you must make sure that sphinx is installed on both machines. Check the Installation procedure page.

Start the server

You need to select one machine to run the the server; we’ll go with 172.20.220.1. ssh into the machine and start the server in remote mode by setting the --interface option to the name of its remote interface (eth0 in this example):

$ DISPLAY=:0 sphinx-server --interface=eth0 /opt/parrot-sphinx/usr/share/sphinx/drones/bebop2.drone

Note that you must be logged into the machine with a local display to connect to the X server.

In case you get the following error:

xauth: (argv):1:  unable to open display ":0".

It may be because the display name is incorrect. To determine the correct value, enter the following command:

$ ls /tmp/.X11-unix | tr 'X' ':'.

Start the Gazebo’s graphical user interface

Now you can start a client on 172.20.220.2, by setting the option --server-uri to the IP and port where the server is listening:

$ sphinx-client --server-uri=172.20.220.1:11345

The TCP port should be the same as the one indicated in Sphinx’s shell output:

[Msg] connection info: 127.0.0.1 11345

Start Sphinx’s Web client

To visualize the navdata and interact with the simulation, open a Web browser and navigate to the server’s URL: http://172.20.220.1:9002

Control the drone remotely

In case the drone controller is located on the remote PC, it is possible to tie the controller to the simulated drone by starting Sphinx in port forwarding mode.

Check the section virtual ethernet for more information.