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:

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.