forked from xtdrone/XTDrone
61 lines
1.8 KiB
Docker
61 lines
1.8 KiB
Docker
FROM ros:kinetic-perception
|
|
|
|
ENV CERES_VERSION="1.12.0"
|
|
ENV PCL_VERSION="1.8.0"
|
|
ENV CATKIN_WS=/root/catkin_ws
|
|
|
|
# setup processors number used to compile library
|
|
RUN if [ "x$(nproc)" = "x1" ] ; then export USE_PROC=1 ; else export USE_PROC=$(($(nproc)/2)) ; fi && \
|
|
# Install dependencies
|
|
apt-get update && apt-get install -y \
|
|
cmake \
|
|
libatlas-base-dev \
|
|
libeigen3-dev \
|
|
libgoogle-glog-dev \
|
|
libsuitesparse-dev \
|
|
python-catkin-tools \
|
|
ros-${ROS_DISTRO}-cv-bridge \
|
|
ros-${ROS_DISTRO}-image-transport \
|
|
ros-${ROS_DISTRO}-message-filters \
|
|
ros-${ROS_DISTRO}-tf && \
|
|
rm -rf /var/lib/apt/lists/* && \
|
|
# Build and install Ceres
|
|
git clone https://ceres-solver.googlesource.com/ceres-solver && \
|
|
cd ceres-solver && \
|
|
git checkout tags/${CERES_VERSION} && \
|
|
mkdir build && cd build && \
|
|
cmake .. && \
|
|
make -j${USE_PROC} install && \
|
|
cd ../.. && \
|
|
rm -rf ./ceres-solver && \
|
|
# Build and install pcl
|
|
git clone https://github.com/PointCloudLibrary/pcl.git && \
|
|
cd pcl && \
|
|
git checkout tags/pcl-${PCL_VERSION} && \
|
|
mkdir build && cd build && \
|
|
cmake .. && \
|
|
make -j${USE_PROC} install && \
|
|
cd ../.. && \
|
|
rm -rf ./pcl && \
|
|
# Setup catkin workspace
|
|
mkdir -p $CATKIN_WS/src/A-LOAM/
|
|
|
|
# WORKDIR $CATKIN_WS/src
|
|
|
|
# Copy A-LOAM
|
|
COPY ./ $CATKIN_WS/src/A-LOAM/
|
|
# use the following line if you only have this dockerfile
|
|
# RUN git clone https://github.com/HKUST-Aerial-Robotics/A-LOAM.git
|
|
|
|
# Build A-LOAM
|
|
WORKDIR $CATKIN_WS
|
|
ENV TERM xterm
|
|
ENV PYTHONIOENCODING UTF-8
|
|
RUN catkin config \
|
|
--extend /opt/ros/$ROS_DISTRO \
|
|
--cmake-args \
|
|
-DCMAKE_BUILD_TYPE=Release && \
|
|
catkin build && \
|
|
sed -i '/exec "$@"/i \
|
|
source "/root/catkin_ws/devel/setup.bash"' /ros_entrypoint.sh
|