nicolapiccinelli / libmpc

libmpc++ is a C++ header-only library to solve linear and non-linear MPC
https://altairlab.gitlab.io/optcontrol/libmpc/
MIT License
126 stars 20 forks source link

Are there any plans to support other NLP solvers? #32

Closed sm3304love closed 4 months ago

sm3304love commented 4 months ago

@nicolapiccinelli

I am trying to implement motion planning where the mobile manipulator avoids obstacles based on nmpc. In general, if there are no obstacles, planning speed is good(approximately 0.03 sec). However, if an obstacle approaches the robot (corresponding to the obstacle avoidance constraint), a solution is found, but the duration is very slow (approximately 0.4 seconds) or no solution is found. I tried changing the SLSQP solver in NLOptimizer.hpp to another solver, but the other solver does not work well as shown in the image below.

When using the LD_VAR1 algorithm image

Additionally, because SLSQP is suitable for NLP problems with few variables, it is expected that performance will deteriorate when dealing with NLP problems with many variables or when inequality constraints increase. The Interior Point method is generally said to have better convergence speed and solution finding ability than the SLSQP method in complex problem. Do you have any plans to support Interior Point method or other solver??

nicolapiccinelli commented 4 months ago

SLSQP should scale quite well up to some thousands of constraints. You can also try to tune the convergence tolerances and ensure you are compiling the code with the optimisation flags enabled.

Anyhow, the support for another solver than NLOpt is not in view. But could be interesting to give the hooks for an external solver, so the user if they need can integrate another solver. But it should be carefully considered.