Skip to content

FieldRobotEvent/competition_environment

Repository files navigation

Competition environment

This repository contains the docker-compose scripts needed to run a competition on your own computer. For each task, one docker-compose script is provided (a cuda and non-cuda version). These compose files are creating two Docker containers:

  1. The simulation container that is simulating the virtual maize field and the robots sensor data. This container is created from the simulation image and is provided by the organization.
  2. The robot container that is defining the robots behaviour and includes all software needed to run your robot. This container is created from a robot workspace image which is build by you. An example workspace containing a Dockerfile to build a robot container is provided.

Docker Container structure

Test competition on your own hardware

When testing the competition environment on your own computer, the simulation image is downloaded automatically from Dockerhub (don't forget to periodically update the simulation image by docker pull fieldrobotevent/simulation). The world files generated in the virtual maize field in your robot workspace will be copied and used for the simulation. You can start the simulation by going to https://localhost:8080 in your webbrowser and press the play button.

If you have access to a computer with a NVIDIA graphics card, it is possible to use the cuda version of the simulation image. See this file for more details.

On the Field Robot Event

Before the Field Robot Event start, we ask you to give us your robot image using a USB-drive. The organization will hand out USB-drives for this purpose. The world files used in the event are created by the organization. Your robot will be simulated on the hardware of the organization and the simulation will be projected on a screen and streamed to the internet.

For the simulation contest, you have to hand in both your robot workspace image and the zipped simulation_files folder. To do this, create the robot_workspace.tgz container and simulation_files.zip:

# Create the robot workspace image
cd ~/<your_workspace_folder>
docker build . -t robot_workspace
docker image save robot_workspace | gzip -c - > robot_workspace.tgz

# Create the simulation files
cd ~/<the_cloned_competition_environment_folder>
python3 scripts/copy_simulation_files.py
zip -r simulation_files.zip simulation_files/

Copy both files (robot_workspace.tgz container and simulation_files.zip) on the USB-drive and hand in the USB-drive on time. During the event, the organization will follow the procedure defined in competition procedure to run your container.

Usage

To run the competition environment on your own computer, follow the steps below:

  1. Create a Docker image of your robot workspace. This is explained in the example workspace.

  2. Copy all files that are used for the simulation (meshes, textures, world files etc.) in the simulation_files folder:

python3 scripts/copy_simulation_files.py

This script will automatically find your robot workspace and copies the nessesary files to the correct folder.

  1. Start the competition environment:
cd task_navigation
docker-compose up

This starts the competition environment by creating a simulation container and a robot container. The simulation container will be downloaded automatically.

  1. Open GZWeb in the browser by going to http://localhost:8080/ and press the play button to start the simulation. This works best by using Google Chrome.

To stop the simulation, press ctrl+c in the terminal and execute docker-compose down stop both containers.

If you are not new to Docker and you are using a computer with a NVIDIA GPU, you can speed up the simulation by using the GPU inside the Docker. This is explained in more detail here.

Additional information

Troubeshooting

Error Cause Solution
xvfb-run: error: Xvfb failed to start Another container is still running in the background. Run docker-compose down and restart the container using docker-compose up.
ERROR: Pool overlaps with other one on this address space Another container is still running in the background. Go to the folder of the running container and run docker-compose down there.
RLException: [simulation.launch] is neither a launch file in package [virtual_maize_field] nor is [virtual_maize_field] a launch file name Simulation container cannot find the simulation launch script, because it is not in the folder simulation_files/launch. Run python3 scripts/copy_simulation_files.py.

If you have another error or the provided solution does not work, create a new issue. Help expanding this list by making a pull request.