From 9c09fc677cd322d8c479319ee627f128ae224547 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 17 Jan 2025 18:40:51 -0500 Subject: [PATCH 1/9] Fix trajopt_ifopt on Windows --- .github/workflows/windows_dependencies.repos | 4 ++-- .../src/profile/trajopt_ifopt_osqp_solver_profile.cpp | 7 +++++++ .../trajopt_ifopt/src/trajopt_ifopt_utils.cpp | 7 +++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows_dependencies.repos b/.github/workflows/windows_dependencies.repos index ab713de1ccd..9a4e2c41817 100644 --- a/.github/workflows/windows_dependencies.repos +++ b/.github/workflows/windows_dependencies.repos @@ -20,8 +20,8 @@ version: 0.5.2 - git: local-name: ifopt - uri: https://github.com/ethz-adrl/ifopt.git - version: 2.1.3 + uri: https://github.com/johnwason/ifopt.git + version: win_pkgconfig - git: local-name: ruckig uri: https://github.com/pantor/ruckig.git diff --git a/tesseract_motion_planners/trajopt_ifopt/src/profile/trajopt_ifopt_osqp_solver_profile.cpp b/tesseract_motion_planners/trajopt_ifopt/src/profile/trajopt_ifopt_osqp_solver_profile.cpp index 40688efb1cb..df62c99fbc0 100644 --- a/tesseract_motion_planners/trajopt_ifopt/src/profile/trajopt_ifopt_osqp_solver_profile.cpp +++ b/tesseract_motion_planners/trajopt_ifopt/src/profile/trajopt_ifopt_osqp_solver_profile.cpp @@ -24,6 +24,13 @@ * limitations under the License. */ +#ifdef _WIN32 +// Macros to avoid Windows.h conflicts +#define NOGDI +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN +#endif + #include TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include diff --git a/tesseract_motion_planners/trajopt_ifopt/src/trajopt_ifopt_utils.cpp b/tesseract_motion_planners/trajopt_ifopt/src/trajopt_ifopt_utils.cpp index ecc86947a5e..b489c022a7b 100644 --- a/tesseract_motion_planners/trajopt_ifopt/src/trajopt_ifopt_utils.cpp +++ b/tesseract_motion_planners/trajopt_ifopt/src/trajopt_ifopt_utils.cpp @@ -24,6 +24,13 @@ * limitations under the License. */ +#ifdef _WIN32 +// Macros to avoid Windows.h conflicts +#define NOGDI +#define NOMINMAX +#define WIN32_LEAN_AND_MEAN +#endif + #include TESSERACT_COMMON_IGNORE_WARNINGS_PUSH #include From 63d148db4bfab28443d4768d82e46abbeb2671cf Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 17 Jan 2025 18:43:24 -0500 Subject: [PATCH 2/9] ci From 21d4636ac7576c64bc13db96c5b2b262554e90ad Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 17 Jan 2025 19:53:47 -0500 Subject: [PATCH 3/9] Build IPOPT on mac and windows --- .github/workflows/mac.yml | 2 +- .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 5290260b641..66c6fcfa577 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -84,7 +84,7 @@ jobs: --event-handlers console_cohesion+ \ --cmake-force-configure \ --cmake-args -GNinja -DCMAKE_BUILD_TYPE=Release \ - -DINSTALL_OMPL=OFF -DINSTALL_OMPL_TAG=master -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF \ + -DINSTALL_OMPL=OFF -DINSTALL_OMPL_TAG=master -DBUILD_IPOPT=ON -DBUILD_SNOPT=OFF \ -DBUILD_SHARED_LIBS=ON -DTESSERACT_ENABLE_EXAMPLES=OFF -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF \ -DVCPKG_APPLOCAL_DEPS=OFF -DTESSERACT_ENABLE_TESTING=ON \ -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \ diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index abcd268e231..e5382c5af6b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -57,7 +57,7 @@ jobs: with: ccache-prefix: ${{ matrix.distro }} vcs-file: .github/workflows/windows_dependencies.repos - upstream-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DBUILD_IPOPT=OFF -DBUILD_SNOPT=OFF -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF -DVCPKG_APPLOCAL_DEPS=OFF + upstream-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DBUILD_IPOPT=ON -DBUILD_SNOPT=OFF -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF -DVCPKG_APPLOCAL_DEPS=OFF target-path: target_ws/src target-args: --event-handlers console_cohesion+ --packages-ignore tesseract_examples --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DTESSERACT_ENABLE_TESTING=ON -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF -DVCPKG_APPLOCAL_DEPS=OFF run-tests-args: --packages-ignore tesseract_examples From 91ff9a2de8c1cffab25d120edf1be204f9d2aaaa Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 17 Jan 2025 20:19:01 -0500 Subject: [PATCH 4/9] Install pkgconfig --- .github/workflows/mac.yml | 7 +++++-- .github/workflows/windows.yml | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 66c6fcfa577..1568afee1dc 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -69,6 +69,9 @@ jobs: - name: pip3 run: | python3 -m pip install numpy setuptools wheel pytest delvewheel colcon-common-extensions vcstool + - name: brew + run: | + brew install pkgconf - name: vcs import working-directory: ws/src run: vcs import --input tesseract_planning/.github/workflows/windows_dependencies.repos @@ -80,12 +83,12 @@ jobs: export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }} colcon build --merge-install \ - --packages-ignore tesseract_examples trajopt_ifopt trajopt_sqp ifopt vhacd tesseract_python \ + --packages-ignore tesseract_examples vhacd tesseract_python \ --event-handlers console_cohesion+ \ --cmake-force-configure \ --cmake-args -GNinja -DCMAKE_BUILD_TYPE=Release \ -DINSTALL_OMPL=OFF -DINSTALL_OMPL_TAG=master -DBUILD_IPOPT=ON -DBUILD_SNOPT=OFF \ - -DBUILD_SHARED_LIBS=ON -DTESSERACT_ENABLE_EXAMPLES=OFF -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF \ + -DBUILD_SHARED_LIBS=ON -DTESSERACT_ENABLE_EXAMPLES=OFF -DTESSERACT_BUILD_TRAJOPT_IFOPT=ON \ -DVCPKG_APPLOCAL_DEPS=OFF -DTESSERACT_ENABLE_TESTING=ON \ -DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \ -DOpenMP_CXX_INCLUDE_DIR=${{ matrix.config.homebrew_root }}/opt/libomp/include \ diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index e5382c5af6b..c93dfc06136 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -41,6 +41,10 @@ jobs: cache-key: ci-${{ matrix.os }} github-binarycache: true + - name: choco + run: | + choco install pkgconfiglite -r + - name: configure-msvc uses: ilammy/msvc-dev-cmd@v1 with: @@ -59,5 +63,5 @@ jobs: vcs-file: .github/workflows/windows_dependencies.repos upstream-args: --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DBUILD_IPOPT=ON -DBUILD_SNOPT=OFF -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF -DVCPKG_APPLOCAL_DEPS=OFF target-path: target_ws/src - target-args: --event-handlers console_cohesion+ --packages-ignore tesseract_examples --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DTESSERACT_ENABLE_TESTING=ON -DTESSERACT_BUILD_TRAJOPT_IFOPT=OFF -DVCPKG_APPLOCAL_DEPS=OFF + target-args: --event-handlers console_cohesion+ --packages-ignore tesseract_examples --cmake-args -G "Ninja" -DVCPKG_TARGET_TRIPLET=x64-windows-release -DCMAKE_BUILD_TYPE=Release -DTESSERACT_ENABLE_TESTING=ON -DTESSERACT_BUILD_TRAJOPT_IFOPT=ON -DVCPKG_APPLOCAL_DEPS=OFF run-tests-args: --packages-ignore tesseract_examples From 8726710e24e4c8fbde5dc306fb961c1511863edb Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 17 Jan 2025 20:24:24 -0500 Subject: [PATCH 5/9] Set PKG_CONFIG_PATH --- .github/workflows/mac.yml | 1 + .github/workflows/windows.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 1568afee1dc..b19608db0ab 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -81,6 +81,7 @@ jobs: set -e export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }}/lib export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }} + export PKG_CONFIG_PATH=$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }}/lib/pkgconfig colcon build --merge-install \ --packages-ignore tesseract_examples vhacd tesseract_python \ diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index c93dfc06136..11dfdcc947c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -55,6 +55,7 @@ jobs: run: | echo "PATH=${{ env.PATH }};$GITHUB_WORKSPACE\vcpkg\installed\x64-windows-release\bin" >> "$GITHUB_ENV" echo "CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE\vcpkg\installed\x64-windows-release" >> "$GITHUB_ENV" + echo "PKG_CONFIG_PATH=$GITHUB_WORKSPACE\vcpkg\installed\x64-windows-release\lib\pkgconfig" >> "$GITHUB_ENV" - name: Build and Tests uses: tesseract-robotics/colcon-action@v8 From 852977cfc1e8a00e1dbb75885fac480571d2d97e Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 17 Jan 2025 20:27:28 -0500 Subject: [PATCH 6/9] vcpkg coin-or-ipopt --- .github/workflows/mac.yml | 2 +- .github/workflows/windows.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index b19608db0ab..e1df07634be 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -24,7 +24,7 @@ env: urdfdom octomap orocos-kdl pcl gtest benchmark flann jsoncpp yaml-cpp eigen3 - openblas + openblas coin-or-ipopt fcl ompl taskflow bullet3[multithreading,double-precision,rtti] ccd[double-precision] gperftools diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 11dfdcc947c..0ebdd15b1bb 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -34,7 +34,7 @@ jobs: console-bridge eigen3 yaml-cpp benchmark tinyxml2 assimp orocos-kdl pcl lapack-reference boost-dll boost-filesystem boost-serialization boost-format boost-stacktrace boost-program-options boost-graph urdfdom ccd[double-precision] gtest - ompl taskflow jsoncpp flann benchmark + ompl taskflow jsoncpp flann benchmark coin-or-ipopt triplet: x64-windows-release extra-args: --clean-after-build token: ${{ github.token }} From e3d8315804cded205f8e2d823da5074e2692b068 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 17 Jan 2025 21:22:45 -0500 Subject: [PATCH 7/9] Fix trajopt_ifopt macos build error --- .../trajopt_ifopt/src/trajopt_ifopt_motion_planner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tesseract_motion_planners/trajopt_ifopt/src/trajopt_ifopt_motion_planner.cpp b/tesseract_motion_planners/trajopt_ifopt/src/trajopt_ifopt_motion_planner.cpp index c1d17e244df..cddfe2802ef 100644 --- a/tesseract_motion_planners/trajopt_ifopt/src/trajopt_ifopt_motion_planner.cpp +++ b/tesseract_motion_planners/trajopt_ifopt/src/trajopt_ifopt_motion_planner.cpp @@ -97,7 +97,7 @@ PlannerResponse TrajOptIfoptMotionPlanner::solve(const PlannerRequest& request) // ---------------- // Transform plan instructions into trajopt cost and constraints std::vector> vars; - for (int i = 0; i < move_instructions.size(); ++i) + for (int i = 0; i < static_cast(move_instructions.size()); ++i) { const auto& move_instruction = move_instructions[static_cast(i)].get().as(); From 27bd03543d6253fa43faa0613b06e965e073bef0 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 17 Jan 2025 21:53:07 -0500 Subject: [PATCH 8/9] set TESSERACT_RESOURCE_PATH on macos --- .github/workflows/mac.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index e1df07634be..1d832ba525d 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -104,6 +104,7 @@ jobs: set -e export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }}/lib export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/vcpkg/installed/${{ matrix.config.vcpkg_triplet }} + export TESSERACT_RESOURCE_PATH=$GITHUB_WORKSPACE/ws/install/share colcon test --merge-install \ --packages-ignore tesseract_examples trajopt_ifopt trajopt_sqp ifopt vhacd tesseract_python \ From 631f15c8e87c21451bcded5dc4ea164cbc9be011 Mon Sep 17 00:00:00 2001 From: John Wason Date: Fri, 17 Jan 2025 21:54:17 -0500 Subject: [PATCH 9/9] Remove duplicate brew --- .github/workflows/mac.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml index 1d832ba525d..f0ae5477b76 100644 --- a/.github/workflows/mac.yml +++ b/.github/workflows/mac.yml @@ -54,7 +54,7 @@ jobs: python-version: '3.12' - name: brew run: | - brew install libomp cmake automake autoconf libtool gcc ninja + brew install libomp cmake automake autoconf libtool gcc ninja pkgconf - name: vcpkg build uses: johnwason/vcpkg-action@v6 with: @@ -69,9 +69,6 @@ jobs: - name: pip3 run: | python3 -m pip install numpy setuptools wheel pytest delvewheel colcon-common-extensions vcstool - - name: brew - run: | - brew install pkgconf - name: vcs import working-directory: ws/src run: vcs import --input tesseract_planning/.github/workflows/windows_dependencies.repos