Absolute yaw, or stopping the yaw re-zeroing?

Discussions and questions about the Crazyflie Nano Quadcopter
Post Reply
al_cf_uom
Beginner
Posts: 6
Joined: Mon Dec 10, 2018 12:59 pm

Absolute yaw, or stopping the yaw re-zeroing?

Post by al_cf_uom »

Hi

When I look at the stabilizer.yaw via the logger it will provide a very accurate measurement, but then over several seconds to a minute will always re-zero the current 'yaw = 0' to wherever value it is currently facing.
For the purposes of my project I require this value to remain accurate even when the CF is stationary.

I have tried to get around this by using the magnometer values on a CF 2.0, the magnometer provides no readings on a CF 2.1 however (Using latest firmware). The magnometer solution is inelegant, and not nearly so precise as the stabilizer.yaw measurements taken from the internal Kalman filter.

Is there some method to disable the re-zeroing in firmware, or an alternative yaw measurement I could extract?
I think there will be some drift with no re-zeroing as from what I can gather the yaw measurement is taken from gyro integration, but this should not be a problem for our purposes.

Thanks
arnaud
Bitcraze
Posts: 2538
Joined: Tue Feb 06, 2007 12:36 pm

Re: Absolute yaw, or stopping the yaw re-zeroing?

Post by arnaud »

Hi,

This is a 'functionality' of the kalman filter to ensure that the initial YAW is accurate. You can disable is by setting the ROLLPITCH_ZERO_REVERSION contant to 0 in the kalman filter: https://github.com/bitcraze/crazyflie-f ... man.c#L205.

The effect is that you need to start your Crazyflie or reset the kalman filter when the Crazyflie is flat and facing X. This is to ensure that the initial attitude is close enough to the current platform attitude.
al_cf_uom
Beginner
Posts: 6
Joined: Mon Dec 10, 2018 12:59 pm

Re: Absolute yaw, or stopping the yaw re-zeroing?

Post by al_cf_uom »

This worked- thanks!

However I am still wondering why it is that we cannot get any magnometer data from the crazyflie 2.1?

Is this something that requires a simple firmware change, or is it a difference in the hardware?
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Absolute yaw, or stopping the yaw re-zeroing?

Post by tobias »

We did not include a magnetometer in CF2.1 as we could not make use of the data in the CF2.0. If magnetometer is needed this would have to be added to a deck, probably in combination with a GPS deck. How are you hoping to use the magnetometer? Indoors this is generally not improving things.
Post Reply