Fix pid_type "Normal" crashing on startup
PidFactory.create() calls both controllers with the same (dt, params,
model_params, theta_amb=...) signature, but TempController ("Normal")
only accepted (dt, params) - any config using pid_type "Normal" would
crash with a TypeError on startup. It has no internal model, so just
accepts and ignores the extra arguments.
This commit is contained in:
@@ -2,7 +2,10 @@ from components.pid.temp_controller_base import TempControllerBase
|
|||||||
|
|
||||||
|
|
||||||
class TempController(TempControllerBase):
|
class TempController(TempControllerBase):
|
||||||
def __init__(self, dt, params):
|
def __init__(self, dt, params, model_params=None, theta_amb=20):
|
||||||
|
# model_params/theta_amb are accepted (but unused) for constructor
|
||||||
|
# compatibility with TempControllerSmith - PidFactory.create() calls
|
||||||
|
# either with the same arguments; "Normal" has no internal model.
|
||||||
TempControllerBase.__init__(self, dt, params)
|
TempControllerBase.__init__(self, dt, params)
|
||||||
self.dt = dt
|
self.dt = dt
|
||||||
self.last_theta_ist = 20
|
self.last_theta_ist = 20
|
||||||
|
|||||||
Reference in New Issue
Block a user