Comments (4)
There are two standard ways to solve NLPs locally, nonlinear interior point methods (NIP) and sequential quadratic programming (SQP). Both methods do linearize the optimization problem at some point, NIP methods linearize the KKT system at every step, whereas SQP methods approximate the NLP as a QP at every outer (SQP) iteration.
In the AMZ paper we use FORCES PRO which is a fast NIP method (basically IPOPT tailored for MPC), and here I use a simple SQP method.
What I did in "Optimization‐based autonomous racing of 1:43 scale RC cars" is often called real time iteration (RTI), where you do SQP but you only solve one QP instead of solving the sequence of QPs until convergence.
The advantage of RTI is that it is really quick, so in this repo (actually both matlab and C++) I use a SQP method with 2 or 3 iterations, which gives better results than RTI, but is still about twice as fast as FORCES PRO.
Best,
Alex
from mpcc.
Sorry for not replaying, I am happy that you found the solution yourself
I assume some of the issue come up due to how I formulated the cost here.
You can also think about it as j(x,u) = q_l e_lag(x)^2 + q_c e_cont(x) - q_theta theta + cost(u) + cost(Delta u)
Best,
Alex
from mpcc.
Hi, @alexliniger, could you elaborate on how you applied SQP?
I also think about applying MPC with parameterized reference (theta) in my project.
My question comes from the gradients of the objective function.
I refer to followings to understand SQP
- Sequential quadratic programming - optimization
- From linear to nonlinear MPC: bridging the gap via the real-time iteration
First, your formulation of Nonlinear MPC problem is following without regularization.
M & P are constant matrices to express constraints.
And with applying the idea of 3.1 of [2]
3.1 of [2] applies the newton method calculating delta x and delta u, but at your case directly calculating x because of x = x^{guess} + \delta x. and here normalization of the problem makes the newton method easier.
And constraints come back to the simple original form
Because f() is not a simple form, the approximation of Hessian to
'Q' cannot work (I am not sure) also other parts becomes a bit complex form, but your C++ code and Matlab code handles much simpler objective function as taking care of theta^{ref} as constants.
This part made me confused. I'm sorry if this is just my basic calculus problem.
[Edit]
I figured out the Hessian and the gradient. Now I'm trying to understand the part of \Delta x -> x in the objective function.
from mpcc.
Thanks for your reply! I'll take a look at the code.
from mpcc.
Related Issues (20)
- New waypoints as input HOT 8
- where is the latency between the vehicle and the code considered or can be considered? HOT 1
- Repo for work with GP HOT 2
- Steering constraint to avoid crash HOT 4
- About the InitialGuess function HOT 1
- About the State Parameters HOT 1
- Passing in state of 0s into solveMPC() HOT 1
- How to add new soft constraints for velocity HOT 4
- some questions about tractive force at the rear force HOT 6
- C++ build error HOT 3
- cost function HOT 1
- Using Hpipm in Matlab HOT 1
- getContouringCost() detailed description HOT 7
- New Features
- Build instructions for new CppAD-codegen HOT 5
- Possible indexation problem HOT 2
- Question about Track HOT 5
- How can I run the code in MATLAB HOT 5
- What is ZHO? HOT 1
- Is there a guideline to easily and reliably configure the various weights of the evaluation function?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mpcc.