Could there be a bug in fusion.c?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Could there be a bug in fusion.c?

Jump to solution
1,340 Views
vlam
Contributor I

Hello,

 

The following is line 1386 in function fRun_9DOF_GBY_KALMAN() in fusion.c.

 

    fmatrixAeqInvA(pfRows, iColInd, iRowInd, iPivot, 3);

 

That line is supposed to compute the inverse of the 6x6 matrix, P+, however, the size passed to it is 3. Is that supposed to be 6 instead?

 

Regards,

Vinh

Labels (1)
0 Kudos
Reply
1 Solution
938 Views
michaelestanley
NXP Employee
NXP Employee

YES!  I took your question to the author of that piece of code (Mark Pedley), and he confirmed your suspicion.  So first, apologies for creation of a bug for you to find, and second, my sincere congratulations on identifying it so precisely.  I very rarely find problems in Mark's code, although I've spent a lot of time with it over the years.

What led you to it?

Regards,

Mike

View solution in original post

0 Kudos
Reply
2 Replies
939 Views
michaelestanley
NXP Employee
NXP Employee

YES!  I took your question to the author of that piece of code (Mark Pedley), and he confirmed your suspicion.  So first, apologies for creation of a bug for you to find, and second, my sincere congratulations on identifying it so precisely.  I very rarely find problems in Mark's code, although I've spent a lot of time with it over the years.

What led you to it?

Regards,

Mike

0 Kudos
Reply
938 Views
vlam
Contributor I

Hi Michael,

Thanks to you and Mark Pedley for confirming that. No apologies are necessary -- I am glad to help out. I appreciate that Freescale is making the code and documentation available to help the community making further advances in this area.

I found that bug while porting the code to Java (to run on Android in particular). The available documentation helps to make reading such good quality code a pleasure. Please give Mark my compliment.

That reminds me: May I ask you a somewhat related question on this thread? In function, driver.c:CreateAndSendBluetoothPacketsViaUART(), it is not clear to me why various measurements are scaled by different amounts. For examples, angular velocities (fOmega) are scaled by 20, Euler angles (fPhiPl, fThePl, fRhoPl) by 10, quaternions (fq) by 30K, etc.

1. Why do they need to be scaled? How are the scaling values determined?

2. Linear acceleration (faSePl)  is not output. But if it were, how would it be scaled?

Regards,

Vinh

0 Kudos
Reply