paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] Gyro Values in Floating Point


From: Felix Ruess
Subject: Re: [Paparazzi-devel] Gyro Values in Floating Point
Date: Mon, 2 Nov 2015 15:34:25 +0100

Hi Flavio,

that is a bit of a shame, since the latest version allows you to run multiple AHRS algorithms at the same time and is IMHO cleaner...

Cheers, Felix

On Wed, Oct 28, 2015 at 11:46 PM, Flavio Justino <address@hidden> wrote:
Thank you so much for your help Felix!
About starting with a new version, it may be more complicated than it seems. My quadcopter was designed and customized by a company for my Faculty. It has lots of changes in terms of controllers that I should not change. That's why I'm including the new estimator in this older version. I'm even trying to write it in the ahrs_int_cmpl_euler.c file to compare it directly with the complementary filter that is already installed (including both estimators in the FILTER message after). I'm not sure if it's the best idea or not...but changing version seems practically impossible at the moment.

2015-10-28 22:05 GMT+00:00 Felix Ruess <address@hidden>:
Hi Flavio,

RATES_FLOAT_OF_BFP(ahrs_impl.gyro_tbf, imu.gyro) will give you the rates in SI units, so radians/sec, see also http://docs.paparazziuav.org/latest/imu_8h.html#structImu

On a side note: you shouldn't directly read from the global imu struct (which we will hopefully get rid off soon), but rather subscribe to the IMU_GYRO_INT32 ABI message...
In current master that is done in the corresponding ahrs_int_cmpl_euler_wrapper.c.

From what you write, it looks like you are using an older version of paparazzi, if you want to write a new estimator, it would make sense to start from the current master...

Hope that helps,
Felix

On Tue, Oct 27, 2015 at 7:15 PM, flavio_just <address@hidden> wrote:
Hello guys!
I am trying to write an algorithm for a new estimator in floating point. I
need a structure containing the values of the gyroscope, accel and mag in
floating point type. What I want exactly is that the values of each sensor
are in SI units without multiplying with any coefficients like happens with
BFP. I tried the following code just for the gyro values, just for testing:

in file ahrs_int_cmpl_euler.c (I'm writing the code here so I can compare
the results with this filter)

void ahrs_propagate(void) {
default code goes here

RATES_FLOAT_OF_BFP(ahrs_impl.gyro_tbf, imu.gyro);
}

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.tbf_eulers_meas.phi,\
                         &ahrs_impl.tbf_eulers_meas.theta,\
                         &ahrs_impl.tbf_eulers_meas.psi,\
                         &ahrs_impl.gyro_tbf.p,\
                         &ahrs_impl.gyro_tbf.q,\
                         &ahrs_impl.gyro_tbf.r);\
}
#else
#define PERIODIC_SEND_FILTER(_chan) {}
#endif

I changed the last 3 entries in FILTER message to see the values of the
gyro. After I turn on the drone and make some movements with it, the info
goes to a SD card and I read the info using matlab. The values should be
something between 0 and 45 deg/s for the movements that I'm doing but it
shows something like 1E+09 all the time.

Can anyone explain me the reason?
Thank you guys!

Flavio





--
View this message in context: http://lists.paparazziuav.org/Gyro-Values-in-Floating-Point-tp17510.html
Sent from the paparazzi-devel mailing list archive at Nabble.com.

_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel


_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel




--
Flávio Justino


_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



reply via email to

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