[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Paparazzi-devel] New Filter equations in ahrs_int_cmpl_euler.c

From: flavio_just
Subject: [Paparazzi-devel] New Filter equations in ahrs_int_cmpl_euler.c
Date: Wed, 11 Nov 2015 13:18:07 -0700 (MST)

Hello guys!
I have a complex question about developing a new filter, maybe it's even
more a question about C itself than PPRZ. I developed a new filter based on
the theory of a matrix trace. It's called Trace Based Filter (TBF). I was
hoping I could implement it on PPRZ. For now I am trying to do it inside
ahrs_int_cmpl_euler.c, inside propagate function (since it is the current
filter installed on my drone). The problem is that I have some recursive
equations that I don't know how I can implement them, I tried several ways
and the results are incorrect. I will leave the equations that I currently
have on Matlab:

RotCorr=[ -RotTerm(2,3), RotTerm(1,3), -RotTerm(1,2) ]';
Corr_s=[0       -Corr(3)   Corr(2);
        Corr(3)    0       -Corr(1);
        -Corr(2)   Corr(1)    0];

 %here apply EULERS OF RMAT to R_hat

Basically R_hat and Ry are matrixes (Ry is a rotation matrix obtain directly
from the sensors through euler angles) and R_hat is the estimated Rotation
matrix to obtain estimated eulers,D and DD are diagonal matrixes, 'a' and
delta_t are scalars. As you guys can see, the first equation for RotTerm and
the one for Corr are depend of previous values of R_hat and ew. I created
all of the necessary values in ahrs.h. For R_hat and ew I assigned them zero
value in init_function but it doesn't seem to work. I have problem too in
computing matrix exponentional in C, is there any function?

I know it's a complex question but it could be useful in the future for me
and for PPRZ eventually. The TBF is already validated in my Master Thesis. 

In annex I'm leaving you guys the file ahrs_int_cmpl_euler.c and
float_pprz_algebra.h where I wrote some functions to reproduce the
equations, if it helps. 

Best regards and thanks!
Flávio Justino

ahrs.h <>  

View this message in context:
Sent from the paparazzi-devel mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]