Open StrawsonDesign opened 4 years ago
Looks like when no sysid solution is found, best_u and best_y are never set and remain "none". The check for a valid solution should have come before running sysid on best_u and best_y. This is fixed in the following commit:
https://github.com/StrawsonDesign/px4_pid_tuner/commit/09e6fd4b71a6df33188ed2d1c541f1283f243483
I'll hold off on submitting more pull requests as I see many more fixes and tweaks in the near future.
when passing u and y into SIPPY those two arrays seem to not have a type when they should be floats. I poked a little and self._y and self._u in the PX4SYSID class seem to be 1x1250 floats as expected but the type is lost after being run through numpy's atleast_2d() function.
Forcing A stability Forcing A stability Forcing A stability Forcing A stability Processing batch# 5 Best fit = 0.0 Traceback (most recent call last): File "./px4_pid_tuner.py", line 907, in
main(args)
File "./px4_pid_tuner.py", line 849, in main
sysid = PX4SYSID(best_t, best_u, best_y, use_subspace =True, subspace_method='N4SID', Ts=dt, u_name='best_input', y_name='best_ouput', subspace_p=best_p, plot = True)
File "./px4_pid_tuner.py", line 310, in init
self.do_sys_id()
File "./px4_pid_tuner.py", line 364, in do_sys_id
sys_id = system_identification(self._y, self._u, self._subspace_method, SS_fixed_order=num_poles, SS_p=self._subspace_p, SS_f=50, tsample=self._Ts, SS_A_stability=True, centering='MeanVal')
File "/usr/local/lib/python3.6/dist-packages/sippy-0.1.0-py3.6.egg/sippy/init.py", line 22, in system_identification
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'