1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-24 16:55:29 +03:00

MAVLink V2 library (auto-generated)

This commit is contained in:
Harry Phillips 2021-02-28 18:26:02 +00:00
parent f58ef63cb4
commit c644fdf9ea
No known key found for this signature in database
GPG key ID: E4F581AA073CD264
132 changed files with 36223 additions and 1470 deletions

View file

@ -1,5 +1,4 @@
#ifndef _MAVLINK_CONVERSIONS_H_
#define _MAVLINK_CONVERSIONS_H_
#pragma once
#ifndef MAVLINK_NO_CONVERSION_HELPERS
@ -39,10 +38,10 @@
*/
MAVLINK_HELPER void mavlink_quaternion_to_dcm(const float quaternion[4], float dcm[3][3])
{
double a = quaternion[0];
double b = quaternion[1];
double c = quaternion[2];
double d = quaternion[3];
double a = (double)quaternion[0];
double b = (double)quaternion[1];
double c = (double)quaternion[2];
double d = (double)quaternion[3];
double aSq = a * a;
double bSq = b * b;
double cSq = c * c;
@ -70,7 +69,7 @@ MAVLINK_HELPER void mavlink_quaternion_to_dcm(const float quaternion[4], float d
MAVLINK_HELPER void mavlink_dcm_to_euler(const float dcm[3][3], float* roll, float* pitch, float* yaw)
{
float phi, theta, psi;
theta = asin(-dcm[2][0]);
theta = asinf(-dcm[2][0]);
if (fabsf(theta - (float)M_PI_2) < 1.0e-3f) {
phi = 0.0f;
@ -211,6 +210,3 @@ MAVLINK_HELPER void mavlink_euler_to_dcm(float roll, float pitch, float yaw, flo
}
#endif // MAVLINK_NO_CONVERSION_HELPERS
#endif // _MAVLINK_CONVERSIONS_H_