From 7b7b761288eaed6aea5fd86b653b8bf7b35fd2f2 Mon Sep 17 00:00:00 2001 From: joris997 Date: Sun, 2 Jul 2023 16:55:56 +0200 Subject: [PATCH 1/3] fixed import issue for trapezoid planner and ff_common --- mobility/planner_trapezoidal/CMakeLists.txt | 3 ++- shared/config_reader/CMakeLists.txt | 1 + shared/ff_common/CMakeLists.txt | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/mobility/planner_trapezoidal/CMakeLists.txt b/mobility/planner_trapezoidal/CMakeLists.txt index 0a3fe25eba..f1c96f0da9 100644 --- a/mobility/planner_trapezoidal/CMakeLists.txt +++ b/mobility/planner_trapezoidal/CMakeLists.txt @@ -89,10 +89,11 @@ install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION lib/${PROJECT_NAME} + INCLUDES DESTINATION include ) # Mark cpp header files for installation -install(DIRECTORY include +install(DIRECTORY include/${PROJECT_NAME} DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE 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 b8e309de5c..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 @@ -68,7 +69,7 @@ endif() ############# # Mark cpp header files for installation -install(DIRECTORY include +install(DIRECTORY include/${PROJECT_NAME} DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN ".svn" EXCLUDE @@ -80,6 +81,7 @@ install(TARGETS ${PROJECT_NAME} ARCHIVE DESTINATION lib LIBRARY DESTINATION lib RUNTIME DESTINATION lib/${PROJECT_NAME} + INCLUDES DESTINATION include ) ament_export_include_directories(include) From b4bb16716289f1669010a59ffe9c8189a48d3c26 Mon Sep 17 00:00:00 2001 From: joris997 Date: Wed, 5 Jul 2023 16:54:06 +0200 Subject: [PATCH 2/3] added installation instructions for opencv4 --- description/astrobee_media | 1 + scripts/install_opencv4.txt | 39 +++++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 160000 description/astrobee_media create mode 100644 scripts/install_opencv4.txt 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 From 51e34d77cbcf8a6f08cd196f991e724854354e4e Mon Sep 17 00:00:00 2001 From: joris997 Date: Thu, 6 Jul 2023 21:04:30 +0200 Subject: [PATCH 3/3] added opencv4 installation to docker file --- .devcontainer/Dockerfile | 45 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4e06234be2..dbd77aab1d 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -8,4 +8,47 @@ RUN apt-get update \ ros-rolling-xacro \ && rm -rf /var/lib/apt/lists/* -RUN mkdir /src && mkdir /src/astrobee \ No newline at end of file +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