Skip to content

Instantly share code, notes, and snippets.

@mikaelarguedas
Created March 10, 2020 09:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikaelarguedas/2f3960bfa43dc8f1f355311c9a5d8e0b to your computer and use it in GitHub Desktop.
Save mikaelarguedas/2f3960bfa43dc8f1f355311c9a5d8e0b to your computer and use it in GitHub Desktop.
DOckerfile to build astra camera on armhf
FROM osrf/debian_armhf:buster
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y dirmngr gnupg2 lsb-release
# setup ROS repositories
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
# install ROS tools
RUN apt-get update \
&& apt-get install -y \
python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential python-catkin-tools python-vcstool
RUN rosdep init && rosdep update
# build ROS base
RUN mkdir /ros_base_ws
RUN mkdir /ros_base_ws/src
WORKDIR /ros_base_ws
RUN rosinstall_generator ros_base --rosdistro melodic --deps --tar > melodic-ros_base.rosinstall
RUN vcs import src < melodic-ros_base.rosinstall
RUN rosdep install --from-paths src --ignore-src --rosdistro melodic -y
RUN catkin config --install --cmake-args -DCMAKE_BUILD_TYPE=Release
RUN catkin build
# build workspace with astra camera and dependencies
RUN mkdir /ros_overlay_ws
RUN mkdir /ros_overlay_ws/src
WORKDIR /ros_overlay_ws/src
# Using last released version: 0.3.0
RUN git clone https://github.com/orbbec/ros_astra_camera -b 0.3.0
WORKDIR /ros_overlay_ws
# Hacking because ros_astra_camera has nvere been released in melodic
# ask rosdep to give the list of ros-melodic-* to install
RUN rosdep install --from-paths src --ignore-src --rosdistro melodic -y --simulate --os ubuntu:bionic | grep melodic > pkg_list
# convert from ros-melodic-package-name to package_name
RUN sed -e 's#.*ros-melodic-\(\)#\1#' pkg_list | sed 's/-/_/g' > pkg_list2
# use rosinstall to get all the repositories to clone
RUN . /ros_base_ws/install/setup.sh && rosinstall_generator `cat pkg_list2` --deps --tar --exclude RPP --rosdistro melodic > deps_to_build.rosinstall
# clone the repositories
RUN vcs import src < deps_to_build.rosinstall
# install system dependencies
RUN . /ros_base_ws/install/setup.sh && rosdep install --from-paths src --ignore-src --rosdistro melodic -y
# build the workspace
RUN . /ros_base_ws/install/setup.sh && catkin build
CMD ["bash"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment