xyControl
0.1
Quadrotor Flight Controller on AVR Basis
|
Calculate Orientation using the Kalman-Filter, Accelerometer and Gyroscope. More...
Files | |
file | orientation.h |
Orientation API Header. | |
file | orientation.c |
Orientation API Implementation. | |
Data Structures | |
struct | Angles |
Can store orientation in Euler Space. More... | |
Macros | |
#define | TODEG(x) ((x * 180) / M_PI) |
Convert Radians to Degrees. More... | |
Functions | |
Error | orientationInit (void) |
Initializes the Orientation API. More... | |
Error | orientationTask (void) |
Calculate the current orientation. More... | |
void | zeroOrientation (void) |
Sets the current orientation to zero. More... | |
Variables | |
Angles | orientation |
Current Aircraft orientation. More... | |
Angles | orientation = {.pitch = 0, .roll = 0, .yaw = 0} |
Current Aircraft orientation. More... | |
Angles | orientationError = {.pitch = 0, .roll = 0, .yaw = 0} |
Current Aircraft orientation offset. More... | |
Kalman | pitchData |
Kalman-State for Pitch Angle. More... | |
Kalman | rollData |
Kalman-State for Roll Angle. More... | |
Calculate Orientation using the Kalman-Filter, Accelerometer and Gyroscope.
#define TODEG | ( | x | ) | ((x * 180) / M_PI) |
Convert Radians to Degrees.
Definition at line 55 of file orientation.c.
Referenced by orientationTask().
Error orientationInit | ( | void | ) |
Initializes the Orientation API.
Also initializes the Accelerometer, Gyroscope and Magnetometer. I2C should already be initialized!
Definition at line 73 of file orientation.c.
References accInit(), CHECKERROR, complementaryInit(), gyroInit(), kalmanInit(), r250DPS, r4G, and SUCCESS.
Error orientationTask | ( | void | ) |
Calculate the current orientation.
It will be stored in the global orientation Struct.
Definition at line 90 of file orientation.c.
References accRead(), CHECKERROR, complementaryExecute(), ERROR, getSystemTime(), gyroRead(), kalmanInnovate(), orientation, Angles::pitch, Angles::roll, SUCCESS, TODEG, Angles::vPitch, Angles::vRoll, Angles::vYaw, Vector3f::x, xySelfReset(), Vector3f::y, Angles::yaw, and Vector3f::z.
void zeroOrientation | ( | void | ) |
Sets the current orientation to zero.
Definition at line 137 of file orientation.c.
References orientation, Angles::pitch, Angles::roll, and Angles::yaw.
Angles orientation |
Current Aircraft orientation.
Definition at line 58 of file orientation.c.
Referenced by orientationTask(), pidTask(), and zeroOrientation().
Angles orientation = {.pitch = 0, .roll = 0, .yaw = 0} |
Current Aircraft orientation.
Definition at line 58 of file orientation.c.
Referenced by orientationTask(), pidTask(), and zeroOrientation().
Angles orientationError = {.pitch = 0, .roll = 0, .yaw = 0} |
Current Aircraft orientation offset.
Definition at line 61 of file orientation.c.
Kalman pitchData |
Kalman-State for Pitch Angle.
Definition at line 64 of file orientation.c.
Kalman rollData |
Kalman-State for Roll Angle.
Definition at line 65 of file orientation.c.