Erratic and Conflicting Roll, Pitch and Yaw values.

Topics related to the Lighthouse positioning system, configuration and use
Post Reply
cafeciaojoe
Member
Posts: 81
Joined: Mon Jun 18, 2018 2:37 am

Erratic and Conflicting Roll, Pitch and Yaw values.

Post by cafeciaojoe »

Hi All,

I am getting some strange readings from the state estimate log that I just cant iron out enough for them to be useable.

Across three different drones. with completely stock firmware. I am getting very erratic roll pitch and yaw readings. I also get different readings across all three drones.

In this test each drone was 1.2m below the BS's. 1.8m away from the BS's and directly in front of the BS's. There were 2 BS on at the time. Channel 1 and Channel 2. The Lighthouse deck is mounted on top of the drone and is pushed all the way up to the top of a set of extra long pins (I assume this is the best way to ensure the deck is paralell with the chassis as the pins are pushed all the way into the drone). The Crazyflie was flashed, then the estimate geometry button was pressed and the values written to the crazyflie. These screenshots were taken after the 500 sample slots were filled (about 5 sec after starting the plot).

Q1 - Why are these readings so erractic compared to the x, y and z estimates which are rock solid?

Q2 - Why are they hovvering around different values across the three drones

Q3 - What values should they be? (I assue they should all be 2 * pi ~6.28 as the drone has not moved from the positino it was calibrated from...)
BS layout (ignore GUI for BS 3 and 4)
BS layout (ignore GUI for BS 3 and 4)
Screen Shot 2021-05-04 at 2.35.18 pm.png
Screen Shot 2021-05-04 at 2.39.30 pm.png
Screen Shot 2021-05-04 at 2.46.25 pm.png
the experimENt was also repeated with the lh Deck mounted on short pins close to the chassis. No different to the corresponding long pin results.
the experimENt was also repeated with the lh Deck mounted on short pins close to the chassis. No different to the corresponding long pin results.
PhD Student
RMIT University
School of Design
http://www.cafeciaojoe.com
Image
kristoffer
Bitcraze
Posts: 479
Joined: Tue Jun 30, 2015 7:47 am

Re: Erratic and Conflicting Roll, Pitch and Yaw values.

Post by kristoffer »

Hi!

Roll, pitch and yaw are all in degrees, I think it looks pretty good :-)
kristoffer
Bitcraze
Posts: 479
Joined: Tue Jun 30, 2015 7:47 am

Re: Erratic and Conflicting Roll, Pitch and Yaw values.

Post by kristoffer »

As a side note: there is some work on-going to convert all values in the firmware to SI-units and I assume all angles would be converted to radians as well (radians is a valid assumption). Not sure when it will happen but it would make life easier.
cafeciaojoe
Member
Posts: 81
Joined: Mon Jun 18, 2018 2:37 am

Re: Erratic and Conflicting Roll, Pitch and Yaw values.

Post by cafeciaojoe »

Hello!

I have isolated the problem. It is when the CF is relying on the basestation that is beneth it. Please refer to the videos below.
In our setup. There are 4BS two in the standard positions and one each immediateley below them about 350mm off the ground.
We place the CF on the floor and run the standard "manage geometry" proces from the client. all 4BS are picked up.

When flipped, the value just goes way off before settling down so something more sane.
In both screen recordings the Drone was rolled 180degrees (positive direction)
But you can see how long the z and roll values take to calm down. and even then they are prone to going off again.

My guess is the values from the BS are fighting the IMU values in the kalman filter. But this is a pretty uneducated guess.
My other guess is that the angles between the bottom BSs (7 and 5 in the attached pic) are too shallow when we took the calibration measurement.
But that is less likeley I think. the centroid of the BS is about 350mm above the top of the CF deck.

How the Drone was flipped. (Note how the received BS's went from 3 and 1 to 7, it is not different when it is receiving 5 and 7.)
https://youtu.be/nDXARUOD7UY

Flipping the drone Measuring Z
https://youtu.be/FEZILCfn2DU

Flipping the drone Measuring Roll
https://youtu.be/ItAiWSIRgaY

Thanks!
PhD Student
RMIT University
School of Design
http://www.cafeciaojoe.com
Image
kristoffer
Bitcraze
Posts: 479
Joined: Tue Jun 30, 2015 7:47 am

Re: Erratic and Conflicting Roll, Pitch and Yaw values.

Post by kristoffer »

Interesting! This might be related to the way we estimate the yaw. The yaw is estimated on the assumption that the roll and pitch is "good" and tries to project the base station sweeps onto the crazyflie to calculate the yaw error. It is possible (likely) that this code assumes that the base station is above the CF facing downwards (the same way as the base station estimation code does) and that the resulting yaw error is wrong. The yaw error is pushed into the kalman filter and if it is wrong it messes up the state.

This code is pretty "hackish" and is due for a re-write, we should keep this use case in mind :-)

This is where the yaw-error is pushed to the kalman filter https://github.com/bitcraze/crazyflie-f ... #L437-L438
You could comment it out to see what happens, you will not get any yaw estimation but you should not get the pulsating behaviour (I think). Maybe you can skip the yaw estimation for the base stations that are facing upwards?
cafeciaojoe
Member
Posts: 81
Joined: Mon Jun 18, 2018 2:37 am

Re: Erratic and Conflicting Roll, Pitch and Yaw values.

Post by cafeciaojoe »

Wow, yeah good to know.
thanks for the suggestion.
I commented out the two lines and flashed the CF.

It is a little more stable when flipped, But has this creeping error that then kind of snaps back.
The Drone does fly but creeps up int he Z axis and the Y axis a little too before snapping back.
Any of my code that uses roll and pitch is still a bit too erratic.
But XYZ vales are more useable, so thanks!


Flipping Roll No Yaw Error Correction
https://youtu.be/eRyWa-gs9ug

Flippin Z No Yaw Error Correction
https://youtu.be/hHqMfXGchVQ
PhD Student
RMIT University
School of Design
http://www.cafeciaojoe.com
Image
Post Reply