### QUICK HELP: APM Pitch angle problem

Hi,

In APM (ArduPlane/ ArduCopter) with/ without Mission Planner, we can observe that when the board is titled down, pitch angle changes from 0 (horizontal position), to 90 (vertically pointing downward), and tilting it further brings/decreases it back to 0 in the reverse position.

See figure, you will understand my point. How do I distinguish any two same angle readings (which basically look alike but the board has different orientation). I am sure, other have faced this too. I need to do some processing with these angles, and important for me to know which angle (85 deg) orientation the board is really in, the processing get confused due to not handling this scenario.

Looking for a quick solution to tackle this. Thank you!

Pitch_Problem.jpg

Replies are closed for this discussion.

#### Replies

• T3

Hi Shyam,

In case anyone on this thread is still interested, you and I figured out that you were running into a gimbal lock problem with Euler angles. There were a couple of possible solutions, including using direction cosines instead of Euler angles. However, you and I came up with a simple solution that allowed you to use Euler angles, which you posted here.

Best regards,

Bill Premerlani

• Developer

### Activity

RT @_JonMyer: 🚨Attention DeepRacer's including #UndergroundDeepRacer🚨 Check our our LIVE stream that including @IAM_dbro Take a few moments…
1 hour ago
RT @MarvelmindMaxim: Extreme precision for 60 swarming robots. #marvelmind #autonomousrobotics #robotics #swarmrobotics #rtls #ips #indoor…
Monday
RT @MarvelmindMaxim: Precise (±2cm) tracking for racing boats and autonomous boats. Works outdoor and indoor. #autonomous #AutonomousVehic…
Monday
RT @MarvelmindMaxim: Helping PixHawk folks to fly autonomous quadcopters using PX4 and ArduPilot. https://marvelmind.com/drones/ Equally suitab…
Monday
RT @chr1sa: The @DIYRobocars @donkey_car virtual AI car race is starting in 15 minutes! Watch it live on Twitch https://www.twitch.tv/mossmann3333 htt…
Saturday
RT @chr1sa: Don't miss our monthly @DIYRobocars @donkey_car virtual AI car race tomorrow at 10:00am PT live on Twitch. Head-to-head racing…
Friday
RT @sparkfun: Our completed tutorial on building an @NVIDIA Jetson Nano-powered @Sphero RVR gets your bot up and running via teleoperation…
Jul 30
RT @SmallpixelCar: Freeway test https://t.co/4V5tV9lhIP
Jul 29
Very small autonomous cars racing, thanks to an overhead camera: https://control.ee.ethz.ch/research/team-projects/autonomous-rc-car-racing.html
Jul 29