GithubHelp home page GithubHelp logo

maskjp / docker-ros-x11 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from henry2423/docker-ros-x11

0.0 1.0 0.0 21 KB

A docker environment with ROS, Gazebo, X11 and Tensorflow

License: Apache License 2.0

Dockerfile 87.17% Shell 12.83%

docker-ros-x11's Introduction

Docker container images with ROS, Gazebo, X11 windows and Tensorflow capability

This repository developed from nvidia/opengl and nvidia/cuda conatiners, combine these two together to create a ROS develope environment in docker

Current Image Build:

  • henry2423/ros-x11-ubuntu:melodic : Ubuntu 16.04 with ROS melodic + Gazebo 9

  • henry2423/ros-x11-ubuntu:kinetic : Ubuntu 16.04 with ROS Kinetic + Gazebo 8

Requirement

  • Docker and Nvidia-docker(docker nvidia runtime) on the host: Check with NVIDIA/nvidia-docker

  • X11 Server install:

    $ apt-get install xauth xorg openbox
    

Usage

  • For the first time before runing up the docker, you should setup X11 socket and X11 auth files by runing command:

    XSOCK=/tmp/.X11-unix
    XAUTH=/tmp/.docker.xauth
    touch $XAUTH
    xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
    
  • Run command with x11 configuration, to set up the display environment:

    nvidia-docker run -it \
      --volume /tmp/.X11-unix:/tmp/.X11-unix:rw \
      --volume /tmp/.docker.xauth:/tmp/.docker.xauth:rw \
      --env "XAUTHORITY=/tmp/.docker.xauth" \
      --env "DISPLAY" \
      --volume /etc/passwd:/etc/passwd \
      --volume /etc/group:/etc/group \
      --user $(id -u):$(id -g) \
      henry2423/ros-x11-ubuntu:kinetic \
      bash
    
  • If you want to connect to tensorboard, run command with mapping to local port 6006:

    nvidia-docker run -it \
      -p 6006:6006 \
      --volume /tmp/.X11-unix:/tmp/.X11-unix:rw \
      --volume /tmp/.docker.xauth:/tmp/.docker.xauth:rw \
      --env "XAUTHORITY=/tmp/.docker.xauth" \
      --env "DISPLAY" \
      --volume /etc/passwd:/etc/passwd \
      --volume /etc/group:/etc/group \
      --volume /etc/shadow:/etc/shadow \
      --user $(id -u):$(id -g) \
      henry2423/ros-x11-ubuntu:kinetic \
      bash
    
  • Build an image from scratch:

    docker build -t henry2423/ros-x11-ubuntu .
    

Detail Environment setting

1) Connecting jupyter notebook within container

  • Run command with mapping to local port 8888 (jupyter protocol) and 8888 (host web access):

    nvidia-docker run -it \
      -p 8888:8888 \
      --volume /tmp/.X11-unix:/tmp/.X11-unix:rw \
      --volume /tmp/.docker.xauth:/tmp/.docker.xauth:rw \
      --env "XAUTHORITY=/tmp/.docker.xauth" \
      --env "DISPLAY" \
      --volume /etc/passwd:/etc/passwd \
      --volume /etc/group:/etc/group \
      --volume /etc/shadow:/etc/shadow \
      --user $(id -u):$(id -g) \
      henry2423/ros-x11-ubuntu:kinetic \
      bash
    
  • Check your container assigned IP using $ifconfig within container, then you can start up jupyter notebook in container with following command:

    jupyter notebook --ip={YOUR CONTAINER IP} --port=8888 --allow-root
    
  • After start up the jupyter kernel, you can access the notebook from host browser through HTTP service.

    http://localhost:8888/
    

Connect & Control

If the container runs up, you can connect to the container throught the following

  • You can open the GUI program directly, such as rviz and gazebo
  • Connect to Tensorboard if you do the tensorboard mapping above: http://localhost:6006
  • Connect to Jupyter if you do the tensorboard mapping above: http://localhost:8888/
  • The username and password in container is same as your host account

docker-ros-x11's People

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.