- #1
usb232
- 5
- 0
Homework Statement
Assume that the z-axis is pointing up, x-axis is along the horizontal, y-axis goes from "front to back".
How do i find the roll angle using 3 acceleration vectors with respect to each of the 3 axes (ax,ay,az) , that is (with respect to each other only something like f(ax,ay,az) = roll )?
Also, the range should be from [-pi to pi].
These 3 acceleration vectors are data taken from an accelerometer.
Homework Equations
(ax^2) + (ay^2) + (az^2) = 1 g -----> i assumed this, though i don't know if this applies to an accelerometer too :shy:
ax^2 + az^2 = axz^2
ay^2 + az^2 = ayz^2
ax^2 + ay^2 = axy^2
The Attempt at a Solution
i tried doing this,
1. i took the net acceleration projection in the xz plane: axz = sqrt { ax^2 + az^2 }
2. i then took the arctangent, between ax and axz: arctangent (ax / axz)
(please help, i know that this is wrong since tangent is only from -pi/2 to pi/2)