diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..331d387 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..06d8bbc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Use Ubuntu 20.04 as base image +FROM ubuntu:20.04 + +# Copy source files to directory +COPY . . + +# Install dependency +RUN apt update && \ + DEBIAN_FRONTEND=noninteractive apt install libsdl2-dev cmake g++ make -y + +# Build recipe +RUN cd RVO2 && \ + mkdir build && \ + cd build && \ + cmake .. && \ + make && \ + make install && \ + cd ../../rds && \ + make diff --git a/README.md b/README.md index 643a75b..86d56c1 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,8 @@ The software's structure is as in the following picture. Instructions follow to set up and run RDS and some demos in Ubuntu 16.04. Below, the first section is for simulations, and the second section is for the ROS interface. First, the following steps are necessary in both cases. +You can use docker to build and execute RDS following [this guide](docs/docker.md). + This installs the graphics library SDL2, which is a prerequisite. ``` @@ -164,4 +166,4 @@ The boolean parameter ORCA_implementation specifies whether to use an implementa The response's parameter corrected_command reports the command which RDS has computed. -The response's parameter call_counter simply counts how often the service of the rds_ros_node has been called since the node was launched. \ No newline at end of file +The response's parameter call_counter simply counts how often the service of the rds_ros_node has been called since the node was launched. diff --git a/docs/docker.md b/docs/docker.md new file mode 100644 index 0000000..e2d5ece --- /dev/null +++ b/docs/docker.md @@ -0,0 +1,33 @@ +# Using Docker to run RDS + +Follow this guide to run RDS on docker. + +## Requirements + +The only dependency that you should install is the standard Docker Engine: + +- Install Docker Engine: https://docs.docker.com/engine/install/ + +## Build local docker image +``` +docker build -t rds:latest . +``` + +## Run + +Once the docker image is built, you can run the software using the following: + +``` +docker run -i -w rds:latest +``` + +where: +- `` is the base directory to execute the command +- `` is the executable string + +For example, to run the simulation, located on `/rds`: + +``` +docker run -i -w /rds rds:latest ./build/baseline_crowd_rds_5 7 +``` +