Install using Docker¶
Docker images that include the neccessary software and dependencies have been created for convenience.
Requirements¶
-
Install Docker using installation instructions.
-
Complete the Linux Postinstall steps to allow you to manage Docker as a non-root user.
-
If you have an NVIDIA graphics card, it can help speed up rendering. Install nvidia-container-toolkit.
- Follow Installation steps for Ubuntu (currently 3 steps)
- Skip down to Configuration and run
nvidia-ctk
to set up the nvidia container runtime
Use Existing Image on DockerHub¶
MBARI maintains Docker images for the two most recent releases on their DockerHub:
- mbari/mbari_wec:latest
- mbari/mbari_wec:previous
-
Get
run.bash
script.Orgit clone -b main https://github.com/osrf/mbari_wec.git cd ~/mbari_wec/docker/
wget https://raw.githubusercontent.com/osrf/mbari_wec/main/docker/run.bash chmod +x run.bash
-
Run the container If you have an NVIDIA graphics card
Otherwise./run.bash mbari/mbari_wec:latest
./run.bash mbari/mbari_wec:latest --no-nvidia
-
To have another window running the same docker container, run this command in a new terminal:
./join.bash mbari/mbari_wec:latest
Build from Dockerfile¶
An alternative to using the images from MBARI's DockerHub would be to build from a Dockerfile. This is convenient if you would like to make any changes.
-
Clone the mbari_wec repository to download the latest Dockerfile.
git clone -b main https://github.com/osrf/mbari_wec.git cd ~/mbari_wec/docker/
-
Build the docker image If you have an NVIDIA graphics card
Otherwise./build.bash mbari_wec
./build.bash mbari_wec --no-nvidia
-
Run the container If you have an NVIDIA graphics card
Otherwise./run.bash mbari_wec_nvidia
./run.bash mbari_wec_no_nvidia --no-nvidia
-
To have another window running the same docker container, run this command in a new terminal:
where the name of the image is one of./join.bash <name of image>
mbari_wec_nvidia
ormbari_wec_no_nvidia
Quick start¶
Quick start scripts are provided in the home directory:
This sources the compiled workspace:
. setup.bash
This sources the compiled workspace and launches the simulation:
./run_simulation.bash
Logs from the run will be saved to /logs
in the container which is mapped
to ~/mbari_wec/docker/logs
on the host. These logs will be in the same CSV format as generated by
the physical buoy. You may also collect rosbags in the /logs
folder in the container. The rosbags
collected in the sim will also be the same ROS 2 messages collected on the physical buoy.
Run an example to test¶
-
In a new terminal (whether on host machine or in Docker container), source the workspace
. ~/mbari_wec_ws/install/setup.bash
-
Launch the simulation
ros2 launch buoy_gazebo mbari_wec.launch.py
The simulation software should now be available. To run and test, proceed to the Run the Simulator tutorial series.