Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

u and y arrays seem to lose their float type when passing to SIPPY #1

Open
StrawsonDesign opened this issue Feb 22, 2020 · 1 comment

Comments

@StrawsonDesign
Copy link

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'

@StrawsonDesign
Copy link
Author

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:

StrawsonDesign@09e6fd4

I'll hold off on submitting more pull requests as I see many more fixes and tweaks in the near future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant