diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index e413518576..ef7f1e0b31 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -9,9 +9,51 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* RUN mkdir /src && mkdir /src/astrobee + + +# installing opencv4 +RUN apt-get purge -y libopencv* + +RUN cd /home +RUN mkdir opencv && cd opencv + +RUN wget https://github.com/opencv/opencv/archive/refs/tags/4.2.0.zip +RUN unzip 4.2.0.zip +RUN rm 4.2.0.zip +RUN wget https://github.com/opencv/opencv_contrib/archive/refs/tags/4.2.0.zip +RUN unzip 4.2.0.zip +RUN rm 4.2.0.zip + +RUN sudo apt update +RUN sudo apt install build-essential cmake git pkg-config libgtk-3-dev \ + libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ + libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \ + gfortran openexr libatlas-base-dev python3-dev python3-numpy \ + libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \ + libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev + +RUN apt-get install opencl-headers + +RUN cd /home/opencv/opencv-4.2.0 +RUN mkdir -p build && cd build + +RUN cmake -D CMAKE_BUILD_TYPE=RELEASE \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D INSTALL_C_EXAMPLES=ON \ + -D INSTALL_PYTHON_EXAMPLES=ON \ + -D OPENCV_GENERATE_PKGCONFIG=ON \ + -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.2.0/modules \ + -D BUILD_EXAMPLES=ON .. + +RUN make -j4 +RUN sudo make install + +RUN export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/opencv/opencv-4.2.0/build/lib + +# zsh RUN sh -c "$(wget -O- https://github.com/deluan/zsh-in-docker/releases/download/v1.1.5/zsh-in-docker.sh)" -- \ -t robbyrussell RUN echo source /opt/ros/rolling/setup.zsh >> /root/.zshrc RUN echo source /src/astrobee/install/setup.zsh >> /root/.zshrc CMD [ "zsh" ] -ENV MAKEFLAGS="-j4" \ No newline at end of file +ENV MAKEFLAGS="-j4" diff --git a/description/astrobee_media b/description/astrobee_media new file mode 160000 index 0000000000..316dd695ae --- /dev/null +++ b/description/astrobee_media @@ -0,0 +1 @@ +Subproject commit 316dd695ae33fd78f7706f2657e1fd640a24cfdc diff --git a/scripts/install_opencv4.txt b/scripts/install_opencv4.txt new file mode 100644 index 0000000000..15735ce028 --- /dev/null +++ b/scripts/install_opencv4.txt @@ -0,0 +1,39 @@ +apt-get purge -y libopencv* + +cd /home +mkdir opencv && cd opencv + +wget https://github.com/opencv/opencv/archive/refs/tags/4.2.0.zip +unzip 4.2.0.zip +rm 4.2.0.zip +wget https://github.com/opencv/opencv_contrib/archive/refs/tags/4.2.0.zip +unzip 4.2.0.zip +rm 4.2.0.zip + +sudo apt update +sudo apt install build-essential cmake git pkg-config libgtk-3-dev \ + libavcodec-dev libavformat-dev libswscale-dev libv4l-dev \ + libxvidcore-dev libx264-dev libjpeg-dev libpng-dev libtiff-dev \ + gfortran openexr libatlas-base-dev python3-dev python3-numpy \ + libtbb2 libtbb-dev libdc1394-22-dev libopenexr-dev \ + libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev + +apt-get install opencl-headers + +cd /home/opencv/opencv-4.2.0 +mkdir -p build && cd build + +cmake -D CMAKE_BUILD_TYPE=RELEASE \ + -D CMAKE_INSTALL_PREFIX=/usr/local \ + -D INSTALL_C_EXAMPLES=ON \ + -D INSTALL_PYTHON_EXAMPLES=ON \ + -D OPENCV_GENERATE_PKGCONFIG=ON \ + -D OPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.2.0/modules \ + -D BUILD_EXAMPLES=ON .. + + +make -j4 +sudo make install + + +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/opencv/opencv-4.2.0/build/lib diff --git a/shared/config_reader/CMakeLists.txt b/shared/config_reader/CMakeLists.txt index 54dc830e28..557ccb72b3 100644 --- a/shared/config_reader/CMakeLists.txt +++ b/shared/config_reader/CMakeLists.txt @@ -44,6 +44,7 @@ include_directories( include ${rclcpp_INCLUDE_DIRS} ${LUAJIT_INCLUDE_DIR} + ${ff_common_INCLUDE_DIR} ) # Declare C++ libraries diff --git a/shared/ff_common/CMakeLists.txt b/shared/ff_common/CMakeLists.txt index e3a86dbb41..f5b79ead7a 100644 --- a/shared/ff_common/CMakeLists.txt +++ b/shared/ff_common/CMakeLists.txt @@ -39,6 +39,7 @@ include_directories( include ${rclcpp_INCLUDE_DIRS} ${EIGEN3_INCLUDE_DIR} + ${ff_common_INCLUDE_DIRS} ) # Declare C++ libraries