ApolloAuto / apollo

An open autonomous driving platform
Apache License 2.0
25.24k stars 9.72k forks source link

About LQR solver in control #292

Closed TakaHoribe closed 6 years ago

TakaHoribe commented 7 years ago

In my case, the iteration algorithm of the "SolveLQRProblem" method does not seem to converge with a small iterative number. Then I'm wondering why the iterative algorithm is used. Potter’s method might be better for solving the LQR problem, or is there any advantages of the iterative method?

Capri2014 commented 7 years ago

Just want to verify that Potter's method you mean the Hamiltonian building then Eigen decomposition method right?

To be honest, the reason why we were choosing iterative methods are quite simple:

  1. It can directly deal with Discrete Algebraic Riccati Equation, which means by combining the usage of continuous to discrete controller + iterative LQR solver, if user want to change the control frequency, all matrix components can be solved properly without any changes.
  2. It is more flexible, user can self adjust the iterative number or convergence tolerance according to different hardware platform. (i. e. computational resources).
  3. More intuitive, since iterative method is naive application of discrete Riccati Equation.

With that been said, we should consider upgrade and provide an alternative way of solving discrete LQR, you are more than welcome to contribute :)

TakaHoribe commented 7 years ago

To Capri2014,

Thank you for your polite and quick response.

First, yes i mean the Potter's method is the eigen decompiosition method you just mentioned.

I understand what you say and the reason why the iterative algorithm is used. Actually, it is more understandable way and does not need any special resources. However, the eigen decomposition method would have great advantages and be useful especially for the realtime solver, such as this Apollo's control. Making an option for the solver might be better, i think.

I hope I can contribute someday!

Capri2014 commented 7 years ago

https://github.com/ApolloAuto/apollo/blob/master/CONTRIBUTING.md

Capri2014 commented 7 years ago

@TakaHoribe Let me know if you are interested in this task

Capri2014 commented 6 years ago

Close since no follow up.