studywolf / control

A repository for control benchmarking code
GNU General Public License v3.0
193 stars 75 forks source link

iLQR question #3

Closed stepjam closed 7 years ago

stepjam commented 7 years ago

Hi,

Thanks for sharing the code.

I have a quick question about iLQR. You seem to be running the iLQR optimization function each time step, but my understanding was that in iLQR, we optimise at the start and then run the trajectory, and the optimize based on that trajectory? Surely if we step by one step and then run the optimisation again, we are doing a MPC based approach? Though I may just be completely lost.

Thanks in advanced!

studywolf commented 7 years ago

Yup iLQR is an implementation of model predictive control!

You can do a version where you don't do the optimization loop at every time step, but as it's intended the full optimization of the trajectory gets run at every time step. The idea being that you can compensate for the modeling errors (from using a linear model of the dynamics) as your trajectory unfolds on the real robot. Does that help?

stepjam commented 7 years ago

OK thanks for clearing that up. So when you run your iLQR example (e.g the link arm), does it run a lot slower than the vanilla LQR? For me, one second in simulation time take about 5-10 seconds in real time for iLQR. Thanks again

studywolf commented 7 years ago

Oh yeah this is waaayyyy slower than just LQR where you only look one time step ahead. Actually, a lot of work in Todorov's lab is on streamlining and optimization of the algorithms, getting them implemented efficiently enough on powerful enough computers that they can be used in real time.