Skip to content

Install Docker image

Martin Molina edited this page Feb 4, 2021 · 2 revisions

This installation method downloads a docker image containing an installed Aerostack project including all the needed components (e.g., ROS and the required Aerostack components). The user has to provide the name of an existing project.

Here you can consult a list of example projects:

Requirements

You must have Docker installed in your computer. For example if you have Ubuntu, write the following commands to install Docker:

    $ sudo apt-get update
    $ sudo apt-get install docker.io

For more details about installation, please follow the installation guide on https://docs.docker.com/install/linux/docker-ce/ubuntu/)

The drivers of the graphics card must have 3D acceleration enabled (this is needed to use 3D simulators like Gazebo).

Installation procedure

  • Download the installation files:

      $ git clone https://github.com/cvar-upm/aerostack_installer.git ~/temp
    
  • Run the following installation script to download a specific project. This script downloads the docker image from docker hub to your local repository. For example, to install the the project called my_project located in the folder $AEROSTACK_STACK/projects/my_project write the following command (IMPORTANT: the project must previously exist):

      $ ~/temp/install_project_with_docker.sh projects/my_project
    
  • Docker images can be listed running (in this example the docker image is downloaded with the tag cvar/aerostack_melodic_full): (executing with sudo might be required)

      $ sudo docker images
    
      REPOSITORY                    TAG                 IMAGE ID            CREATED             SIZE
      cvar/aerostack_melodic_full   3.0                 8798144e9850        3 days ago          5.76GB
    

An executable (docker_launcher.sh) is created inside the installed project folder in your current Aerostack workspace. If an Aerostack workspace does not exist, the script will create the default Aerostack route from your home directory and create the file there (~/workspace/ros/aerostack_catkin_ws/src/aerostack_stack/projects/my_project). Additionally if the project files do not exist, this script will download them (into ~/workspace/ros/aerostack_catkin_ws/src/aerostack_stack/projects/my_project).

Mission execution

In order to execute the mission of an Aerostack project, you can execute the following commands:

  1. Execute the docker container:

     $ cd $AEROSTACK_STACK/projects/my_project
     $ ./docker_launcher.sh
    
  2. A new terminal window is presented accepted commands that are executed in the docker container.

  3. It is possible to execute now the Aerostack project in this terminal like in any other Aerostack installation. For example, you could write for the project called my_project these commands:

     $ cd $AEROSTACK_STACK/projects/my_project
     $ roscore
    
  4. Then, you can create new instance of this terminal in a new window by pressing ctrl+shift+n (or ctrl+shift+t for a new tab) to launch the project with the following command:

     $ ./main_launcher.sh
    

If you want to change the robot mission plan, you can edit mission files (e.g., mission.py) that are located in configs/mission/ in your projects folder. The project folder is shared with the docker container through the command docker_launcher.sh. Note that any modification to this folder inside the docker container also affects the one in the host operating system and vice versa, since they are the same folder.

Clone this wiki locally