[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Paparazzi-devel] Vector Increment wrong in ahrs_cmpl_filter
From: |
flavio_just |
Subject: |
[Paparazzi-devel] Vector Increment wrong in ahrs_cmpl_filter |
Date: |
Fri, 23 Oct 2015 13:55:31 -0700 (MST) |
Guys, I have the following code below. What happens is that vector3 Corr is
supposed to implement a 1 increment but the result is something like
14,44,74,104... instead of 1,2,3,4... And I have no idea why.
Code:
In ahrs_int_cmpl_euler.h
struct AhrsIntCmplEuler {
struct Int32Vect3 Corr
}
In ahrs_int_cmpl_euler.c
void ahrs_init(void) {
ahrs.status=AHRS_UNINIT;
INT32_VECT3_ZERO(ahrs_impl.Corr)
other variables go here...
}
void ahrs_propagate(void) {
default code goes her...
in the end of ahrs_propagate function goes:
ahrs_impl.Corr.x+=1;
ahrs_impl.Corr.y+=1;
ahrs_impl.Corr.z+=1;
}
In telemetry.h:
#ifdef USE_AHRS_CMPL
#include "subsystems/ahrs/ahrs_int_cmpl_euler.h"
#define PERIODIC_SEND_FILTER(_chan) { \
DOWNLINK_SEND_FILTER(_chan, \
&ahrs.ltp_to_imu_euler.phi, \
&ahrs.ltp_to_imu_euler.theta, \
&ahrs.ltp_to_imu_euler.psi, \
&ahrs_impl.measure.phi, \
&ahrs_impl.measure.theta, \
&ahrs_impl.measure.psi, \
&ahrs_impl.hi_res_euler.phi, \
&ahrs_impl.hi_res_euler.theta, \
&ahrs_impl.hi_res_euler.psi, \
&ahrs_impl.residual.phi, \
&ahrs_impl.residual.theta, \
&ahrs_impl.residual.psi, \
&ahrs_impl.gyro_bias.p, \
&ahrs_impl.gyro_bias.q, \
&ahrs_impl.gyro_bias.r, \
&ahrs_impl.Corr.x, \
&ahrs_impl.Corr.y, \
&ahrs_impl.Corr.z); \
}
#else
#define PERIODIC_SEND_FILTER(_chan) {}
#endif
I changed the last 3 entries of the message FILTER. After I turn on the
drone and make some moviments with it, the info goes to a SD card where I
decode the info using Matlab. I read this message from binary format as
int32. The result I get is what I explained before, something like, 0 14 44
74 etc...sometimes it jumps 30, sometimes it jumps 60 or 90...
Can someone tell me what is the problem here? maybe some memory variables,
bitshifts...I don't know =/.
Thank you so much guys!
Flávio Justino
--
View this message in context:
http://lists.paparazziuav.org/Vector-Increment-wrong-in-ahrs-cmpl-filter-tp17493.html
Sent from the paparazzi-devel mailing list archive at Nabble.com.
- [Paparazzi-devel] Vector Increment wrong in ahrs_cmpl_filter,
flavio_just <=