From 75fcb5fef4486007e518ee420d481f0b76ee2b51 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 3 Nov 2020 12:31:47 +0100 Subject: [PATCH 1/2] GitHub Actions: Enable IPOPT tests on macOS --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1465f4fce9f..fd1ee2de430 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,7 +65,7 @@ jobs: - name: Dependencies [macOS] if: matrix.os == 'macOS-latest' run: | - brew install ace assimp boost eigen swig qt5 orocos-kdl + brew install ace assimp boost eigen ipopt swig qt5 orocos-kdl - name: Dependencies [Ubuntu] if: contains(matrix.os, 'ubuntu') @@ -171,7 +171,7 @@ jobs: cd build cmake -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/install/deps -DIDYNTREE_COMPILE_TESTS:BOOL=ON -DIDYNTREE_USES_YARP:BOOL=ON \ -DIDYNTREE_USES_ICUB_MAIN:BOOL=ON -DIDYNTREE_USES_Qt5:BOOL=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DIDYNTREE_USES_ASSIMP:BOOL=ON \ - -DIDYNTREE_USES_OCTAVE:BOOL=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. + -DIDYNTREE_USES_IPOPT:BOOL=ON -DIDYNTREE_USES_OCTAVE:BOOL=ON -DCMAKE_INSTALL_PREFIX=${GITHUB_WORKSPACE}/install .. - name: Enable additional Ubuntu options (Valgrind, Python, legacy KDL) [Ubuntu] if: contains(matrix.os, 'ubuntu') From 84275261acdb8eef1d2c3bdf746fde10c0983a0a Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Tue, 17 Nov 2020 10:29:53 +0100 Subject: [PATCH 2/2] IpoptInterfaceTest: increase test tolerance --- src/optimalcontrol/tests/IpoptInterfaceTest.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/optimalcontrol/tests/IpoptInterfaceTest.cpp b/src/optimalcontrol/tests/IpoptInterfaceTest.cpp index e34b02926fa..37e1515897a 100644 --- a/src/optimalcontrol/tests/IpoptInterfaceTest.cpp +++ b/src/optimalcontrol/tests/IpoptInterfaceTest.cpp @@ -210,14 +210,15 @@ int main(){ ASSERT_IS_TRUE(problem->setMinusInfinity(ipoptSolver.minusInfinity())); ASSERT_IS_TRUE(problem->setPlusInfinity(ipoptSolver.plusInfinity())); ASSERT_IS_TRUE(ipoptSolver.setProblem(problem)); + double testTolerance = 5e-5; for (int i = 0; i < 5; ++i){ ASSERT_IS_TRUE(ipoptSolver.solve()); double optimalCost; ASSERT_IS_TRUE(ipoptSolver.getOptimalCost(optimalCost)); - ASSERT_EQUAL_DOUBLE_TOL(optimalCost, problem->expectedMinimum(), 1e-5); + ASSERT_EQUAL_DOUBLE_TOL(optimalCost, problem->expectedMinimum(), testTolerance); iDynTree::VectorDynSize solution; ASSERT_IS_TRUE(ipoptSolver.getPrimalVariables(solution)); - ASSERT_EQUAL_VECTOR_TOL(solution, problem->expectedVariables(), 1e-5); + ASSERT_EQUAL_VECTOR_TOL(solution, problem->expectedVariables(), testTolerance); ASSERT_IS_TRUE(ipoptSolver.getDualVariables(dummy1, dummy2, dummy3)); } return EXIT_SUCCESS;