[Top][All Lists]

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

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

From: Flavio Justino
Subject: Re: [Paparazzi-devel] Gyro Values in Floating Point
Date: Wed, 28 Oct 2015 22:46:18 +0000

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

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,

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
#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,                        */\
#define PERIODIC_SEND_FILTER(_chan) {}

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!


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

Paparazzi-devel mailing list

Paparazzi-devel mailing list

Flávio Justino

reply via email to

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