forked from jacobs-robotics/uw-calibration-pinax
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
95 lines (80 loc) · 3.43 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
FROM ubuntu:16.04
MAINTAINER Arturo Gomez Chavez "[email protected]"
# setup environment
RUN apt-get clean && apt-get update && apt-get install -y locales && locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV ROS_DISTRO kinetic
# create user folders
RUN mkdir -p $HOME/input_data
RUN mkdir -p $HOME/output_data
# upgrade existing packages
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get upgrade -y \
&& rm -rf /var/lib/apt/lists/*
# install some generic dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends \
wget \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# install ROS
RUN /bin/bash -c 'echo "deb http://packages.ros.org/ros/ubuntu xenial main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y \
ros-kinetic-desktop \
&& rm -rf /var/lib/apt/lists/*
RUN rosdep init && rosdep update
# install some Pinax ROS dependencies
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ros-kinetic-cv-bridge \
ros-kinetic-image-geometry \
ros-kinetic-image-transport \
libgsl-dev \
&& rm -rf /var/lib/apt/lists/*
# install necessary packages for OpenCV/Ceres/CamoDocal
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends \
libtiff5-dev \
libv4l-dev \
libatlas-base-dev \
gfortran \
git \
cmake \
libblas-dev \
libgoogle-glog-dev \
libsuitesparse-dev \
libgtk2.0-dev \
&& rm -rf /var/lib/apt/lists/*
RUN cd && wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py
# install ceres library for camodocal
WORKDIR /root
RUN wget http://ceres-solver.org/ceres-solver-1.14.0.tar.gz
RUN tar zxf ceres-solver-1.14.0.tar.gz
RUN mkdir ceres-bin && cd ceres-bin && cmake ../ceres-solver-1.14.0
RUN cd ceres-bin && make -j2
RUN cd ceres-bin && make install
# install OpenCV
RUN git clone https://github.com/opencv/opencv.git
RUN git clone https://github.com/opencv/opencv_contrib.git
RUN cd opencv && git checkout 3.4
RUN cd opencv_contrib && git checkout 3.4
# clone camodocal
RUN git clone https://github.com/jacobs-robotics/camodocal.git
# copy script to install OpenCV and camodocal
COPY make_opencv_camodocal.sh /root
RUN chmod a+x $HOME/make_opencv_camodocal.sh
RUN /bin/bash -c ". $HOME/make_opencv_camodocal.sh"
# libdc1394 does not work in Docker, so disable it (we anyways don't need it in here)
RUN ln /dev/null /dev/raw1394 && apt-get update && DEBIAN_FRONTEND=noninteractive apt-get remove -q -y libgtk2.0-dev
#Manual fix to prevent GTK errors
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -q -y --no-install-recommends libgtk2.0-dev
# create initial workspace
RUN mkdir -p $HOME/pinax/src
RUN rm /etc/ros/rosdep/sources.list.d/20-default.list
RUN rosdep init
RUN /bin/bash -c ". /opt/ros/kinetic/setup.bash && cd $HOME/pinax/src && catkin_init_workspace"
RUN /bin/bash -c ". /opt/ros/kinetic/setup.bash && cd $HOME/pinax && catkin_make"
RUN /bin/bash -c "echo source $HOME/pinax/devel/setup.bash >> $HOME/.bashrc"
# copy and build PinAx code
COPY src /root/pinax/src
RUN /bin/bash -c ". $HOME/pinax/devel/setup.bash && cd pinax && catkin_make"
# provide startup command
COPY src/run_pinax.sh /root/.
CMD /bin/bash -c ". $HOME/pinax/devel/setup.bash && ./run_pinax.sh"