diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6df86ac36f6..c23771735e8 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') 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;