Giter Club home page Giter Club logo

docker-ros's Introduction

Dockers for ROS

Prerequisites

  1. Install Docker Engine and Docker Compose
  2. If you are running this on a Raspberry Pi, you need to add swap for building librealsense:

Initial value is 100MB, but we need to build libraries so initial value isn't enough for that. In this case, need to switch from 100 to 2048 (2GB).

$ sudo vim /etc/dphys-swapfile
CONF_SWAPSIZE=2048

$ sudo /etc/init.d/dphys-swapfile restart swapon -s
  1. Use docker without sudo

  2. Fix broken docker-compose As docker-compose makes things more reproducable but is broken in the actual hypriot image, we will fix this by typing this in to the raspberry terminal:

sudo easy_install --upgrade pip
sudo pip uninstall docker docker-compose -y

sudo pip install requests==2.20.1
sudo pip install docker==3.7.2
sudo pip install docker-compose==1.23.0
  1. We use Fabric to streamline build and development, to install Fabric:
pip install Fabric3
#or
sudo apt install fabric

Conventions

The directory should look like this

.
+-- docker-compose.yml
+-- dockers
|   +-- docker-ros-{name1}
|   |   +-- Dockerfile
|   |   +-- ...
|   +-- docker-ros-{name2}
|   |   +-- Dockerfile
|   |   +-- ...
+-- packages
|   +-- package1
|   +-- package2

All dockers should reside in the dockers folder, and the packages should be cloned into the packages folder as submodules and mounted to the containers.

Basic Usage

Building

We provide a build.sh script for building and pushing images, usage:

usage: ./build.sh image1 image2 ... imageN
Give the images to build. If no image is given, all folders in /dockers will be built.
Arguments:
  -h|--help: Usage
  -d|--dir: dockers directory. Default: dockers
  -r|--ros0distro: ros distibution. Default: kinetic

Examples:

./build.sh ros-gui ros-master #build specific images
./build.sh #build all 

Running

We provide a run.sh script for launching images, usage:

Usage:
Give the images to build. If no image is given, all folders in /dockers will be built.
Arguments:
  -h|--help: Usage
  -s|--start: Run dockers
  -b|--build: Start with build
  -a|--attached: Run in attached mode to see output
  -e|--end: Stop dockers

Examples:

./run.sh -s #start dockers
./run.sh -s -b #build and start dockers
./run.sh -s -a #start dockers in attached mode
./run.sh -e #end dockers

docker-ros-realsense

Docker for d415/d435 using ROS Dockerized ROS environment with Realsense support.

Credits

This project is inspired by docker-ros-d415, gobbit project and ROS Docker Tutorials.

Using stand-alone container with gui

xhost +local:root

docker run -it --rm \
    -e DISPLAY=$DISPLAY \
    -v /tmp/.X11-unix:/tmp/.X11-unix \
    -v $HOME/.Xauthority:$HOME/.Xauthority \
    --net=host \
    yuxiang-gao/ros-gui \
    /bin/bash

Using Docker Compose

  1. Bring up the containers: docker-compose up -d
  2. Check status docker ps
  3. To enter interactive mode
$ docker exec -it master bash
$ source /ros_entrypoint.sh
  1. Bring down the containers: Docker-compose down

docker-ros's People

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.