lsm303-arduino icon indicating copy to clipboard operation
lsm303-arduino copied to clipboard

Calculation of Pitch and Roll

Open tao-qian opened this issue 12 years ago • 4 comments
trafficstars

Hello, I added two methods for the calculation of pitch and poll, which are commonly used with heading.

tao-qian avatar Jun 24 '13 23:06 tao-qian

Thank you for your contribution. Can you explain where you got your formulas for calculating pitch and roll?

Do you assume that the -Y axis is the "front" and the +Z axis is the "top"? This seems to produce results that make the most sense, although it seems like the angles might be reversed from what I understand to be the convention: according to this Wikipedia article, "The most common aeronautical convention defines the roll as acting about the longitudinal axis, positive with the starboard (right) wing down. The yaw is about the vertical body axis, positive with the nose to starboard. Pitch is about an axis perpendicular to the longitudinal plane of symmetry, positive nose up." (Though no source is cited, so I don't know if that's right or not.) Do you have a reason for picking the convention you did?

kevin-pololu avatar Jul 25 '13 00:07 kevin-pololu

Hello, It has been a while since I wrote the code and now I cannot find the reference site I used. The convention stated in the Wiki article makes sense to me. And I believe it is probably the one that most people use. Thank you for pointing that out!

tao-qian avatar Jul 25 '13 01:07 tao-qian

Hi, I found an issue when using the function 'getDeviceType' , the result of determined device type was wrong. I was using LSM303DLH, but the result returned was DLHC. So the acc address was wrong. Thank you for your code!

smileage001 avatar Jan 09 '14 07:01 smileage001

Hi, I want to use the pitch and roll functions you have added, but cannot seem to access them. I have re-downloaded the library zip file, and assumed you used them as mypitch = compass.pitch(). However that doesn't work.

I have a version of your compass heading working just fine on my arduino, how to I get to pitch and roll? can you give me an example usage, or maybe the functions are not merged into my library

mdobres avatar Sep 03 '17 16:09 mdobres