Skip to content

PXLRoboticsLab/PX4_SITL_Docker

Repository files navigation

SITL Gazebo Docker

This project contains a Dockerfile and its dependencies to run ROS Melodic, Gazebo, PyCharm, ... in a container with hardware acceleration using nvidia-docker or OpenGL.

Prerequisites

General information

Predefined versions

This project has already cloned several repositories. The two most important are PX4/Firmware and mavlink/mavros.

Installation locations

  • Firmware is located at ~/Projects/Firmware
  • mavros is located at /opt/PXL/catkin_ws/src/mavros
  • catkin is located at ~/Projects/catkin

Setup and usage

1. Clone the repository using git lfs

There is a large file in this repository. It is stored using Git Large File Storage (LFS). First clone the repository like usual. Then change your directory to where the repository is located. Finally perform git lfs pull to download the large file.

$ git clone https://github.com/PXLRoboticsLab/PX4_SITL_Docker
$ cd PX4_SITL_Docker
$ git lfs pull

2. Build the image

The following script will download and install all the dependencies, including ROS Melodic, Gazebo and PyCharm. When completed it should show up in the output of docker image ls as px4_sitl_docker.

If your computer has a NVIDIA GPU and nvidia-docker installed, then you can use the dockerfile with your GPU enabled. If your computer hasn't got a NVIDIA GPU, then you can use the OpenGL variant. A simple bash script to build the image is included in this repository.

$ ./build_image.sh

3. Create a container

Execute the provided bash script called start_container.sh. This will create a new container with the name 'px4_sitl_docker' with your NVIDIA GPU or OpenGL enabled inside the container.

4. Using the container

The container will start a simple bash environment. The terminal multiplexer tmux is also present. It's advised to use it if multiple bash shells are needed. For example, to run Gazebo together with other programs.

A tmux cheat sheet is included in this repository.

The directory ~/Projects/catkin_ws/src on the docker container is linked to the directory src in this repository.

When all processes finish, the container will stop. It's still present on the host. To restart it and interact with with a new bash console, execute the following command. The -a flag will attach your terminal to the docker container.

$ docker start -a px4_sitl_docker

5. Removing the container

The container can be removed when it will not be used anymore. The container can be removed by executing the bash script remove_container.sh.

$ ./remove_container.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published