Azimuth... Please, help me

Hello there,

I’m new to this “world” and I’m dedicating a lot of time it. However, I still have a lot of doubts and would very much appreciate any help.
I bought this IMU which gives me x, y and z from the accelerometer, from the gyroscope and from the magnetometer. I also get roll, pitch and yaw.
I intend to have the IMU static and calculate its inclination (done) and it’s azimuth (working on it).
Can you anybody please give me a clue on how to get it’s azimuth?
Thank’s a lot!

Presumably you are measuring azimuth from magnetic North. Google “3d electronic compass” for information on how to do that with your magnetometer. If you are using the Pololu boards, the engineers have provided example code to create such a compass, for example … p-note.pdf


As Jim pointed out, our Heading example for Arduino might be helpful for you. It serially prints in degrees the angular difference in the horizontal plane between the direction of the sensor and north (the direction of the sensor can be set by the user). You can find the example code on our Arduino library for Pololu LSM303 boards github page.

- Jeremy