Skip to content

Commit

Permalink
Working Dockerfile. Started docker-config.
Browse files Browse the repository at this point in the history
Run docker-compose up to bring up network.
  • Loading branch information
alongreyber committed May 31, 2017
1 parent 3c3ac51 commit d2f05da
Show file tree
Hide file tree
Showing 8 changed files with 95 additions and 72 deletions.
File renamed without changes.
44 changes: 44 additions & 0 deletions Docker_setup_ROS.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# ROS Setup install script for new jetsons
# Source: https://github.com/jetsonhacks/installROSTX1/blob/master/installROS.sh
# Setup Locale
# update-locale LANG=C LANGUAGE=C LC_ALL=C LC_MESSAGES=POSIX
# Setup sources.lst
sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# Setup keys
apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116
# Installation
apt update
# Add Individual Packages here
# You can install a specific ROS package (replace underscores with dashes of the package name):
# apt-get install ros-kinetic-PACKAGE
# e.g.
# apt-get install ros-kinetic-navigation
# To find available packages:
# apt-cache search ros-kinetic
#
apt install -y python-rosdep python-rosinstall terminator ros-kinetic-rqt ros-kinetic-rqt-common-plugins ros-kinetic-tf2-ros \
ros-kinetic-pcl-conversions ros-kinetic-cv-bridge ros-kinetic-tf ros-kinetic-map-server ros-kinetic-rviz ros-kinetic-hector-slam \
ros-kinetic-hector-slam-launch ros-kinetic-rtabmap-ros ros-kinetic-robot-localization ros-kinetic-navigation ros-kinetic-robot-state-publisher \
python-wstool ninja-build libsuitesparse-dev ros-kinetic-tf2-tools ros-kinetic-hardware-interface ros-kinetic-controller-manager ros-kinetic-control-msgs \
ros-kinetic-joint-limits-interface ros-kinetic-transmission-interface ros-kinetic-control-toolbox libgoogle-glog-dev google-mock libcairo2-dev \
protobuf-compiler liblua5.3-dev libopencv-dev ros-kinetic-rosparam-shortcuts
# Initialize rosdep
rosdep init

# Google Cartographer installation from https://google-cartographer-ros.readthedocs.io/en/latest/
# (Latest as of 4/27/2017, at least)
cd /ws/zebROS_ws
# Merge the cartographer_ros.rosinstall file and fetch code for dependencies.
wstool merge -t src https://raw.githubusercontent.com/googlecartographer/cartographer_ros/master/cartographer_ros.rosinstall
wstool update -t src

# Install deb dependencies.
# The command 'rosdep init' will print an error if you have already
# executed it since installing ROS. This error can be ignored.
rosdep update
rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

rm -rf /ws/zebROS_ws/src/zed-ros-wrapper-master /ws/zebROS_ws/src/zed_covariance # Disable ZED stuff
source /opt/ros/kinetic/setup.bash
catkin_make_isolated --install --use-ninja
source install_isolated/setup.bash
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM ros:kinetic-robot

# Copy code to /ws
ADD zebROS_ws/src /ws/zebROS_ws/src
ADD zebravision/ /ws/zebravision
ADD navXTimeSync/ /ws/navXTimeSync
ADD Docker_setup_ROS.sh /

# Run script
RUN bash /Docker_setup_ROS.sh

# Delete source code? If you really want a tiny image do this
# RUN rm -rf /ws/zebravision /ws/zebROS_ws/src /ws/navXTimeSync

# Clear APT lists to keep size down
#RUN rm -rf /var/lib/apt/lists/
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3'
#volumes:
# Build a directory structure similar to the 2017VisionCode
# so that CMake finds dependencies
# - zebROS_ws/src:/ws/zebROS_ws/src
# - zebravision/:/ws/zebravision
# - navXTimeSync/:/ws/navXTimeSync
# Disabled right now because code is copied in on build
services:
master:
image: ros:kinetic-ros-core
environment:
- "ROS_HOSTNAME=master"
command:
- roscore

compute:
build:
context: .
dockerfile: Dockerfile
environment:
- "ROS_HOSTNAME=compute"
- "ROS_MASTER_URI=http://master:11311"
container_name: master
command: bash -c "source /ws/zebROS_ws/devel_isolated/setup.bash && roslaunch controller_node controller_compute"

zed:
build: .
container_name: zed
environment:
- "ROS_HOSTNAME=zed"
- "ROS_MASTER_URI=http://master:11311"
command: bash -c "source /ws/zebROS_ws/devel_isolated/setup.bash && roslaunch controller_node controller_compute"
47 changes: 0 additions & 47 deletions zebROS_ws/Docker_setup_ROS.sh

This file was deleted.

6 changes: 0 additions & 6 deletions zebROS_ws/Dockerfile

This file was deleted.

17 changes: 0 additions & 17 deletions zebROS_ws/docker-compose.yml

This file was deleted.

4 changes: 2 additions & 2 deletions zebROS_ws/src/controller_node/launch/controller_master.launch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>

<launch>
<!--
<!--
Master Node Launcher
* ZED Wrapper Instance
* Goal Detection Node
Expand All @@ -25,7 +25,7 @@
<arg name="down_sample" default="true" />
<arg name="sub_rate" default="10" />
<arg name="pub_rate" default="1" />

<group ns="$(arg name)">
<include file="$(find zed_wrapper)/launch/zed_camera.launch">
<arg name="svo_file" value="$(arg svo_file)" />
Expand Down

0 comments on commit d2f05da

Please sign in to comment.