Hi. My question is: Is it possible to implement matrix.h library to arduino. I uploaded it with my post. I seriously need that very library in my project. I would appreciate any help.
matrix.h (26.6 KB)
Hi. My question is: Is it possible to implement matrix.h library to arduino. I uploaded it with my post. I seriously need that very library in my project. I would appreciate any help.
matrix.h (26.6 KB)
Apart from the very limited RAM available, what's the problem?
That code is written for the Microsoft or Borland C/C++ compilers and uses a lot of other support libraries.
I doubt that there's any way to get it to compile as-is on an Arduino. If you are only going to use a small number of matrix operations it would be easier to write them yourself - perhaps extracting some of the code from that file.
Which Arduino do you have and what size of matrices are you going to use?
Pete
I've got arduino Mega. My matrixes are: two 7x1, three 2x2, three 7x7
Those matrix sizes won't cause any problems. However, just so you know, if you were using double floating point elements (64 bits) the Mega only does 32-bit floating point.
You will have to write whatever matrix operations are needed yourself.
Pete
What do you need the matrix operations for?
Pete
I need them for Extended Kalman Filter.
Have you tried searching the Forum for Kalman Filter? There are quite a few posts about it and I think there may even be a library.
Googling for a phrase such as "arduino extended kalman filter library" brings up quite a few links. I haven't used or needed Kalman filtering do you'll have to decided what is suitable.
Pete
To make a proper Kalman filter, you need to be able to do matrix inversions. Inverting a 7x7 matrix is not a trivial exercise on an Arduino. I tried it last year, and eventually did that application on a more suitable device.
That's what I'm talking about.... Is there any library that is able to cope with matrixe's operations for arduino?
It's quite simple to invert a matrix by calculating adjugate matrix and determinant of the matrix. Not the most efficient way, but at least fairly simple to implement.