diff --git a/docs/pages/mpc.md b/docs/pages/mpc.md index 42a69df..5903aed 100644 --- a/docs/pages/mpc.md +++ b/docs/pages/mpc.md @@ -142,7 +142,7 @@ if(!solver.initSolver()) return 1; The optimization problem can be solved calling the following method \code{.cpp} -if(!solver.solve()) return 1; +if(solver.solveProblem() != OsqpEigen::ErrorExitFlag::NoError) return 1; \endcode and the solution can be easily got by calling the following method \code{.cpp} @@ -161,4 +161,4 @@ Eigen::VectorXd QPSolution = solver.getSolution(); \include MPCExample.cpp The example presented generates the following results - \image html mpc_result.png \ No newline at end of file + \image html mpc_result.png diff --git a/example/src/MPCExample.cpp b/example/src/MPCExample.cpp index e44c5d6..e85799a 100644 --- a/example/src/MPCExample.cpp +++ b/example/src/MPCExample.cpp @@ -276,7 +276,7 @@ int main() for (int i = 0; i < numberOfSteps; i++){ // solve the QP problem - if(!solver.solve()) return 1; + if(solver.solveProblem() != OsqpEigen::ErrorExitFlag::NoError) return 1; // get the controller input QPSolution = solver.getSolution(); diff --git a/package.xml b/package.xml index 9fb8712..d02cb4e 100644 --- a/package.xml +++ b/package.xml @@ -1,8 +1,8 @@ osqp-eigen - 0.6.4 - Simple Eigen-C++ wrapper for OSQP library + 0.7.0 + Simple Eigen-C++ wrapper for OSQP library tbd BSD diff --git a/tests/MPCTest.cpp b/tests/MPCTest.cpp index a455d65..93db3eb 100644 --- a/tests/MPCTest.cpp +++ b/tests/MPCTest.cpp @@ -297,7 +297,7 @@ TEST_CASE("MPCTest") startTime = clock(); // solve the QP problem - REQUIRE(solver.solve()); + REQUIRE(solver.solveProblem() == OsqpEigen::ErrorExitFlag::NoError); // get the controller input QPSolution = solver.getSolution(); diff --git a/tests/MPCUpdateMatricesTest.cpp b/tests/MPCUpdateMatricesTest.cpp index b840b72..f36e4a9 100644 --- a/tests/MPCUpdateMatricesTest.cpp +++ b/tests/MPCUpdateMatricesTest.cpp @@ -273,7 +273,7 @@ TEST_CASE("MPCTest Update matrices") REQUIRE(solver.updateBounds(lowerBound, upperBound)); // solve the QP problem - REQUIRE(solver.solve()); + REQUIRE(solver.solveProblem() == OsqpEigen::ErrorExitFlag::NoError); // get the controller input QPSolution = solver.getSolution(); diff --git a/tests/QPTest.cpp b/tests/QPTest.cpp index 8268e2d..8183b8d 100644 --- a/tests/QPTest.cpp +++ b/tests/QPTest.cpp @@ -34,7 +34,7 @@ TEST_CASE("QPProblem - Unconstrained") REQUIRE(solver.data()->setGradient(gradient)); REQUIRE(solver.initSolver()); - REQUIRE(solver.solve()); + REQUIRE(solver.solveProblem() == OsqpEigen::ErrorExitFlag::NoError); // expected solution Eigen::Vector2d expectedSolution; @@ -85,7 +85,7 @@ TEST_CASE("QPProblem") REQUIRE(solver.initSolver()); - REQUIRE(solver.solve()); + REQUIRE(solver.solveProblem() == OsqpEigen::ErrorExitFlag::NoError); Eigen::Vector2d expectedSolution; expectedSolution << 0.3, 0.7; diff --git a/tests/UpdateMatricesTest.cpp b/tests/UpdateMatricesTest.cpp index 9d5d03f..0afc130 100644 --- a/tests/UpdateMatricesTest.cpp +++ b/tests/UpdateMatricesTest.cpp @@ -59,7 +59,7 @@ TEST_CASE("QPProblem - FirstRun") REQUIRE(solver.data()->setUpperBound(upperBound)); REQUIRE(solver.initSolver()); - REQUIRE(solver.solve()); + REQUIRE(solver.solveProblem() == OsqpEigen::ErrorExitFlag::NoError); auto solution = solver.getSolution(); std::cout << COUT_GTEST_MGT << "Solution [" << solution(0) << " " @@ -80,7 +80,7 @@ TEST_CASE("QPProblem - SparsityConstant") REQUIRE(solver.updateHessianMatrix(H_s)); REQUIRE(solver.updateLinearConstraintsMatrix(A_s)); - REQUIRE(solver.solve()); + REQUIRE(solver.solveProblem() == OsqpEigen::ErrorExitFlag::NoError); auto solution = solver.getSolution(); std::cout << COUT_GTEST_MGT << "Solution [" << solution(0) << " " @@ -101,7 +101,7 @@ TEST_CASE("QPProblem - SparsityChange") REQUIRE(solver.updateHessianMatrix(H_s)); REQUIRE(solver.updateLinearConstraintsMatrix(A_s)); - REQUIRE(solver.solve()); + REQUIRE(solver.solveProblem() == OsqpEigen::ErrorExitFlag::NoError); auto solution = solver.getSolution(); std::cout << COUT_GTEST_MGT << "Solution [" << solution(0) << " "