-
Notifications
You must be signed in to change notification settings - Fork 129
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
differential_ik_optimization.ipynb depends on Snopt specifically for dubious reasons #140
Comments
For this particular exercise, replacing the SnoptSolver with just |
Were you building from source? The notebooks on colab use the binaries, which come with Snopt inside. |
@hjsuh94 -- is there a reason you used Snopt in that exercise? I would actually think it's the wrong solver to use (for a convex QP)? or at very least, it's strange to require it? |
There was a very specific reason for this, which was that the default solver (osqp) is not exact w.r.t. constraints (it violates the bounding box constraint with 1e-3), while Snopt is. More specifically osqp gives different results when you use I recommend using osqp if you're building from source - the autograder might complain here and there, but your solution will still be correct visually. |
Thanks @hjsuh94 . That makes sense. @hongkai-dai -- it seems like OSQP has settings that we haven't exposed in drake yet? https://osqp.org/docs/interfaces/solver_settings.html#solver-settings |
I wasn't building from source, just running the notebook as linked from exercise 3.9. I just tried now again and it failed in the import stage (differently from the reported issue):
|
@flederbaysian perhaps the runtime has expired? It might go back to normal if you do factory reset of the runtime. |
I think we can tighten the tolerance. I will send a PR to expose these parameters. BTW, currently we support a partial list of parameters, as in https://github.com/RobotLocomotion/drake/blob/4ffb523ab25206c47b4211679fe01dd787a47c31/solvers/osqp_solver.cc#L222-L233 |
Another option is to use IPOPT, which should also solve QP with high precision. BTW, I also added CLP into Drake. The upstream CLP solver supports QP. I haven't supported solving QP with CLP in Drake yet, but it should be straightforward. |
I filed a Drake PR RobotLocomotion/drake#14886 to expose all OSQP parameters. I added |
Awesome. Thanks @hongkai-dai ! I'll leave this open for now, since right now we only get infrequent updates to the drake binaries on colab. But the plan will be to switch back to OSQP after your change lands and the binary is ready. |
I tried changing the problem to use
but it would also require a note of the form
i think this is too brittle. It also fails the current grader tolerance even with this as a solution. I'll leave it with SnoptSolver for now. The real fix, of course, would be to not pass numerically non-convex costs! |
The following line in
exercises/pick/differential_ik_optimization.ipynb
(exercise 3.9) fails:The text was updated successfully, but these errors were encountered: