rsLQR
0.1
|
This page provides some details on how to use the rsLQR solver to solve an LQR problem.
First, create a new LQRProblem with ndlqr_NewLQRProblem
Next, fill in the LQRProblem data. You can choose to define an array of LQRData structs and use ndlqr_InitializeLQRProblem(), or loop over time steps and do it yourself
Initialize a new solver:
Call the ndlqr_SolveRiccati() method to solve the system using Riccati recursion:
A summary of the solve can be printed using:
Like the rsLQR solver, the solution can vector can be obtained either one of two ways:
or
Note that the second method return a Matrix whose data is still owned by the solver (avoids a memory allocation or copy). Do not free this memory and be aware that editing it will edit the data stored in the solver.
Don't forget to free the solver!