|
| 1 | +iLQRSolver.py is a library used to compute a sequence of control to |
| 2 | +reach a specified point with a specified system and cost function. |
| 3 | + |
| 4 | +In order to use the solver, you have to implement a class which describe |
| 5 | +the dynamic model of the system and another which describe the cost |
| 6 | +function you will use to solve your problem. The attributes and methods |
| 7 | +need to have the same names and return the same things. |
| 8 | + |
| 9 | +# dynamic model |
| 10 | + |
| 11 | +This class is the one which describe the system you want to command. It |
| 12 | +needs to have particular attributes and methods. |
| 13 | + |
| 14 | +### attributes |
| 15 | + |
| 16 | +Two attributes are mandatory for the solver to work. |
| 17 | + |
| 18 | + self.stateNumber |
| 19 | + self.commandNumber |
| 20 | + |
| 21 | +stateNumber attribute allow the solver to know how many variable your |
| 22 | +state contains. |
| 23 | +commandNumber specified the number of commands your system have. |
| 24 | +These 2 attributes are supposed to be unsigned integer. |
| 25 | +Both these attributes make the Solver as generic as possible. |
| 26 | + |
| 27 | +### methods |
| 28 | + |
| 29 | +Two methods are mandatory for the solver to work. |
| 30 | + |
| 31 | +```python |
| 32 | +def computeNextState(self,dt,X,U): |
| 33 | + ''' code here ''' |
| 34 | + return nextX |
| 35 | + |
| 36 | +def def computeAllModelDeriv(self,dt,X,U): |
| 37 | + ''' code here ''' |
| 38 | + return lx,lxx,lu,luu,lux,lxu |
| 39 | +``` |
| 40 | + |
| 41 | +$$\begin{aligned} |
| 42 | +lx &=& \partial \end{aligned}$$ |
| 43 | + |
| 44 | +The solver class need to be instantiated with the dynamic model of the |
| 45 | +system and the cost function you want to apply. |
| 46 | + |
| 47 | + solver = ILQRSolver(model, costFunction) |
0 commit comments