From 353c230db5927b3e060bbfde9a0aa34e27abbe35 Mon Sep 17 00:00:00 2001 From: Andreas Antener Date: Thu, 22 Jan 2015 17:31:47 +0100 Subject: [PATCH] restructured things a little bit --- Tools/ros/docker/px4-ros/Dockerfile | 22 ++++++++++------ .../docker/px4-ros/px4-ros-sitl/Dockerfile | 22 ---------------- .../setup-workspace.sh} | 25 +++++++++++++++---- .../{px4-ros-sitl => px4-ros}/Vagrantfile | 5 +++- 4 files changed, 39 insertions(+), 35 deletions(-) delete mode 100644 Tools/ros/docker/px4-ros/px4-ros-sitl/Dockerfile rename Tools/ros/docker/px4-ros/{px4-ros-sitl/get-sources.sh => scripts/setup-workspace.sh} (51%) rename Tools/ros/vagrant/{px4-ros-sitl => px4-ros}/Vagrantfile (91%) diff --git a/Tools/ros/docker/px4-ros/Dockerfile b/Tools/ros/docker/px4-ros/Dockerfile index 668d507997..74291bd14b 100644 --- a/Tools/ros/docker/px4-ros/Dockerfile +++ b/Tools/ros/docker/px4-ros/Dockerfile @@ -1,16 +1,21 @@ # # Base ROS Indigo # +# TODO +# - use https://github.com/phusion/baseimage-docker as base +# - add user, best synced with host +# - configure ssh to work with vagrant out of the box +# FROM ubuntu:14.04.1 -MAINTAINER Andreas Antener "andreas@antener.name" +MAINTAINER Andreas Antener "andreas@uaventure.com" # Install basics ## Use the "noninteractive" debconf frontend ENV DEBIAN_FRONTEND noninteractive RUN apt-get update \ - && apt-get -y install wget git mercurial openssh-server + && apt-get -y install wget git mercurial # Main ROS Setup # Following http://wiki.ros.org/indigo/Installation/Ubuntu @@ -42,13 +47,16 @@ RUN apt-get -y install ros-indigo-octomap-msgs # && apt-get update \ # && apt-get -y install drcsim -# some QT-Apps/Gazebo don't not show controls without this -ENV QT_X11_NO_MITSHM 1 - -#RUN apt-get install -y openssh-server # Install x11-utils to get xdpyinfo, for X11 display debugging # mesa-utils provides glxinfo, handy for understanding the 3D support. #RUN apt-get -y install x11-utils #RUN apt-get -y install mesa-utils -#CMD ["/bin/sbin/sshd", "-D"] +# Some QT-Apps/Gazebo don't not show controls without this +ENV QT_X11_NO_MITSHM 1 + +COPY scripts/setup-workspace.sh ~/ +RUN chmod +x ~/setup-workspace.sh + + +CMD ["/usr/bin/xterm"] diff --git a/Tools/ros/docker/px4-ros/px4-ros-sitl/Dockerfile b/Tools/ros/docker/px4-ros/px4-ros-sitl/Dockerfile deleted file mode 100644 index 4c47295a8f..0000000000 --- a/Tools/ros/docker/px4-ros/px4-ros-sitl/Dockerfile +++ /dev/null @@ -1,22 +0,0 @@ -# -# PX4 ROS SITL -# - -FROM px4ros/ros-base:no-drcsim -MAINTAINER Andreas Antener "andreas@antener.name" - -# TODO -#USER px4 - -RUN . /opt/ros/indigo/setup.sh \ - && mkdir -p /catkin_ws/src \ - && cd /catkin_ws/src \ - && catkin_init_workspace \ - && cd /catkin_ws \ - && catkin_make \ - && echo "source /catkin_ws/devel/setup.bash" >> ~/.bashrc - -COPY get-sources.sh /catkin_ws/src/ -RUN chmod +x /catkin_ws/src/get-sources.sh - -CMD /bin/bash diff --git a/Tools/ros/docker/px4-ros/px4-ros-sitl/get-sources.sh b/Tools/ros/docker/px4-ros/scripts/setup-workspace.sh similarity index 51% rename from Tools/ros/docker/px4-ros/px4-ros-sitl/get-sources.sh rename to Tools/ros/docker/px4-ros/scripts/setup-workspace.sh index 237ae7500a..6b5ddb0a55 100644 --- a/Tools/ros/docker/px4-ros/px4-ros-sitl/get-sources.sh +++ b/Tools/ros/docker/px4-ros/scripts/setup-workspace.sh @@ -1,28 +1,43 @@ #!/bin/sh # -# Fetch source repositories +# Create workspace at current location and fetch source repositories # +WDIR=`pwd` +WORKSPACE=$WDIR/catkin_ws + +# Setup workspace +mkdir -p $WORKSPACE/src +cd $WORKSPACE/src +catkin_init_workspace +cd $WORKSPACE +catkin_make +echo "source $WORKSPACE/devel/setup.bash" >> ~/.bashrc + # PX4 Firmware +cd $WORKSPACE/src git clone https://github.com/PX4/Firmware.git \ && cd Firmware \ - && git checkout ros \ - && cd .. + && git checkout ros # euroc simulator +cd $WORKSPACE/src git clone https://github.com/PX4/euroc_simulator.git \ && cd euroc_simulator \ - && git checkout px4_nodes \ - && cd .. + && git checkout px4_nodes # mav comm +cd $WORKSPACE/src git clone https://github.com/PX4/mav_comm.git # glog catkin +cd $WORKSPACE/src git clone https://github.com/ethz-asl/glog_catkin.git # catkin simple +cd $WORKSPACE/src git clone https://github.com/catkin/catkin_simple.git +cd $WORKSPACE echo "Execute catkin_make to compile all the sources." diff --git a/Tools/ros/vagrant/px4-ros-sitl/Vagrantfile b/Tools/ros/vagrant/px4-ros/Vagrantfile similarity index 91% rename from Tools/ros/vagrant/px4-ros-sitl/Vagrantfile rename to Tools/ros/vagrant/px4-ros/Vagrantfile index d670e62509..b5169e061a 100644 --- a/Tools/ros/vagrant/px4-ros-sitl/Vagrantfile +++ b/Tools/ros/vagrant/px4-ros/Vagrantfile @@ -6,7 +6,7 @@ # # "vagrant up" will build the images. Should start "xterm" in the end. # -# Notes +# Notes: # (will change, need proper docs) # # Build with multiple dependent docker containers: @@ -17,6 +17,9 @@ # "vagrant docker-run ros -- " # Attention: will loose all data when stopped, vagrant runs this with "--rm" # +# TODO +# - maybe map a local working directory to compile stuff without loosing it in side the docker container +# Vagrant.configure(2) do |config| # Configure docker host