Preparing Solution Docker Image - osrf/mbzirc GitHub Wiki

The solution to be submitted for final evaluation should be in the form of a Docker image. The same image will be deployed for all vehicles that you specify in the team configuration file. We will pass an argument when launching a Docker container from your Docker image to let it know which vehicle it will be associated with so you can determine what processes to run.

Example Solution code

To demonstrate how this works, we have created an mbzirc_seed ROS package that serves as an example solution. The package contains:

  • Simple UAV and USV controllers in src for demonstration purposes.
  • A launch file launch for bringing up the controllers
  • A team config file in config with vehicle and sensor payload configurations.

Your solution does not necessary need be a ROS package or follow this particular directory structure. You can organize it any way you like.

Preparing Dockerfile

Once you have your solution code ready, you will need to prepare a Dockerfile for building a Docker image that contains your code. Note that your Docker container will not be able to access the internet, so please be sure to download all the necessary files needed to run your solution.

Startup script

It is important that you specify in the ENTRYPOINT a script for bringing up the processes / controllers in your solution. Here is the Dockerfile for the mbzirc_seed solution. Its ENTRYPOINT is a run_solution.bash script that contains a launch command for launching the mbzirc_seed package. When we run the solution container, we pass the name of the vehicle as an argument to this script. In the run_solution.bash example, you can see that our script forwards this argument ($@) to the ros2 launch command which uses it to determine what controllers to bring up.

Assuming there are 3 vehicles, named quadrotor_1, quadrotor_2, usv, you can think of the script being run like so:

# container 1
./run_solution.bash quadrotor_1

# container 2
./run_solution.bash quadrotor_2

# container 3
./run_solution.bash usv

Since you will be writing your own ENTRYPOINT script, you can process the vehicle name argument however you like.