Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that the OSQP report as status output not the return value of solveProblem(), but the output of solveProblem() #244

Merged
merged 1 commit into from
Sep 24, 2024

Conversation

DavideBarbone
Copy link

As per title this PR contains the fix for the solver status of the Simulink OSQP block.

@traversaro traversaro changed the title fix solver status from Simulink OSQP block Ensure that the OSQP report as status output not the return value of solveProblem(), but the output of solveProblem() Sep 24, 2024
@traversaro
Copy link
Member

Technically speaking this is a change of behavior, but it actually permits to have a meaningful signal coming out of the status output, so I guess it is a fair change. I will nevertheless bump the minor version instead of the patch in the new wb-toolbox release to make that clear.

To provide more detail on the change: before this PR, the status output of the OSQP block returned the return value of solveProblem, see https://github.com/robotology/osqp-eigen/blob/v0.8.1/include/OsqpEigen/Solver.hpp#L123 . This method returned the OsqpEigen::ErrorExitFlag, that however returns OSPQ errors (see https://github.com/robotology/osqp-eigen/blob/b9ce7391350e0f1c71e49f7574a8785fb617b5e6/include/OsqpEigen/Constants.hpp#L43-L57), and not the solver exit status, that is instead contained in https://github.com/robotology/osqp-eigen/blob/b9ce7391350e0f1c71e49f7574a8785fb617b5e6/include/OsqpEigen/Constants.hpp#L23-L38 and returned by getStatus, see https://github.com/robotology/osqp-eigen/blob/b9ce7391350e0f1c71e49f7574a8785fb617b5e6/include/OsqpEigen/Solver.hpp#L173 . So this PR changes the logic to ensure that status return the output of getStatus.

fyi @mfussi66 @Gio-DS

@traversaro traversaro merged commit 5b464d2 into robotology:master Sep 24, 2024
2 checks passed
@traversaro
Copy link
Member

Probably I merged this a bit in a rush, anyhow @gabrielenava you may want to have a look to this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants