Functions and structs for dealing with 'Attitude' and AHRS.
More...
|
file | ahrs.h |
| API header file for attitude and AHRS in zscilib.
|
|
|
struct | zsl_attitude |
| Represents the orientation of a rigid body with respect to the world frame in terms of roll, pitch and yaw (heading), expressed in degrees. More...
|
|
|
int | zsl_att_to_vec (struct zsl_attitude *a, struct zsl_vec *v) |
| Takes the values in the supplied zsl_attitude, and assigns the same memory address to a zsl_vec, allowing for vector functions to be used on the zsl_attitude values. More...
|
|
int | zsl_att_to_euler (struct zsl_attitude *a, struct zsl_euler *e) |
| Converts the input zsl_attitude, expessed in degrees, to it's equivalent in radians in the output zsl_euler. More...
|
|
int | zsl_att_from_euler (struct zsl_euler *e, struct zsl_attitude *a) |
| Converts the input zsl_euler, expessed in radians, to it's equivalent in degrees in the output zsl_attitude. More...
|
|
int | zsl_att_from_accelmag (struct zsl_vec *accel, struct zsl_vec *mag, struct zsl_attitude *a) |
| Converts a three-axis accelerometer (in m/s^2) and a three-axis magnetometer sample (in micro-Tesla) to attitude. More...
|
|
int | zsl_att_from_accel (struct zsl_vec *accel, struct zsl_attitude *a) |
| Converts a three-axis accelerometer sample (in m/s^2) to roll and pitch. More...
|
|
int | zsl_att_accel_angle (struct zsl_vec *a1, struct zsl_vec *a2, zsl_real_t *b) |
| Calculates the angle between two accelerometers. More...
|
|
Functions and structs for dealing with 'Attitude' and AHRS.
Structs like zsl_attitude are inteded to be used as 'last-mile' represetnations, to convert Euler angles (in radians) to something more human-friendly like degrees. Most calculations should make use of Euler angles, and the richer API around them, with conversion to degrees as the final step.
◆ zsl_att_accel_angle()
Calculates the angle between two accelerometers.
- Parameters
-
a1 | First acceleration triplet in m/s^2. |
a2 | First acceleration triplet in m/s^2. |
b | Angle between the accelerometers, in radians. |
- Returns
- 0 if everything executed correctly, otherwise a negative error code if the accelerometer data is not tridimensional.
◆ zsl_att_from_accel()
Converts a three-axis accelerometer sample (in m/s^2) to roll and pitch.
- Parameters
-
accel | Acceleration triplet in m/s^2. |
a | Pointer the the output zsl_attitude struct. |
- Returns
- 0 if everything executed correctly, otherwise a negative error code.
◆ zsl_att_from_accelmag()
Converts a three-axis accelerometer (in m/s^2) and a three-axis magnetometer sample (in micro-Tesla) to attitude.
- Parameters
-
accel | Acceleration triplet in m/s^2. |
mag | Magnetometer triplet in micro-Tesla. |
a | Pointer the the output zsl_attitude struct. |
- Returns
- 0 if everything executed correctly, otherwise a negative error code.
◆ zsl_att_from_euler()
Converts the input zsl_euler, expessed in radians, to it's equivalent in degrees in the output zsl_attitude.
- Parameters
-
e | Pointer to the zsl_euler struct to use. |
a | Pointer to the zsl_attitued struct to use. |
- Returns
- 0 if everything executed correctly, otherwise a negative error code.
◆ zsl_att_to_euler()
Converts the input zsl_attitude, expessed in degrees, to it's equivalent in radians in the output zsl_euler.
- Parameters
-
a | Pointer to the zsl_attitued struct to use. |
e | Pointer to the zsl_euler struct to use. |
- Returns
- 0 if everything executed correctly, otherwise a negative error code.
◆ zsl_att_to_vec()
Takes the values in the supplied zsl_attitude, and assigns the same memory address to a zsl_vec, allowing for vector functions to be used on the zsl_attitude values.
- Parameters
-
- Returns
- 0 if everything executed correctly, otherwise a negative error code.