Running sphinx remotely¶
This tutorial explains how to start a simulation using a centralized server, with multiple clients running the same scene. It explains the use of the environment variable GAZEBO_MASTER_URI to configure multiple clients to connect to a single master.
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:
$ DISPLAY=:0 sphinx-server /opt/parrot-sphinx/usr/share/sphinx/worlds/example_bebop2.world
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, configuring GAZEBO_MASTER_URI to the IP and port where the server was just started:
$ GAZEBO_MASTER_URI=172.20.220.1 sphinx-client
If the port is missing in master URI, like in the example above, it defaults to 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