make parameters of mpc controller changeable
This commit is contained in:
parent
c2307261c5
commit
0fddd75393
|
@ -6,11 +6,11 @@ from casadi_opt import OpenLoopSolver
|
|||
|
||||
|
||||
class MPCController(ControllerBase):
|
||||
def __init__(self):
|
||||
def __init__(self, N=20, T=1.0):
|
||||
super().__init__()
|
||||
self.t = None
|
||||
|
||||
self.ols = OpenLoopSolver(N=20, T=1.0)
|
||||
self.ols = OpenLoopSolver(N=N, T=T)
|
||||
self.ols.setup()
|
||||
self.control_rate = self.ols.T / self.ols.N
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user