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
Adds osqp and qpOASES solver interfaces #40
Adds osqp and qpOASES solver interfaces #40
Conversation
Notice that while this change seems trivial, it actually causes tests to pass. Since bpmpd interface is quite brittle, it was the case that using it as a third option in tests caused some of them to fail. This means the order of execution of tests has an influence on the solver, which is a bad sign.
@arocchi This is awesome and thank you for the contribution. I am on vacation next week and will try to get it reviewed this weekend. |
Also I submitted PR #42 that should fix the eigen aligned issues. For some reason I thought this was no longer need. It is possible that I did not catch all the places where it is need. I am unable to recreate the issue @mpowelson was having with the examples. |
I gave it a brief glance. I always hate asking because it seems nitpicky, but I plan to eventually migrate the style to using the ros cpp sytle guide so with new addition I would like to follow the ros style guide if that is not to painful. To help with formatting the repository has s a clang file. Also I notice the use of raw pointers a few places would it be good to replace them with shared pointers? |
perfect, I'm on it! |
Notice this should be reviewed after bpmpd is removed and all memory alignment problems are resolved. In fact, right now the solver is occasionally instantiated twice in each solve cycle: this makes test pass.
refactored to take into account clang & roscpp guidelines. Doxygen is still lacking, but after we fix memory alignment issues and the solvers are refactored, cleanup + doxygen will follow |
Thanks @Levi-Armstrong - I will check it later today and get back to you. |
…e, qpoases_interface
Tried code on new tesseract and trajopt, and find the issue (on my side that was causing the problem) |
@Levi-Armstrong @bhaskara @mpowelson please review. This refactors the new solvers using a shared set of |
@arocchi Do you mind re-basing on the latest and I will review it tomorrow? |
will do! |
@Levi-Armstrong I merged instead of rebasing, hope this is ok. Let me know otherwise! It is good to review. I added a new functionality to specify a solver in JSONs / |
There still appears to be conflicts. |
As new branches are merged, conflicts appear. In particular, the last one was over new-lines. Fixed now. |
I am also looking into if we should use Factory style approach for the solvers. |
Overall looks great just a few minor things. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of high level comments, which feel free to ignore as I'm not very familiar with this codebase.
@@ -148,5 +149,53 @@ std::ostream& operator<<(std::ostream&, const Cnt&); | |||
std::ostream& operator<<(std::ostream&, const AffExpr&); | |||
std::ostream& operator<<(std::ostream&, const QuadExpr&); | |||
|
|||
ModelPtr createModel(); | |||
class ConvexSolver |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we actually need a whole class for this given that it seems to just wrap an enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a solution I came up to have a place to easily manage conversions from string and to string, for logging and loading of the enum from json (strings are more readable than ints!).
I am open for suggestions in case we can make it more elegant!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I plan to look at something similar to what is shown here but this can be done in a separate PR.
@Levi-Armstrong bump |
@arocchi Then only think left is the discussion around naming of enum to ModelType. |
@Levi-Armstrong I renamed |
@arocchi It is saying there are conflicts with the base branch. Do yo mind rebasing and then I will merge? |
@Levi-Armstrong latest commit from |
@arocchi It will not let me merge it. It says |
Adds osqp and qpOASES in the list of available solvers.
Automatically runs all tests that use a convex solver with all the list of solvers detected as available on the machine.
Disabled test calling solver with a non positive semi-definite matrix.
Please notice this needs a good refactor to simplify code in common between osqp and qpOASES solver, but at the moment there are issues with memory alignment that can cause weird errors whenever a serious refactor is attempted. All Eigen instances possibly causing alignment issues in the tesseract/trajopt stack should be reviewed.
Please review @Levi-Armstrong.