Running an LRAUV vehicle simulator¶
Requirements¶
- Docker
- Access to the mbari/lrauv image at Docker Hub.
Note
Work on the "dockerized" LRAUV simulator is still under testing.
Please let us know of any questions or suggestions.
Instructions¶
0. Login to Docker Hub¶
On your target machine, login with an account having access to the mbari/lrauv repository at Docker Hub:
docker login
1. Create a directory for the LRAUV simulator¶
Create a directory under which to run the LRAUV simulator.
We will assume such directory designation has been captured in the MYLRAUVDIR
environment variable.
2. Create a subdirectory for configuration¶
Create a subdirectory simConfig
under $MYLRAUVDIR
.
This subdirectory will contain files used to overwrite default "sim" vehicle settings.
mkdir simConfig
In particular, create and edit simConfig/secure.cfg
to specify the TethysDash
backend (IP or hostname, port, etc.) that the LRAUV simulator will be interacting
with. For example:
Vehicle.dashIP = "127.0.0.1"; // or a name, e.g., "tethysdash.example.net"
Vehicle.dashPort = "8080";
Vehicle.dashPath = "/TethysDash";
Vehicle.dashSSL = 0 bool;
Vehicle.imei = "mylrauvsim"
Vehicle.imeiPassword = "mypw";
Vehicle.keyText = "mykeytext";
-
dashIP
indicates the host of the TethysDash application. This can be an IP address or a name, e.g., "tethysdash.example.net" or "okeanids.mbari.org". -
dashPort
indicates the port of the TethysDash application on the host indicated above. -
dashPath
is the TethysDash application context on the host, typically "/TethysDash". -
dashSSL
indicates whether the server should be accessed securely (1 bool
) or not (0 bool
). -
For a vehicle simulator,
imei
,imeiPassword
, andkeyText
can be any arbitrary strings. Only requirement is thatimei
be unique with respect to all vehicles handled by the target TethysDash instance. (imei
must be unique per vehicle since it is used by TethysDash to identify the source of incoming data.)
Also, create and edit simConfig/Sensor.cfg
with the following contents:
DataOverHttps.loadAtStartup = 1 bool;
At this point the contents of ${MYLRAUVDIR}
should look like this:
.
└── simConfig
├── secure.cfg
└── Sensor.cfg
3. Get the LRAUV Simulator image¶
Visit Docker Hub
to select the latest version of the LRAUV image.
In what follows we assume the image name is captured in the LRAUV_IMAGE
environment variable,
for example:
export LRAUV_IMAGE="mbari/lrauv:2021-01-14_b32928ff"
Example with the latest available version:
export LRAUV_IMAGE="mbari/lrauv:latest"
4. Create "lrauv" container¶
Note, we first create the container (so it is ready to be used multiple times), and then run it whenever needed.
The following will pull the image from Docker Hub and create the container (additional details about some docker commands are provided below):
cd ${MYLRAUVDIR}
docker create --name lrauv \
--volume $PWD/simConfig:/opt/lrauv-application/Config/sim/root \
--volume $PWD/LRAUV_Logs:/opt/lrauv-application/Logs \
--volume $PWD/LRAUV_Data:/opt/lrauv-application/Data \
--interactive --tty \
--net=host \
${LRAUV_IMAGE}
5. Run the "lrauv" container¶
With the "lrauv" container created, you can run it whenever needed:
$ docker start -ai lrauv
___ Running process_nav... ___
Opening Config file at: Config/regressionTests/Navigation.cfg
NavChartDb.charts = "US1WC07M,US2WC11M,US3CA52M,US4CA60M,US5CA50M,US5CA61M,US5CA62M,US5CA83M"
2019-11-01T21:05:21.985Z,1572642321.985 [NavChartDb](INFO): Looking for Electronic Nav Chart file at: Resources/ElectronicNavigationCharts/US1WC07M.000
2019-11-01T21:05:21.986Z,1572642321.986 [NavChartDb](IMPORTANT): Will load Electronic Nav Chart data from US1WC07M.000
2019-11-01T21:05:21.986Z,1572642321.986 [NavChartDb](INFO): Looking for Electronic Nav Chart file at: Resources/ElectronicNavigationCharts/US2WC11M.000
...
2019-11-01T21:13:33.482Z,1572642813.482 [NavChartDb](INFO): Creating index for 3474p7
2019-11-01T21:13:33.504Z,1572642813.504 [NavChartDb](INFO): Creating index for 3657p6
...
___ Launching SimDaemon... ___
SimDaemon waiting to accept a connection!
___ Running simulator: bin/LRAUV
Writer for level Courier will be LZMA encoded.
Writer for level Express will be LZMA encoded.
Writer for level Priority will not be LZMA encoded.
Writer for level Normal will not be LZMA encoded.
2019-11-01T21:13:34.554Z,1572642814.554 [SyncHandler](INFO): Protected caller Thread ID is 10
...
lrauv>
-
Only on very first execution, a number of indexes are created (
Running process_nav...
); this may take a few minutes. -
You then should get the LRAUV prompt shown as
lrauv>
above (but the string before the>
may be different). This prompt indicates that the "sim" vehicle is ready to interact with TethysDash. You can also enter commands directly at the prompt. -
Logs are generated under
$PWD/LRAUV_Logs/
. -
When done, enter
quit
at the prompt to terminate the simulator.
About the docker create/start
commands
-
Inside the container, the LRAUV application is located under
/opt/lrauv-application/
. -
The use of the
--volume
option allows to specify the following directory mappings:Host Container $PWD/simConfig
/opt/lrauv-application/Config/sim/root
$PWD/LRAUV_Logs
/opt/lrauv-application/Logs
$PWD/LRAUV_Data
/opt/lrauv-application/Data
-
--interactive
,--tty
, and-ai
indicate that we want to run the container in interactive mode (so commands can also be entered directly). -
--host=net
puts the containerized simulator on your host network stack. In particular, this makes it simpler to allow interaction with TethysDash.
Upgrading to a new image¶
To use a new image of the LRAUV simulator:
- Exit the currently running "lrauv" instance if any:
- if running in interactive mode, enter
quit
at the prompt; - otherwise (but also applicable in general), run
docker stop lrauv
in another terminal.
- if running in interactive mode, enter
- Remove the container:
docker rm lrauv
- Optionally, remove the old image:
- Run
docker images
to identify the ID of the image to be removed; - Run
docker rmi <ID>
to remove it.
- Run
- Follow the instructions above starting with the updated new image tag specification
for the
docker create
command.