From aa093ec0bd79be0f81926ec435acc20e4b785a01 Mon Sep 17 00:00:00 2001 From: Souriya Trinh Date: Mon, 8 Feb 2021 00:20:12 +0100 Subject: [PATCH 01/17] Add C++11 in core/CMakeLists.txt since sample-vpVelocityTwistMatrix-3.cpp uses brace-enclosed initializer list. Add some Github actions to automatically check for correct visp_sample build. --- .github/workflows/macos-dep-brew.yml | 41 ++++++++++++++++++ .github/workflows/macos-dep-src.yml | 60 +++++++++++++++++++++++++ .github/workflows/ubuntu-dep-src.yml | 65 ++++++++++++++++++++++++++++ core/CMakeLists.txt | 6 ++- 4 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/macos-dep-brew.yml create mode 100644 .github/workflows/macos-dep-src.yml create mode 100644 .github/workflows/ubuntu-dep-src.yml diff --git a/.github/workflows/macos-dep-brew.yml b/.github/workflows/macos-dep-brew.yml new file mode 100644 index 0000000..0c8b8f1 --- /dev/null +++ b/.github/workflows/macos-dep-brew.yml @@ -0,0 +1,41 @@ +name: MacOS-dep-brew + +# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events +on: + push: + pull_request: + schedule: + - cron: '0 2 * * SUN' + +jobs: + build-macos-dep-brew: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-10.15, macos-11.0] + + steps: + # https://github.com/marketplace/actions/cancel-workflow-action + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.5.0 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Print system information + run: sysctl -a | grep machdep.cpu + + - name: Print OS information + run: system_profiler SPSoftwareDataType + + - name: Install dependencies + run: brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl visp + + - name: Configure CMake and build visp_sample + run: | + mkdir build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release + make -j2 diff --git a/.github/workflows/macos-dep-src.yml b/.github/workflows/macos-dep-src.yml new file mode 100644 index 0000000..106da13 --- /dev/null +++ b/.github/workflows/macos-dep-src.yml @@ -0,0 +1,60 @@ +name: MacOS-dep-sec + +# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events +on: + push: + pull_request: + schedule: + - cron: '0 2 * * SUN' + +jobs: + build-macos-dep-sec: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-10.15, macos-11.0] + + steps: + # https://github.com/marketplace/actions/cancel-workflow-action + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.5.0 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Print system information + run: sysctl -a | grep machdep.cpu + + - name: Print OS information + run: system_profiler SPSoftwareDataType + + - name: Install dependencies + run: brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl + + # Openblas location is exported explicitly because openblas is keg-only, + # which means it was not symlinked into /usr/local/. + - name: Clone and configure ViSP + run: | + git clone --depth 1 https://github.com/lagadic/visp.git ${HOME}/visp + cd ${HOME}/visp + export LDFLAGS="-L/usr/local/opt/openblas/lib" + export CPPFLAGS="-I/usr/local/opt/openblas/include" + mkdir build && cd build + cmake .. -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install + cat ViSP-third-party.txt + + - name: Build and install ViSP + run: | + cd ${HOME}/visp/build + make -j2 install + echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV + echo $VISP_DIR + + - name: Configure CMake and build visp_sample + run: | + mkdir build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release + make -j2 diff --git a/.github/workflows/ubuntu-dep-src.yml b/.github/workflows/ubuntu-dep-src.yml new file mode 100644 index 0000000..d3dd3e4 --- /dev/null +++ b/.github/workflows/ubuntu-dep-src.yml @@ -0,0 +1,65 @@ +name: Ubuntu-dep-src + +# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events +on: + push: + pull_request: + schedule: + - cron: '0 2 * * SUN' + +jobs: + build-ubuntu-dep-src: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04] + + steps: + # https://github.com/marketplace/actions/cancel-workflow-action + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.5.0 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Print system information + run: lscpu + + - name: Print OS information + run: lsb_release -a + + - name: Install dependencies + run: | + sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev gfortran liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev libxml2-dev libpcl-dev + sudo apt-get update && sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev + + - name: Build librealsense2 from source + run: | + pwd + git clone --depth 1 https://github.com/IntelRealSense/librealsense.git ${HOME}/librealsense + cd ${HOME}/librealsense + mkdir build && cd build && mkdir install + cmake .. -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install + make -j2 install + echo "REALSENSE2_DIR=$(pwd)/install" >> $GITHUB_ENV + echo $REALSENSE2_DIR + + - name: Build ViSP from source + run: | + git clone --depth 1 https://github.com/lagadic/visp.git ${HOME}/visp + cd ${HOME}/visp + mkdir build && cd build && mkdir install + cmake .. -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install + cat ViSP-third-party.txt + make -j2 install + echo "VISP_DIR=$(pwd)/install" >> $GITHUB_ENV + echo $VISP_DIR + + - name: Configure CMake and build visp_sample + run: | + mkdir build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release + make -j2 diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index a7e184b..79628dd 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -1,6 +1,10 @@ project(sample-core) -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 2.6) + +# C++11 is needed for brace-enclosed initializer list in sample-vpVelocityTwistMatrix-3.cpp:9:37 +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) file(GLOB src_cpp RELATIVE ${CMAKE_CURRENT_LIST_DIR} "*.cpp") From 1fe77926eea0a496dc348b483a8c1f14cc9c8b27 Mon Sep 17 00:00:00 2001 From: Souriya Trinh Date: Mon, 8 Feb 2021 22:15:04 +0100 Subject: [PATCH 02/17] Add brew update && brew upgrade for MacOS builds. Use 3.0 as minimum CMake version. --- .github/workflows/macos-dep-brew.yml | 4 +++- .github/workflows/macos-dep-src.yml | 4 +++- core/CMakeLists.txt | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/macos-dep-brew.yml b/.github/workflows/macos-dep-brew.yml index 0c8b8f1..519bb10 100644 --- a/.github/workflows/macos-dep-brew.yml +++ b/.github/workflows/macos-dep-brew.yml @@ -32,7 +32,9 @@ jobs: run: system_profiler SPSoftwareDataType - name: Install dependencies - run: brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl visp + run: | + brew update && brew upgrade + brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl visp - name: Configure CMake and build visp_sample run: | diff --git a/.github/workflows/macos-dep-src.yml b/.github/workflows/macos-dep-src.yml index 106da13..9f3612a 100644 --- a/.github/workflows/macos-dep-src.yml +++ b/.github/workflows/macos-dep-src.yml @@ -32,7 +32,9 @@ jobs: run: system_profiler SPSoftwareDataType - name: Install dependencies - run: brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl + run: | + brew update && brew upgrade + brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl # Openblas location is exported explicitly because openblas is keg-only, # which means it was not symlinked into /usr/local/. diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 79628dd..2c723ea 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -1,6 +1,6 @@ project(sample-core) -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 3.0) # C++11 is needed for brace-enclosed initializer list in sample-vpVelocityTwistMatrix-3.cpp:9:37 set(CMAKE_CXX_STANDARD 11) From 273f50ceaf55b3b3f1f3a393785707c169a3bd32 Mon Sep 17 00:00:00 2001 From: Souriya Trinh Date: Mon, 8 Feb 2021 23:05:09 +0100 Subject: [PATCH 03/17] =?UTF-8?q?Update=20#defined=20guard=20accordingly?= =?UTF-8?q?=20to=20vpMbKltTracker=20class.=20Add=20#include=20=20to=20solve=20the=20following=20error:=20[=2054?= =?UTF-8?q?%]=20Building=20CXX=20object=20mbt/CMakeFiles/sample-vpMbKltTra?= =?UTF-8?q?cker-1.dir/sample-vpMbKltTracker-1.cpp.o=20/home/runner/work/vi?= =?UTF-8?q?sp=5Fsample/visp=5Fsample/mbt/sample-vpMbKltTracker-1.cpp:=20In?= =?UTF-8?q?=20function=20=E2=80=98int=20main()=E2=80=99:=20/home/runner/wo?= =?UTF-8?q?rk/visp=5Fsample/visp=5Fsample/mbt/sample-vpMbKltTracker-1.cpp:?= =?UTF-8?q?30:3:=20error:=20=E2=80=98vpXmlParser=E2=80=99=20has=20not=20be?= =?UTF-8?q?en=20declared=20=20=20=20vpXmlParser::cleanup();=20=20=20=20^?= =?UTF-8?q?=20make[2]:=20***=20[mbt/CMakeFiles/sample-vpMbKltTracker-1.dir?= =?UTF-8?q?/sample-vpMbKltTracker-1.cpp.o]=20Error=201=20make[1]:=20***=20?= =?UTF-8?q?[mbt/CMakeFiles/sample-vpMbKltTracker-1.dir/all]=20Error=202=20?= =?UTF-8?q?mbt/CMakeFiles/sample-vpMbKltTracker-1.dir/build.make:81:=20rec?= =?UTF-8?q?ipe=20for=20target=20'mbt/CMakeFiles/sample-vpMbKltTracker-1.di?= =?UTF-8?q?r/sample-vpMbKltTracker-1.cpp.o'=20failed=20make[1]:=20***=20Wa?= =?UTF-8?q?iting=20for=20unfinished=20jobs....=20CMakeFiles/Makefile2:5882?= =?UTF-8?q?:=20recipe=20for=20target=20'mbt/CMakeFiles/sample-vpMbKltTrack?= =?UTF-8?q?er-1.dir/all'=20failed=20[=2054%]=20Built=20target=20sample-vpK?= =?UTF-8?q?ltOpencv=20Makefile:113:=20recipe=20for=20target=20'all'=20fail?= =?UTF-8?q?ed=20make:=20***=20[all]=20Error=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add explicit OpenBLAS dependency. --- .github/workflows/macos-dep-brew.yml | 2 +- .github/workflows/macos-dep-src.yml | 2 +- mbt/sample-vpMbKltTracker-1.cpp | 11 ++++++----- mbt/sample-vpMbKltTracker-2.cpp | 11 ++++++----- mbt/sample-vpMbKltTracker.cpp | 3 ++- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.github/workflows/macos-dep-brew.yml b/.github/workflows/macos-dep-brew.yml index 519bb10..20ba7db 100644 --- a/.github/workflows/macos-dep-brew.yml +++ b/.github/workflows/macos-dep-brew.yml @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | brew update && brew upgrade - brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl visp + brew install libpng libjpeg libdc1394 lapack openblas eigen opencv librealsense libxml2 pcl visp - name: Configure CMake and build visp_sample run: | diff --git a/.github/workflows/macos-dep-src.yml b/.github/workflows/macos-dep-src.yml index 9f3612a..4cb18d2 100644 --- a/.github/workflows/macos-dep-src.yml +++ b/.github/workflows/macos-dep-src.yml @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | brew update && brew upgrade - brew install libpng libjpeg libdc1394 lapack eigen opencv librealsense libxml2 pcl + brew install libpng libjpeg libdc1394 lapack openblas eigen opencv librealsense libxml2 pcl # Openblas location is exported explicitly because openblas is keg-only, # which means it was not symlinked into /usr/local/. diff --git a/mbt/sample-vpMbKltTracker-1.cpp b/mbt/sample-vpMbKltTracker-1.cpp index 93d2112..4dc6451 100644 --- a/mbt/sample-vpMbKltTracker-1.cpp +++ b/mbt/sample-vpMbKltTracker-1.cpp @@ -2,15 +2,16 @@ #include #include #include +#include #include int main() { -#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x030000) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) vpMbKltTracker tracker; // Create a model based tracker via Klt Points. vpImage I; - vpHomogeneousMatrix cMo; // Pose used in entry (has to be defined), then computed using the tracker. - + vpHomogeneousMatrix cMo; // Pose used in entry (has to be defined), then computed using the tracker. + //acquire an image vpImageIo::readPGM(I, "cube.pgm"); // Example of acquisition @@ -23,9 +24,9 @@ int main() while(true){ // acquire a new image tracker.track(I); // track the object on this image - tracker.getPose(cMo); // get the pose + tracker.getPose(cMo); // get the pose } - + // Cleanup memory allocated by xml library used to parse the xml config file in vpMbKltTracker::loadConfigFile() vpXmlParser::cleanup(); diff --git a/mbt/sample-vpMbKltTracker-2.cpp b/mbt/sample-vpMbKltTracker-2.cpp index 73b4870..130ec3a 100644 --- a/mbt/sample-vpMbKltTracker-2.cpp +++ b/mbt/sample-vpMbKltTracker-2.cpp @@ -3,19 +3,20 @@ #include #include #include +#include #include int main() { -#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x030000) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) vpMbKltTracker tracker; // Create a model based tracker via Klt Points. vpImage I; - vpHomogeneousMatrix cMo; // Pose used to display the model. + vpHomogeneousMatrix cMo; // Pose used to display the model. vpCameraParameters cam; - + // Acquire an image vpImageIo::readPGM(I, "cube.pgm"); - + #if defined VISP_HAVE_X11 vpDisplayX display; display.init(I,100,100,"Mb Klt Tracker"); @@ -34,7 +35,7 @@ int main() tracker.display(I, cMo, cam, vpColor::darkRed, 1, true); // Display the model at the computed pose. vpDisplay::flush(I); } - + #if defined VISP_HAVE_XML2 // Cleanup memory allocated by xml library used to parse the xml config file in vpMbKltTracker::loadConfigFile() vpXmlParser::cleanup(); diff --git a/mbt/sample-vpMbKltTracker.cpp b/mbt/sample-vpMbKltTracker.cpp index 77e2ab4..4c39f68 100644 --- a/mbt/sample-vpMbKltTracker.cpp +++ b/mbt/sample-vpMbKltTracker.cpp @@ -4,11 +4,12 @@ #include #include #include +#include #include int main() { -#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x030000) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) vpMbKltTracker tracker; // Create a model based tracker via KLT points. vpImage I; vpHomogeneousMatrix cMo; // Pose computed using the tracker. From 136c90cbcfcf27440d8bfdd196482cc3c6cc1d07 Mon Sep 17 00:00:00 2001 From: Souriya Trinh Date: Tue, 9 Feb 2021 00:17:19 +0100 Subject: [PATCH 04/17] Remove #if defined VISP_HAVE_PUGIXML guard since now ViSP is always built with pugixml support. Remove obsolete vpXmlParser::cleanup(); and VISP_HAVE_XML2 in mbt code. Update correct guard for KLT and OpenCV availabilities in hybrid mbt. --- mbt/sample-vpMbEdgeKltTracker-1.cpp | 2 -- mbt/sample-vpMbEdgeKltTracker-2.cpp | 13 +++---------- mbt/sample-vpMbEdgeKltTracker.cpp | 9 +-------- mbt/sample-vpMbEdgeTracker-1.cpp | 2 -- mbt/sample-vpMbEdgeTracker-2.cpp | 2 -- mbt/sample-vpMbKltTracker-1.cpp | 6 ------ mbt/sample-vpMbKltTracker-2.cpp | 8 -------- mbt/sample-vpMbKltTracker.cpp | 8 -------- 8 files changed, 4 insertions(+), 46 deletions(-) diff --git a/mbt/sample-vpMbEdgeKltTracker-1.cpp b/mbt/sample-vpMbEdgeKltTracker-1.cpp index 3cc7667..e3032c3 100644 --- a/mbt/sample-vpMbEdgeKltTracker-1.cpp +++ b/mbt/sample-vpMbEdgeKltTracker-1.cpp @@ -21,9 +21,7 @@ int main() display.init(I,100,100,"Mb Hybrid Tracker"); #endif -#if defined VISP_HAVE_PUGIXML tracker.loadConfigFile("cube.xml"); // Load the configuration of the tracker -#endif tracker.getCameraParameters(cam); // Get the camera parameters used by the tracker (from the configuration file). // load the 3d model, to read .wrl model coin is required, if coin is not installed .cao file can be used. tracker.loadModel("cube.cao"); diff --git a/mbt/sample-vpMbEdgeKltTracker-2.cpp b/mbt/sample-vpMbEdgeKltTracker-2.cpp index da1f663..72afdac 100644 --- a/mbt/sample-vpMbEdgeKltTracker-2.cpp +++ b/mbt/sample-vpMbEdgeKltTracker-2.cpp @@ -10,20 +10,18 @@ int main() #if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x030000) vpMbEdgeKltTracker tracker; // Create an hybrid model based tracker. vpImage I; - vpHomogeneousMatrix cMo; // Pose used to display the model. + vpHomogeneousMatrix cMo; // Pose used to display the model. vpCameraParameters cam; - + // Acquire an image vpImageIo::readPGM(I, "cube.pgm"); - + #if defined VISP_HAVE_X11 vpDisplayX display; display.init(I,100,100,"Mb Hybrid Tracker"); #endif -#if defined VISP_HAVE_XML2 tracker.loadConfigFile("cube.xml"); // Load the configuration of the tracker -#endif tracker.getCameraParameters(cam); // Get the camera parameters used by the tracker (from the configuration file). tracker.loadModel("cube.cao"); // load the 3d model, to read .wrl model coi is required, if coin is not installed .cao file can be used. @@ -34,11 +32,6 @@ int main() tracker.display(I, cMo, cam, vpColor::darkRed, 1, true); // Display the model at the computed pose. vpDisplay::flush(I); } - -#if defined VISP_HAVE_XML2 - // Cleanup memory allocated by xml library used to parse the xml config file in vpMbEdgeKltTracker::loadConfigFile() - vpXmlParser::cleanup(); -#endif return 0; #endif diff --git a/mbt/sample-vpMbEdgeKltTracker.cpp b/mbt/sample-vpMbEdgeKltTracker.cpp index 7b00de7..b3d7622 100644 --- a/mbt/sample-vpMbEdgeKltTracker.cpp +++ b/mbt/sample-vpMbEdgeKltTracker.cpp @@ -8,7 +8,7 @@ int main() { -#if defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION < 0x030000) +#if defined(VISP_HAVE_MODULE_KLT) && (defined(VISP_HAVE_OPENCV) && (VISP_HAVE_OPENCV_VERSION >= 0x020100)) vpMbEdgeKltTracker tracker; // Create an hybrid model based tracker. vpImage I; vpHomogeneousMatrix cMo; // Pose computed using the tracker. @@ -22,9 +22,7 @@ int main() display.init(I,100,100,"Mb Hybrid Tracker"); #endif -#if defined VISP_HAVE_XML2 tracker.loadConfigFile("cube.xml"); // Load the configuration of the tracker -#endif tracker.getCameraParameters(cam); // Get the camera parameters used by the tracker (from the configuration file). tracker.loadModel("cube.cao"); // Load the 3d model in cao format. No 3rd party library is required tracker.initClick(I, "cube.init"); // Initialise manually the pose by clicking on the image points associated to the 3d points containned in the cube.init file. @@ -39,11 +37,6 @@ int main() vpDisplay::flush(I); } -#if defined VISP_HAVE_XML2 - // Cleanup memory allocated by xml library used to parse the xml config file in vpMbEdgeKltTracker::loadConfigFile() - vpXmlParser::cleanup(); -#endif - return 0; #endif } diff --git a/mbt/sample-vpMbEdgeTracker-1.cpp b/mbt/sample-vpMbEdgeTracker-1.cpp index 48d1ff2..fb50e5f 100644 --- a/mbt/sample-vpMbEdgeTracker-1.cpp +++ b/mbt/sample-vpMbEdgeTracker-1.cpp @@ -13,9 +13,7 @@ int main() //acquire an image vpImageIo::read(I, "cube.pgm"); // Example of acquisition -#if defined VISP_HAVE_PUGIXML tracker.loadConfigFile("cube.xml"); // Load the configuration of the tracker -#endif // load the 3d model, to read .wrl model coin is required, if coin is not installed .cao file can be used. tracker.loadModel("cube.cao"); tracker.initFromPose(I, cMo); // initialize the tracker with the given pose. diff --git a/mbt/sample-vpMbEdgeTracker-2.cpp b/mbt/sample-vpMbEdgeTracker-2.cpp index 5d9d59d..6bf2ca7 100644 --- a/mbt/sample-vpMbEdgeTracker-2.cpp +++ b/mbt/sample-vpMbEdgeTracker-2.cpp @@ -20,9 +20,7 @@ int main() display.init(I,100,100,"Mb Edge Tracker"); #endif -#if defined VISP_HAVE_PUGIXML tracker.loadConfigFile("cube.xml"); // Load the configuration of the tracker -#endif tracker.getCameraParameters(cam); // Get the camera parameters used by the tracker (from the configuration file). // load the 3d model, to read .wrl model coin is required, if coin is not installed // .cao file can be used. diff --git a/mbt/sample-vpMbKltTracker-1.cpp b/mbt/sample-vpMbKltTracker-1.cpp index 4dc6451..954ba0d 100644 --- a/mbt/sample-vpMbKltTracker-1.cpp +++ b/mbt/sample-vpMbKltTracker-1.cpp @@ -2,7 +2,6 @@ #include #include #include -#include #include int main() @@ -15,9 +14,7 @@ int main() //acquire an image vpImageIo::readPGM(I, "cube.pgm"); // Example of acquisition -#if defined VISP_HAVE_XML2 tracker.loadConfigFile("cube.xml"); // Load the configuration of the tracker -#endif tracker.loadModel("cube.cao"); // load the 3d model, to read .wrl model coi is required, if coin is not installed .cao file can be used. tracker.initFromPose(I, cMo); // initialise the tracker with the given pose. @@ -27,9 +24,6 @@ int main() tracker.getPose(cMo); // get the pose } - // Cleanup memory allocated by xml library used to parse the xml config file in vpMbKltTracker::loadConfigFile() - vpXmlParser::cleanup(); - return 0; #endif } diff --git a/mbt/sample-vpMbKltTracker-2.cpp b/mbt/sample-vpMbKltTracker-2.cpp index 130ec3a..207d304 100644 --- a/mbt/sample-vpMbKltTracker-2.cpp +++ b/mbt/sample-vpMbKltTracker-2.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include int main() @@ -22,9 +21,7 @@ int main() display.init(I,100,100,"Mb Klt Tracker"); #endif -#if defined VISP_HAVE_XML2 tracker.loadConfigFile("cube.xml"); // Load the configuration of the tracker -#endif tracker.getCameraParameters(cam); // Get the camera parameters used by the tracker (from the configuration file). tracker.loadModel("cube.cao"); // load the 3d model, to read .wrl model coi is required, if coin is not installed .cao file can be used. @@ -36,11 +33,6 @@ int main() vpDisplay::flush(I); } -#if defined VISP_HAVE_XML2 - // Cleanup memory allocated by xml library used to parse the xml config file in vpMbKltTracker::loadConfigFile() - vpXmlParser::cleanup(); -#endif - return 0; #endif } diff --git a/mbt/sample-vpMbKltTracker.cpp b/mbt/sample-vpMbKltTracker.cpp index 4c39f68..20305df 100644 --- a/mbt/sample-vpMbKltTracker.cpp +++ b/mbt/sample-vpMbKltTracker.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include int main() @@ -23,9 +22,7 @@ int main() display.init(I,100,100,"Mb Klt Tracker"); #endif -#if defined VISP_HAVE_XML2 tracker.loadConfigFile("cube.xml"); // Load the configuration of the tracker -#endif tracker.getCameraParameters(cam); // Get the camera parameters used by the tracker (from the configuration file). tracker.loadModel("cube.cao"); // Load the 3d model in cao format. No 3rd party library is required tracker.initClick(I, "cube.init"); // Initialise manually the pose by clicking on the image points associated to the 3d points containned in the cube.init file. @@ -40,11 +37,6 @@ int main() vpDisplay::flush(I); } -#if defined VISP_HAVE_XML2 - // Cleanup memory allocated by xml library used to parse the xml config file in vpMbKltTracker::loadConfigFile() - vpXmlParser::cleanup(); -#endif - return 0; #endif } From c81c08e76c8f5faf06fcd0ef05526073d1c186ed Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 9 Feb 2021 09:17:30 +0100 Subject: [PATCH 05/17] Allow to pass visp_config prefix to make --- Makefile.visp-config | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.visp-config b/Makefile.visp-config index fcff75d..ff4a66b 100644 --- a/Makefile.visp-config +++ b/Makefile.visp-config @@ -1,7 +1,6 @@ CXX = g++ -VISP_BUILD_DIR = /tmp/usr/local -VISP_CFLAGS = `$(VISP_BUILD_DIR)/bin/visp-config --cflags` -VISP_LDFLAGS = `$(VISP_BUILD_DIR)/bin/visp-config --libs` +VISP_CFLAGS = `$(VISP_INSTALL_PREFIX)/bin/visp-config --cflags` +VISP_LDFLAGS = `$(VISP_INSTALL_PREFIX)/bin/visp-config --libs` SOURCES=$(shell find . -name "sample*.cpp") TARGETS=$(SOURCES:%.cpp=%) From d65d382f4e5c531437f98911d131103e3365ec42 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Tue, 9 Feb 2021 09:25:38 +0100 Subject: [PATCH 06/17] Update instructions to build the project --- README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 77 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f6bdc89..cf9c2ec 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,51 @@ ViSP sample code used as code snippet in ViSP doxygen [documentation](https://visp-doc.inria.fr/doxygen/visp-daily/index.html). +This project uses [ViSP](https://github.com/lagadic/visp) that needs to be build with the following as 3rd-parties: +- OpenCV +- librealsense +- libxml2 +- PCL -This project uses [ViSP](https://github.com/lagadic/visp) as 3rd-party. +## 1. Prerequisities + +### 1.1. Install required 3rd parties + +- On ubuntu + + - Install required packages: + + ``` + $ sudo apt-get update + $ sudo apt-get install pkg-config libopencv-dev libxml2-dev libpcl-dev + ``` + + - Install librealsense from source following these [instructions](https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-install-ubuntu.html#install_ubuntu_3rdparty_realsense) + +- On OSX +``` +$ brew update; brew upgrade +$ brew install opencv librealsense libxml2 pcl +``` + +### 1.2. Build and install ViSP from source See ViSP installation from source [tutorials](https://visp-doc.inria.fr/doxygen/visp-daily/tutorial_install_src.html). -Once ViSP is build, you can build `visp_sample` project: +``` +$ cd $VISP_WS +$ git clone https://github.com/lagadic/visp.git +$ mkdir $VISP_WS/visp-build +$ cd $VISP_WS/visp-build +$ cmake ../visp -DCMAKE_INSTALL_PREFIX=/tmp/usr/local +$ make -j4 install +``` + +Once ViSP is build, you can build `visp_sample` project using one of the 5 different ways that are given in the next sections. + +## 2. Build visp_sample project + +### 2.1. Build visp_sample with ViSP from build tree ``` $ cd $ViSP_WS @@ -16,3 +55,39 @@ $ mkdir visp_sample-build $ cd visp_sample-build $ cmake ../visp_sample -DVISP_DIR=$ViSP_WS/visp-build ``` + +### 2.2. Build visp_sample using `visp-config` from build tree + +``` +$ cd $ViSP_WS/visp_sample +$ make -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp-build +$ make -f Makefile.visp-config clean +``` + +### 2.3. Build visp_sample with ViSP from install tree + +``` +$ cd $ViSP_WS +$ git clone https://github.com/lagadic/visp_sample +$ mkdir visp_sample-build +$ cd visp_sample-build +$ cmake ../visp_sample -DVISP_DIR=/tmp/usr/local/lib/cmake/visp +``` + +### 2.4. Build visp_sample using `visp.pc` from install tree + +``` +$ cd $ViSP_WS/visp_sample +$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig +$ make -f Makefile.visp.pc +$ make -f Makefile.visp.pc clean +``` + +### 2.5. Build visp_sample using `visp-config` from install tree + +``` +$ cd $ViSP_WS/visp_sample +$ export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/tmp/usr/local/lib/pkgconfig +$ make -f Makefile.visp-config VISP_INSTALL_PREFIX=/tmp/usr/local +$ make -f Makefile.visp-config clean +``` From 02e9323d09f4406088a81e958fd43669ab183272 Mon Sep 17 00:00:00 2001 From: Souriya Trinh Date: Tue, 9 Feb 2021 22:31:59 +0100 Subject: [PATCH 07/17] Try removing OpenCV to let ViSP install the needed OpenCV dependency? --- .github/workflows/macos-dep-brew.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos-dep-brew.yml b/.github/workflows/macos-dep-brew.yml index 20ba7db..a259a4e 100644 --- a/.github/workflows/macos-dep-brew.yml +++ b/.github/workflows/macos-dep-brew.yml @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | brew update && brew upgrade - brew install libpng libjpeg libdc1394 lapack openblas eigen opencv librealsense libxml2 pcl visp + brew install libpng libjpeg libdc1394 lapack openblas eigen librealsense libxml2 pcl visp - name: Configure CMake and build visp_sample run: | From 2d27c8f67075d7b371dc7685128690996274593a Mon Sep 17 00:00:00 2001 From: Souriya Trinh Date: Tue, 9 Feb 2021 23:21:22 +0100 Subject: [PATCH 08/17] Print Homebrew packages dependencies. Add ubuntu-extra.yml for extra build types tests. --- .github/workflows/macos-dep-brew.yml | 1 + .github/workflows/ubuntu-extra.yml | 94 ++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 .github/workflows/ubuntu-extra.yml diff --git a/.github/workflows/macos-dep-brew.yml b/.github/workflows/macos-dep-brew.yml index a259a4e..a9fd51e 100644 --- a/.github/workflows/macos-dep-brew.yml +++ b/.github/workflows/macos-dep-brew.yml @@ -35,6 +35,7 @@ jobs: run: | brew update && brew upgrade brew install libpng libjpeg libdc1394 lapack openblas eigen librealsense libxml2 pcl visp + brew deps --tree --installed - name: Configure CMake and build visp_sample run: | diff --git a/.github/workflows/ubuntu-extra.yml b/.github/workflows/ubuntu-extra.yml new file mode 100644 index 0000000..35fc014 --- /dev/null +++ b/.github/workflows/ubuntu-extra.yml @@ -0,0 +1,94 @@ +name: Ubuntu-extra + +# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events +on: + push: + pull_request: + schedule: + - cron: '0 2 * * SUN' + +jobs: + build-ubuntu-extra: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04] + build_type: [visp-dir-build-tree, visp-config-build-tree, visp-dir-install-tree, visp.pc-install-tree, visp-config-install-tree] + + steps: + # https://github.com/marketplace/actions/cancel-workflow-action + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.5.0 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Print system information + run: lscpu + + - name: Print OS information + run: lsb_release -a + + - name: Install dependencies + run: | + sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev gfortran liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev libxml2-dev libpcl-dev + sudo apt-get update && sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev + + - name: Build librealsense2 from source + run: | + pwd + git clone --depth 1 https://github.com/IntelRealSense/librealsense.git ${HOME}/librealsense + cd ${HOME}/librealsense + mkdir build && cd build && mkdir install + cmake .. -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install + make -j2 install + echo "REALSENSE2_DIR=$(pwd)/install" >> $GITHUB_ENV + echo $REALSENSE2_DIR + + - name: Build ViSP from source + run: | + git clone --depth 1 https://github.com/lagadic/visp.git ${HOME}/visp + cd ${HOME}/visp + mkdir build && cd build && mkdir install + cmake .. -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install + cat ViSP-third-party.txt + make -j2 install + echo "ViSP_WS=${HOME}" >> $GITHUB_ENV + echo $ViSP_WS + + - name: Build visp_sample with ViSP from build tree + if: matrix.build_type == 'visp-dir-build-tree' + run: | + mkdir build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=$ViSP_WS/visp/build + make -j2 + + - name: Build visp_sample using visp-config from build tree + if: matrix.build_type == 'visp-config-build-tree' + run: | + make -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp/build + make -f Makefile.visp-config clean + + - name: Build visp_sample with ViSP from install tree + if: matrix.build_type == 'visp-dir-install-tree' + run: | + mkdir build && cd build + cmake .. -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=$ViSP_WS/visp/build/install/lib/cmake/visp + make -j2 + + - name: Build visp_sample using visp.pc from install tree + if: matrix.build_type == 'visp.pc-install-tree' + run: | + export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ViSP_WS/visp/build/install/lib/pkgconfig + make -f Makefile.visp.pc + make -f Makefile.visp.pc clean + + - name: Build visp_sample using visp-config from install tree + if: matrix.build_type == 'visp-config-install-tree' + run: | + export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ViSP_WS/visp/build/install/lib/pkgconfig + make -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp/build/install + make -f Makefile.visp-config clean From 94090d5c174ed85958e131d7045fb985eb4c9f5d Mon Sep 17 00:00:00 2001 From: Souriya Trinh Date: Tue, 9 Feb 2021 23:29:04 +0100 Subject: [PATCH 09/17] Remove matrix.build_type to avoid launching too much builds. --- .github/workflows/ubuntu-extra.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ubuntu-extra.yml b/.github/workflows/ubuntu-extra.yml index 35fc014..42b2232 100644 --- a/.github/workflows/ubuntu-extra.yml +++ b/.github/workflows/ubuntu-extra.yml @@ -14,7 +14,6 @@ jobs: fail-fast: false matrix: os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04] - build_type: [visp-dir-build-tree, visp-config-build-tree, visp-dir-install-tree, visp.pc-install-tree, visp-config-install-tree] steps: # https://github.com/marketplace/actions/cancel-workflow-action @@ -60,14 +59,12 @@ jobs: echo $ViSP_WS - name: Build visp_sample with ViSP from build tree - if: matrix.build_type == 'visp-dir-build-tree' run: | - mkdir build && cd build + mkdir visp_sample-build && cd visp_sample-build cmake .. -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=$ViSP_WS/visp/build make -j2 - name: Build visp_sample using visp-config from build tree - if: matrix.build_type == 'visp-config-build-tree' run: | make -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp/build make -f Makefile.visp-config clean @@ -75,7 +72,7 @@ jobs: - name: Build visp_sample with ViSP from install tree if: matrix.build_type == 'visp-dir-install-tree' run: | - mkdir build && cd build + mkdir visp_sample-build_2 && cd visp_sample-build_2 cmake .. -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=$ViSP_WS/visp/build/install/lib/cmake/visp make -j2 From 9d8e194c01436f68c3114a5ccda1fcf4e0495f99 Mon Sep 17 00:00:00 2001 From: Souriya Trinh Date: Wed, 10 Feb 2021 00:14:32 +0100 Subject: [PATCH 10/17] Forgot to remove if condition. --- .github/workflows/ubuntu-extra.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/ubuntu-extra.yml b/.github/workflows/ubuntu-extra.yml index 42b2232..a7a81a8 100644 --- a/.github/workflows/ubuntu-extra.yml +++ b/.github/workflows/ubuntu-extra.yml @@ -70,21 +70,18 @@ jobs: make -f Makefile.visp-config clean - name: Build visp_sample with ViSP from install tree - if: matrix.build_type == 'visp-dir-install-tree' run: | mkdir visp_sample-build_2 && cd visp_sample-build_2 cmake .. -DCMAKE_BUILD_TYPE=Release -DVISP_DIR=$ViSP_WS/visp/build/install/lib/cmake/visp make -j2 - name: Build visp_sample using visp.pc from install tree - if: matrix.build_type == 'visp.pc-install-tree' run: | export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ViSP_WS/visp/build/install/lib/pkgconfig make -f Makefile.visp.pc make -f Makefile.visp.pc clean - name: Build visp_sample using visp-config from install tree - if: matrix.build_type == 'visp-config-install-tree' run: | export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$ViSP_WS/visp/build/install/lib/pkgconfig make -f Makefile.visp-config VISP_INSTALL_PREFIX=$ViSP_WS/visp/build/install From c767cbed881062af4397ea7ef475049a77a05d4b Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 29 Jun 2023 15:19:01 +0200 Subject: [PATCH 11/17] Update github action for macos --- .github/workflows/macos-dep-brew.yml | 6 +++--- .github/workflows/macos-dep-src.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/macos-dep-brew.yml b/.github/workflows/macos-dep-brew.yml index 508748c..86da5db 100644 --- a/.github/workflows/macos-dep-brew.yml +++ b/.github/workflows/macos-dep-brew.yml @@ -13,12 +13,12 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-10.15, macos-11.0] + os: [macos-11, macos-12.0] steps: # https://github.com/marketplace/actions/cancel-workflow-action - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.5.0 + uses: styfle/cancel-workflow-action@0.9.1 with: access_token: ${{ github.token }} @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | brew update && brew upgrade - brew install libpng libjpeg libdc1394 lapack openblas eigen librealsense libxml2 pcl visp + brew install visp brew deps --tree --installed - name: Configure CMake and build visp_sample diff --git a/.github/workflows/macos-dep-src.yml b/.github/workflows/macos-dep-src.yml index 435596a..70f860f 100644 --- a/.github/workflows/macos-dep-src.yml +++ b/.github/workflows/macos-dep-src.yml @@ -13,12 +13,12 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-10.15, macos-11.0] + os: [macos-11, macos-12.0] steps: # https://github.com/marketplace/actions/cancel-workflow-action - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.5.0 + uses: styfle/cancel-workflow-action@0.9.1 with: access_token: ${{ github.token }} @@ -34,7 +34,7 @@ jobs: - name: Install dependencies run: | brew update && brew upgrade - brew install libpng libjpeg libdc1394 lapack openblas eigen opencv librealsense libxml2 pcl + brew install libpng libjpeg libdc1394 lapack openblas eigen opencv librealsense libxml2 pcl nlohmann-json # Openblas location is exported explicitly because openblas is keg-only, # which means it was not symlinked into /usr/local/. From 5131eed45bd6434517a33b615ed4e818454ed263 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 29 Jun 2023 22:32:59 +0200 Subject: [PATCH 12/17] Fix typo --- .github/workflows/ubuntu-dep-src.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-dep-src.yml b/.github/workflows/ubuntu-dep-src.yml index a867ad0..6627a0c 100644 --- a/.github/workflows/ubuntu-dep-src.yml +++ b/.github/workflows/ubuntu-dep-src.yml @@ -43,7 +43,7 @@ jobs: cd ${HOME}/librealsense mkdir build && cd build && mkdir install cmake .. -DBUILD_EXAMPLES=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install - make -j2 install + make -j$(nproc) install echo "REALSENSE2_DIR=$(pwd)/install" >> $GITHUB_ENV echo $REALSENSE2_DIR @@ -62,4 +62,4 @@ jobs: run: | mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release - make -j($nproc) + make -j$(nproc) From ae9f4cb5d2a5706e3394ed79189c6aca51666980 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Thu, 29 Jun 2023 22:38:01 +0200 Subject: [PATCH 13/17] Remove brew update that doesn't seem to work --- .github/workflows/macos-dep-brew.yml | 1 - .github/workflows/macos-dep-src.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/.github/workflows/macos-dep-brew.yml b/.github/workflows/macos-dep-brew.yml index 86da5db..d3de060 100644 --- a/.github/workflows/macos-dep-brew.yml +++ b/.github/workflows/macos-dep-brew.yml @@ -33,7 +33,6 @@ jobs: - name: Install dependencies run: | - brew update && brew upgrade brew install visp brew deps --tree --installed diff --git a/.github/workflows/macos-dep-src.yml b/.github/workflows/macos-dep-src.yml index 70f860f..d7337fd 100644 --- a/.github/workflows/macos-dep-src.yml +++ b/.github/workflows/macos-dep-src.yml @@ -33,7 +33,6 @@ jobs: - name: Install dependencies run: | - brew update && brew upgrade brew install libpng libjpeg libdc1394 lapack openblas eigen opencv librealsense libxml2 pcl nlohmann-json # Openblas location is exported explicitly because openblas is keg-only, From 806fc2322ff3c330f62bc43a196a5ff5e26ed3ad Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 30 Jun 2023 10:06:09 +0200 Subject: [PATCH 14/17] Remove workflow using brew install visp that brings visp-3.5.0 This release has some issues in propagating 3rd parties deps like OpenCV, PCL... --- .github/workflows/macos-dep-brew.yml | 43 ---------------------------- 1 file changed, 43 deletions(-) delete mode 100644 .github/workflows/macos-dep-brew.yml diff --git a/.github/workflows/macos-dep-brew.yml b/.github/workflows/macos-dep-brew.yml deleted file mode 100644 index d3de060..0000000 --- a/.github/workflows/macos-dep-brew.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: MacOS-dep-brew - -# https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events -on: - push: - pull_request: - schedule: - - cron: '0 2 * * SUN' - -jobs: - build-macos-dep-brew: - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [macos-11, macos-12.0] - - steps: - # https://github.com/marketplace/actions/cancel-workflow-action - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Print system information - run: sysctl -a | grep machdep.cpu - - - name: Print OS information - run: system_profiler SPSoftwareDataType - - - name: Install dependencies - run: | - brew install visp - brew deps --tree --installed - - - name: Configure CMake and build visp_sample - run: | - mkdir build && cd build - cmake .. -DCMAKE_BUILD_TYPE=Release - make -j$(sysctl -n hw.logicalcpu) From e3f011c4cfa5cfab6d67ce202a47b42492402399 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 30 Jun 2023 10:08:55 +0200 Subject: [PATCH 15/17] Worflow uses last 2 ubuntu releases (20.04 and 22.04) --- .github/workflows/ubuntu-dep-src.yml | 2 +- .github/workflows/ubuntu-extra.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu-dep-src.yml b/.github/workflows/ubuntu-dep-src.yml index 6627a0c..b54716f 100644 --- a/.github/workflows/ubuntu-dep-src.yml +++ b/.github/workflows/ubuntu-dep-src.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04] + os: [ubuntu-20.04, ubuntu-22.04] steps: # https://github.com/marketplace/actions/cancel-workflow-action diff --git a/.github/workflows/ubuntu-extra.yml b/.github/workflows/ubuntu-extra.yml index 571925f..50fd1ae 100644 --- a/.github/workflows/ubuntu-extra.yml +++ b/.github/workflows/ubuntu-extra.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04] + os: [ubuntu-20.04, ubuntu-22.04] steps: # https://github.com/marketplace/actions/cancel-workflow-action From f4e5ddc8565c7f9d993b8db4501f27a6d0f9c071 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 30 Jun 2023 10:19:48 +0200 Subject: [PATCH 16/17] Help detecting VTK by setting Qt5_DIR --- .github/workflows/macos-dep-src.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/macos-dep-src.yml b/.github/workflows/macos-dep-src.yml index d7337fd..bf234f8 100644 --- a/.github/workflows/macos-dep-src.yml +++ b/.github/workflows/macos-dep-src.yml @@ -1,4 +1,4 @@ -name: MacOS-dep-sec +name: MacOS-dep-src # https://www.jeffgeerling.com/blog/2020/running-github-actions-workflow-on-schedule-and-other-events on: @@ -26,25 +26,29 @@ jobs: uses: actions/checkout@v2 - name: Print system information - run: sysctl -a | grep machdep.cpu + run: | + sysctl -a | grep machdep.cpu + sysctl -a | grep logical - name: Print OS information run: system_profiler SPSoftwareDataType - name: Install dependencies - run: | - brew install libpng libjpeg libdc1394 lapack openblas eigen opencv librealsense libxml2 pcl nlohmann-json + run: brew install libpng libjpeg libdc1394 opencv pcl librealsense zbar pkg-config nlohmann-json # Openblas location is exported explicitly because openblas is keg-only, # which means it was not symlinked into /usr/local/. + # qt@5 is as a requested dependency for vtk and thus for pcl 1.13.0 + # qt@5 is keg-only, which means it was not symlinked into /usr/local that's why we need to set Qt5_DIR - name: Clone and configure ViSP run: | git clone --depth 1 https://github.com/lagadic/visp.git ${HOME}/visp cd ${HOME}/visp export LDFLAGS="-L/usr/local/opt/openblas/lib" export CPPFLAGS="-I/usr/local/opt/openblas/include" + export Qt5_DIR="$(brew --prefix qt5)/lib/cmake/Qt5" mkdir build && cd build - cmake .. -DCMAKE_FIND_FRAMEWORK=LAST -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$(pwd)/install + cmake .. -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5 -DBUILD_DEMOS=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTS=OFF -DBUILD_TUTORIALS=OFF -DCMAKE_INSTALL_PREFIX=$(pwd)/install cat ViSP-third-party.txt - name: Build and install ViSP From 6f60bbcc417a0f6f75752a24ee677fd194e23a99 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 30 Jun 2023 13:47:38 +0200 Subject: [PATCH 17/17] Fix libdc1394-dev package installation --- .github/workflows/ubuntu-dep-src.yml | 15 ++++++++++++--- .github/workflows/ubuntu-extra.yml | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ubuntu-dep-src.yml b/.github/workflows/ubuntu-dep-src.yml index b54716f..8d3352a 100644 --- a/.github/workflows/ubuntu-dep-src.yml +++ b/.github/workflows/ubuntu-dep-src.yml @@ -31,10 +31,19 @@ jobs: - name: Print OS information run: lsb_release -a - - name: Install dependencies + - name: Install dependencies for ubuntu 18.04 and 20.04 + if: matrix.os != 'ubuntu-22.04' run: | - sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev gfortran liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev libxml2-dev libpcl-dev - sudo apt-get update && sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev + sudo apt-get update + sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev libxml2-dev libpcl-dev nlohmann-json3-dev + sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev + + - name: Install dependencies for ubuntu 22.04 + if: matrix.os == 'ubuntu-22.04' + run: | + sudo apt-get update + sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev libxml2-dev libpcl-dev nlohmann-json3-dev + sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev - name: Build librealsense2 from source run: | diff --git a/.github/workflows/ubuntu-extra.yml b/.github/workflows/ubuntu-extra.yml index 50fd1ae..c51587f 100644 --- a/.github/workflows/ubuntu-extra.yml +++ b/.github/workflows/ubuntu-extra.yml @@ -31,10 +31,19 @@ jobs: - name: Print OS information run: lsb_release -a - - name: Install dependencies + - name: Install dependencies for ubuntu 18.04 and 20.04 + if: matrix.os != 'ubuntu-22.04' run: | - sudo apt-get update && sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev gfortran liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev libxml2-dev libpcl-dev - sudo apt-get update && sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev + sudo apt-get update + sudo apt-get install -y libx11-dev libdc1394-22-dev libv4l-dev gfortran liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev libxml2-dev libpcl-dev nlohmann-json3-dev + sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev + + - name: Install dependencies for ubuntu 22.04 + if: matrix.os == 'ubuntu-22.04' + run: | + sudo apt-get update + sudo apt-get install -y libx11-dev libdc1394-dev libv4l-dev gfortran liblapack-dev libopenblas-dev libeigen3-dev libopencv-dev libxml2-dev libpcl-dev nlohmann-json3-dev + sudo apt-get install -y libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev libgl1-mesa-dev libglu1-mesa-dev - name: Build librealsense2 from source run: |