make parameters of mpc controller changeable

This commit is contained in:
Simon Pirkelmann 2020-11-18 21:54:23 +01:00
parent c2307261c5
commit 0fddd75393

View File

@ -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