Giter Site home page Giter Site logo

henry2423 / docker-ros-vnc Goto Github PK

View Code? Open in Web Editor NEW
58.0 4.0 36.0 325 KB

A docker environment with ROS, Gazebo, Xfce4 VNC Desktop and Tensorflow

License: Apache License 2.0

Dockerfile 28.16% Shell 71.84%
docker-container vnc ros xfce4-vnc-desktop gazebo tensorflow tensorflow-gpu novnc-html5 dockerfile

docker-ros-vnc's Introduction

Docker container images with ROS, Gazebo, Xfce4 VNC Desktop and Tensorflow

This repository developed from ConSol/docker-headless-vnc-container, with provide the headless VNC environments for docker container

Current Image Build:

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

  • henry2423/ros-vnc-ubuntu:lunar : Ubuntu 16.04 with ROS Lunar + Gazebo 9

  • henry2423/ros-vnc-ubuntu:melodic: Ubuntu 18.04 with ROS Melodic + Gazebo 9

Spec

This is a Docker environmentalist equipped with ROS, Gazebo, xfce-vnc, no-vnc(http vnc service) and TensorFlow-gpu. The container is developed under xfce-docker-container source and add the ROS, TensorFlow GPU environment on top of it, to provide a essential kit for anyone who develop with robotic and deep learning.

Usage

  • Run command with mapping to local port 5901 (vnc protocol) and 6901 (vnc web access):

    docker run -d -p 5901:5901 -p 6901:6901 henry2423/ros-vnc-ubuntu:kinetic
    
  • If you want to get into the container use interactive mode -it and bash

    docker run -it -p 5901:5901 -p 6901:6901 henry2423/ros-vnc-ubuntu:kinetic bash
    
  • If you want to connect to tensorboard, run command with mapping to local port 6006:

    docker run -it -p 5901:5901 -p 6901:6901 -p 6006:6006 henry2423/ros-vnc-ubuntu:kinetic
    
  • Build an image from scratch:

    docker build -t henry2423/ros-vnc-ubuntu:kinetic .
    

Connect & Control

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

Detail Environment setting

1.1) Using root (user id 0)

Add the --user flag to your docker run command:

docker run -it --user root -p 5901:5901 henry2423/ros-vnc-ubuntu:kinetic

1.2) Using user and group id of host system

Add the --user flag to your docker run command (Note: uid and gui of host system may not able to map with container, which is 1000:1000. If that is the case, check with 3):

docker run -it -p 5901:5901 --user $(id -u):$(id -g) henry2423/ros-vnc-ubuntu:kinetic

2) Override VNC and Container environment variables

The following VNC environment variables can be overwritten at the docker run phase to customize your desktop environment inside the container:

  • VNC_COL_DEPTH, default: 24
  • VNC_RESOLUTION, default: 1920x1080
  • VNC_PW, default: vncpassword
  • USER, default: ros
  • PASSWD, default: ros

2.1) Example: Override the VNC password

Simply overwrite the value of the environment variable VNC_PW. For example in the docker run command:

docker run -it -p 5901:5901 -p 6901:6901 -e VNC_PW=vncpassword henry2423/ros-vnc-ubuntu:kinetic

2.2) Example: Override the VNC resolution

Simply overwrite the value of the environment variable VNC_RESOLUTION. For example in the docker run command:

docker run -it -p 5901:5901 -p 6901:6901 -e VNC_RESOLUTION=800x600 henry2423/ros-vnc-ubuntu:kinetic

3) Mounting local directory to conatiner

You should run with following environment variable in order to mapping host user/group with container, and retrieve R/W permission of mounting directory in container (Note: after running this command, the user account in container will be same as host account):

  docker run -it -p 5901:5901 \
    --user $(id -u):$(id -g) \
    --volume /etc/passwd:/etc/passwd \
    --volume /etc/group:/etc/group \
    --volume /etc/shadow:/etc/shadow \
    --volume /home/ros/Desktop:/home/ros/Desktop:rw \
    henry2423/ros-vnc-ubuntu:kinetic

4) Connecting jupyter notebook within container

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

    docker run -d -p 8888:8888 henry2423/ros-vnc-ubuntu:kinetic
    
  • Check your local IP within container using $ifconfig, 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/
    

Contributors

docker-ros-vnc's People

Contributors

henry2423 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

docker-ros-vnc's Issues

Catkin not found

The container isn't able to run Catkin. It seems like you must have it in the build. Suggestions?

Running a node that uses gazebo using docker exec doesn't work

After I run the container using docker run -d -p 5901:5901 -p 6901:6901 henry2423/ros-vnc-ubuntu:kinetic, I can access the vnc interface through my browser.
Now I have a sample project rrbot https://github.com/ros-simulation/gazebo_ros_demos.
I can only start the gazebo when I run the roslaunch command from browser.
But if I run the roslaunch command using docker exec -t c32f456bba2c bash -c "roslaunch rrbot_gazebo rrbot_world.launch", it starts the node but doesn't spin up gazebo in the vnc desktop. It gets stuck here

started core service [/rosout]
process[gazebo-2]: started with pid [176]
[ INFO] [1600019161.652547400]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1600019161.653956700]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
process[gazebo_gui-3]: started with pid [196]
[ INFO] [1600019162.131817800]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1600019162.132983500]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
gazeb: cannot connect to X server 
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
terminate called recursively
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
Aborted
process[urdf_spawner-4]: started with pid [278]
[gazebo_gui-3] process has died [pid 196, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzclient __name:=gazebo_gui __log:=/home/ubuntu/.ros/log/fbc04204-f5e8-11ea-b56f-0242ac110002/gazebo_gui-3.log].
log file: /home/ubuntu/.ros/log/fbc04204-f5e8-11ea-b56f-0242ac110002/gazebo_gui-3*.log
SpawnModel script started
[INFO] [1600019162.889144, 0.000000]: Loading model XML from ros parameter
[INFO] [1600019162.892796, 0.000000]: Waiting for service /gazebo/spawn_urdf_model

Can you please help?

M1 Macbook incompatibility

After connecting docker container via vnc over browser or vnc viewer on M1 MacBook , gazebo or Rviz doesn't work on container but it works on Linux OS. I think that it should be related with X11 forwarding. The rest work like roscore only gui needed programs don't work.

Rviz Error

QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-ros'
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-ros'
[ INFO] [1640298158.681437429]: rviz version 1.13.1
[ INFO] [1640298158.683854846]: compiled against Qt version 5.9.5
[ INFO] [1640298158.683982096]: compiled against OGRE version 1.9.0 (Ghadamon)
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
qemu:handle_cpu_signal received signal outside vCPU context @ pc=0x31e1f6
Aborted

Gazebo Error

Operation not permitted (src/thread.cpp:231)
Operation not permitted (src/thread.cpp:231)
qemu: uncaught target signal 6 (Aborted) - core dumped

Cannot fetch packages from apt due to invalid GPG key

When using any apt command, it mostly fails due to a GPG mismatch. The issue is that the ROS feeds (which are added) changed the GPG key. See https://discourse.ros.org/t/new-gpg-keys-deployed-for-packages-ros-org/9454 for details.

The fix I currently do is call the following:

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-key del 421C365BD9FF1F717815A3895523BAEEB01FA116

Would be great to have the correct GPG key already in the base image.

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.