rfetick / Kalman

Implement Kalman filter for your Arduino projects
MIT License
137 stars 14 forks source link

Use of "inverse" function /// get_sensor_data() missing /// µC blocks #3

Closed Eheran1 closed 2 years ago

Eheran1 commented 3 years ago
Kalman.h:183:16: error: 'class BLA::Matrix<2, 2, BLA::Array<2, 2, float> >' has no member named 'Inverse'
  183 |   K = P*(~H)*S.Inverse(&status);
      |              ~~^~~~~~~

The BasicLinearAlgebra Github has this example and the syntax is "Invert(Matrix)", so maybe a easy fix? I have solved this by changing that section to:

  //K = P*(~H)*S.Inverse(&status);
  bool is_nonsingular = Invert(S);
  K = P*(~H)*S;
  if(is_nonsingular){
  //if(!status){

Additionally, in the minimal example: kalman_minimal:71:9: error: 'get_sensor_data' was not declared in this scope Where is this function? Is it like "SIMULATOR_UPDATE()"?

Additionally: My Feather M0 stops working (needs manual reset into boot loader) when I include this line: KALMAN<Nstate,Nobs> K; // your Kalman filter Need to test a different µC --> works with Arduino Leonardo (Pro Micro // MEGA32U4)

PS: Any issue or successful test? Your feedback is important for improving this library. See the Contact section at the end of this file or write to the Group! The link is broken. It can be found atleast at one more position.

FUEL4EP commented 3 years ago

I am facing to the same issue. Could you fix it, please? Thanks a lot in advance.

rfetick commented 3 years ago

Thanks for your feedback,

It seems that BasicLinearAlgebra had not been updated for 4 years, however 3 months ago it passed to version 3 with changes that might not ensure retro-compatibility with previous versions.

The first option for you is to use previous version of BasicLinearAlgebra.

In the meantime I will work on the Kalman library to match the newest version of BasicLinearAlgebra.

Cheers,

Romain

FUEL4EP commented 3 years ago

Thanks a lot, Romain!

Your Kalman library is a great library. I use it successfully on a ATMega1284P MCU for doing online multiple linear regressions. It is astonishing that this is possible with such a small memory footprint on an Arduino.

rfetick commented 3 years ago

The issue seems to be solved if you download the (most recent) version 1.1.0 of the Kalman library and the (most recent) version 3.2 of BasicLinearAlgebra. I hope that future versions of BasicLinearAlgebra will also be compatible.

Cheers,

Romain

FUEL4EP commented 3 years ago

Thanks a lot for your update, Romain!

It works again after downloading the (most recent) version 1.1.0 of the Kalman library and the (most recent) version 3.2 of BasicLinearAlgebra. :-) Perfect support!

rfetick commented 2 years ago

No user reported an error after the patch has been released. I close the issue.