From 53b1a91f8f03e19c73993fd9f94d8fea6fce9e98 Mon Sep 17 00:00:00 2001 From: Giulio Romualdi Date: Mon, 10 Jan 2022 11:05:44 +0100 Subject: [PATCH 1/4] Avoid to use deprecated function in the tests --- tests/MPCTest.cpp | 2 +- tests/MPCUpdateMatricesTest.cpp | 2 +- tests/QPTest.cpp | 4 ++-- tests/UpdateMatricesTest.cpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) 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) << " " From 2b647957db5a9bcbeb768dccc443276d22fa7427 Mon Sep 17 00:00:00 2001 From: Giulio Romualdi Date: Mon, 10 Jan 2022 11:07:01 +0100 Subject: [PATCH 2/4] Avoid to use deprecated functions in the documentation --- docs/pages/mpc.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 From de6af32c584cd0f90b2961972528f737d198994b Mon Sep 17 00:00:00 2001 From: Giulio Romualdi Date: Mon, 10 Jan 2022 11:08:05 +0100 Subject: [PATCH 3/4] Avoid to use deprecated functions in the example --- example/src/MPCExample.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); From 06fcea28249013b8e38d1131ba6b93bff9b2a641 Mon Sep 17 00:00:00 2001 From: Giulio Romualdi Date: Mon, 10 Jan 2022 11:09:00 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=9A=80=20Release=200.7.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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