Drone flipping on takeoff

Hi Guys,
I am trying to use PX4 on my drone.
The problem is that each time that I try to takeoff the drone will flip slowly causing it to crash.
When looking in the log data it thinks that it traveled a long distance while in reality it only tipped over.
Also I am using a fake GPS.
See some of these logs for example:
https://logs.px4.io/plot_app?log=83c1750a-abb3-48d3-aae5-b584f2530f5c
https://logs.px4.io/plot_app?log=8f1692a2-4cc3-47e6-80b8-4c9b753aaf23
https://logs.px4.io/plot_app?log=a8f49d11-c456-4ed1-8107-d106e8739612

As can be seen first the drone turns north and then tries to takeoff but flips.
Thanks in advance

I am assuming you have done some modifications to the PX4 code because the git hash doesn’t point to anything in the PX4 repository. If so, it is difficult to help you because I have no idea what is going on.

Also, it looks like you’re running this on a Raspberry Pi. What sensors are you using? Are you using navio2?

Yes, I did some modifications to the PX4 code as writing my own output drivers and sensor drivers since I am using libiio.
I am using a special platform which comes with bosch sensors (BME680, BMI088) that should be more suitable for a drone.
I am not using the raspberry Pi but using a similar architecture.

In that case I suggest that you make sure that all signs of the gyro, accel, and mag values have the correct sign and are correctly oriented. Also, check that the rates are working sufficient using uorb top.