Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
state.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2011-2012 Felix Ruess <felix.ruess@gmail.com>
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, see
18 * <http://www.gnu.org/licenses/>.
19 */
20
31#ifndef STATE_H
32#define STATE_H
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
43
44#include "std.h"
45#include <string.h>
46
71#define POS_ECEF_I 0
72#define POS_NED_I 1
73#define POS_ENU_I 2
74#define POS_LLA_I 3
75#define POS_UTM_I 4
76#define POS_ECEF_F 5
77#define POS_NED_F 6
78#define POS_ENU_F 7
79#define POS_LLA_F 8
80#define POS_UTM_F 9
81#define POS_LOCAL_COORD ((1<<POS_NED_I)|(1<<POS_NED_F)|(1<<POS_ENU_I)|(1<<POS_ENU_F))
82#define POS_GLOBAL_COORD ((1<<POS_ECEF_I)|(1<<POS_ECEF_F)|(1<<POS_LLA_I)|(1<<POS_LLA_F)|(1<<POS_UTM_I)|(1<<POS_UTM_F))
89#define SPEED_ECEF_I 0
90#define SPEED_NED_I 1
91#define SPEED_ENU_I 2
92#define SPEED_HNORM_I 3
93#define SPEED_HDIR_I 4
94#define SPEED_ECEF_F 5
95#define SPEED_NED_F 6
96#define SPEED_ENU_F 7
97#define SPEED_HNORM_F 8
98#define SPEED_HDIR_F 9
99#define SPEED_LOCAL_COORD ((1<<SPEED_NED_I)|(1<<SPEED_ENU_I)|(1<<SPEED_NED_F)|(1<<SPEED_ENU_F))
106#define ACCEL_ECEF_I 0
107#define ACCEL_NED_I 1
108#define ACCEL_ECEF_F 2
109#define ACCEL_NED_F 3
116#define RATE_I 0
117#define RATE_F 1
124#define WINDSPEED_I 0
125#define DOWNWIND_I 1
126#define AIRSPEED_I 2
127#define WINDSPEED_F 3
128#define DOWNWIND_F 4
129#define AIRSPEED_F 5
130#define AOA_F 6
131#define SIDESLIP_F 7
138#define STATE_INPUT_DISABLE 0
139#define STATE_INPUT_ANY 0xFFFF
140#define STATE_INPUT_ORIGIN 1
141#define STATE_INPUT_POS 2
142#define STATE_INPUT_SPEED 3
143#define STATE_INPUT_ACCEL 4
144#define STATE_INPUT_ATTITUDE 5
145#define STATE_INPUT_RATES 6
146#define STATE_INPUT_WIND_AIR 7
152struct State {
153
161
168
173
179
186
195
200
207
214
221
227
234
240
249
252
262
265
272
290
295
301
307
313
319
326
332
337
343
349
366
371
377
383
389
395
407
412
413
422
427
433
450
455
460 union {
461 struct Int32Vect3 vect3;
462 struct Int32Vect2 vect2;
464
470
475 union {
476 struct FloatVect3 vect3;
477 struct FloatVect2 vect2;
479
485
491
497
500};
501
502extern struct State state;
503
504extern void stateInit(void);
505
510extern void stateSetInputFilter(uint8_t type, uint16_t id);
511
513#define STATE_CHECK_INPUT_AND_RETURN(flag, id) if (flag==STATE_INPUT_DISABLE || !(flag==STATE_INPUT_ANY || flag==id)) { return; }
514
539
541static inline void stateSetLocalUtmOrigin_f(uint16_t id, struct UtmCoor_f *utm_def)
542{
544
547
548 /* clear bits for all local frame representations */
553}
554
556static inline struct LtpDef_i *stateGetNedOrigin_i(void)
557{
559 return &state.ned_origin_i;
560 } else {
561 return NULL;
562 }
563}
564
566static inline struct LtpDef_f *stateGetNedOrigin_f(void)
567{
569 return &state.ned_origin_f;
570 } else {
571 return NULL;
572 }
573}
574
576static inline struct UtmCoor_f *stateGetUtmOrigin_f(void)
577{
579 return &state.utm_origin_f;
580 } else {
581 return NULL;
582 }
583}
584
585/************* declaration of origin accessor function ************/
586extern struct LlaCoor_i stateGetLlaOrigin_i(void);
587extern struct LlaCoor_f stateGetLlaOrigin_f(void);
590extern int32_t stateGetHmslOrigin_i(void);
591extern float stateGetHmslOrigin_f(void);
592
593/*******************************************************************************
594 * *
595 * Set and Get functions for the POSITION representations *
596 * *
597 ******************************************************************************/
598
599/************* declaration of transformation functions ************/
600extern void stateCalcPositionEcef_i(void);
601extern void stateCalcPositionNed_i(void);
602extern void stateCalcPositionEnu_i(void);
603extern void stateCalcPositionLla_i(void);
604extern void stateCalcPositionUtm_f(void);
605extern void stateCalcPositionEcef_f(void);
606extern void stateCalcPositionNed_f(void);
607extern void stateCalcPositionEnu_f(void);
608extern void stateCalcPositionLla_f(void);
609
610/*********************** validity test functions ******************/
611
618
620static inline bool stateIsGlobalCoordinateValid(void)
621{
623}
624
625/************************ Set functions ****************************/
626
628static inline void stateSetPositionEcef_i(uint16_t id, struct EcefCoor_i *ecef_pos)
629{
631
632 VECT3_COPY(state.ecef_pos_i, *ecef_pos);
633 /* clear bits for all position representations and only set the new one */
634 state.pos_status = (1 << POS_ECEF_I);
635}
636
638static inline void stateSetPositionNed_i(uint16_t id, struct NedCoor_i *ned_pos)
639{
641
643 /* clear bits for all position representations and only set the new one */
644 state.pos_status = (1 << POS_NED_I);
645}
646
648static inline void stateSetPositionEnu_i(uint16_t id, struct EnuCoor_i *enu_pos)
649{
651
653 /* clear bits for all position representations and only set the new one */
654 state.pos_status = (1 << POS_ENU_I);
655}
656
658static inline void stateSetPositionLla_i(uint16_t id, struct LlaCoor_i *lla_pos)
659{
661
662 LLA_COPY(state.lla_pos_i, *lla_pos);
663 /* clear bits for all position representations and only set the new one */
664 state.pos_status = (1 << POS_LLA_I);
665}
666
668static inline void stateSetPosition_i(
669 uint16_t id,
670 struct EcefCoor_i *ecef_pos,
671 struct NedCoor_i *ned_pos,
672 struct EnuCoor_i *enu_pos,
673 struct LlaCoor_i *lla_pos)
674{
676
677 /* clear all status bit */
678 state.pos_status = 0;
679 if (ecef_pos != NULL) {
680 VECT3_COPY(state.ecef_pos_i, *ecef_pos);
681 state.pos_status |= (1 << POS_ECEF_I);
682 }
683 if (ned_pos != NULL) {
685 state.pos_status |= (1 << POS_NED_I);
686 }
687 if (enu_pos != NULL) {
689 state.pos_status |= (1 << POS_ENU_I);
690 }
691 if (lla_pos != NULL) {
692 LLA_COPY(state.lla_pos_i, *lla_pos);
693 state.pos_status |= (1 << POS_LLA_I);
694 }
695}
696
698static inline void stateSetPositionUtm_f(uint16_t id, struct UtmCoor_f *utm_pos)
699{
701
702 state.utm_pos_f = *utm_pos;
703 /* clear bits for all position representations and only set the new one */
704 state.pos_status = (1 << POS_UTM_F);
705}
706
708static inline void stateSetPositionEcef_f(uint16_t id, struct EcefCoor_f *ecef_pos)
709{
711
712 VECT3_COPY(state.ecef_pos_f, *ecef_pos);
713 /* clear bits for all position representations and only set the new one */
714 state.pos_status = (1 << POS_ECEF_F);
715}
716
718static inline void stateSetPositionNed_f(uint16_t id, struct NedCoor_f *ned_pos)
719{
721
723 /* clear bits for all position representations and only set the new one */
724 state.pos_status = (1 << POS_NED_F);
725}
726
728static inline void stateSetPositionEnu_f(uint16_t id, struct EnuCoor_f *enu_pos)
729{
731
733 /* clear bits for all position representations and only set the new one */
734 state.pos_status = (1 << POS_ENU_F);
735}
736
738static inline void stateSetPositionLla_f(uint16_t id, struct LlaCoor_f *lla_pos)
739{
741
742 LLA_COPY(state.lla_pos_f, *lla_pos);
743 /* clear bits for all position representations and only set the new one */
744 state.pos_status = (1 << POS_LLA_F);
745}
746
748static inline void stateSetPosition_f(
749 uint16_t id,
750 struct EcefCoor_f *ecef_pos,
751 struct NedCoor_f *ned_pos,
752 struct EnuCoor_f *enu_pos,
753 struct LlaCoor_f *lla_pos,
754 struct UtmCoor_f *utm_pos)
755{
757
758 /* clear all status bit */
759 state.pos_status = 0;
760 if (ecef_pos != NULL) {
761 VECT3_COPY(state.ecef_pos_f, *ecef_pos);
762 state.pos_status |= (1 << POS_ECEF_F);
763 }
764 if (ned_pos != NULL) {
766 state.pos_status |= (1 << POS_NED_F);
767 }
768 if (enu_pos != NULL) {
770 state.pos_status |= (1 << POS_ENU_F);
771 }
772 if (lla_pos != NULL) {
773 LLA_COPY(state.lla_pos_f, *lla_pos);
774 state.pos_status |= (1 << POS_LLA_F);
775 }
776 if (utm_pos != NULL) {
777 state.utm_pos_f = *utm_pos;
778 state.pos_status |= (1 << POS_UTM_F);
779 }
780}
781
782/************************ Get functions ****************************/
783
785static inline struct EcefCoor_i *stateGetPositionEcef_i(void)
786{
789 }
790 return &state.ecef_pos_i;
791}
792
794static inline struct NedCoor_i *stateGetPositionNed_i(void)
795{
798 }
799 return &state.ned_pos_i;
800}
801
803static inline struct EnuCoor_i *stateGetPositionEnu_i(void)
804{
807 }
808 return &state.enu_pos_i;
809}
810
812static inline struct LlaCoor_i *stateGetPositionLla_i(void)
813{
816 }
817 return &state.lla_pos_i;
818}
819
821static inline struct UtmCoor_f *stateGetPositionUtm_f(void)
822{
825 }
826 return &state.utm_pos_f;
827}
828
830static inline struct EcefCoor_f *stateGetPositionEcef_f(void)
831{
834 }
835 return &state.ecef_pos_f;
836}
837
839static inline struct NedCoor_f *stateGetPositionNed_f(void)
840{
843 }
844 return &state.ned_pos_f;
845}
846
848static inline struct EnuCoor_f *stateGetPositionEnu_f(void)
849{
852 }
853 return &state.enu_pos_f;
854}
855
857static inline struct LlaCoor_f *stateGetPositionLla_f(void)
858{
861 }
862 return &state.lla_pos_f;
863}
864
869/******************************************************************************
870 * *
871 * Set and Get functions for the SPEED representations *
872 * *
873 *****************************************************************************/
877/************* declaration of transformation functions ************/
878extern void stateCalcSpeedNed_i(void);
879extern void stateCalcSpeedEnu_i(void);
880extern void stateCalcSpeedEcef_i(void);
881extern void stateCalcHorizontalSpeedNorm_i(void);
882extern void stateCalcHorizontalSpeedDir_i(void);
883extern void stateCalcSpeedNed_f(void);
884extern void stateCalcSpeedEnu_f(void);
885extern void stateCalcSpeedEcef_f(void);
886extern void stateCalcHorizontalSpeedNorm_f(void);
887extern void stateCalcHorizontalSpeedDir_f(void);
888
889/************************ Set functions ****************************/
890
892static inline void stateSetSpeedNed_i(uint16_t id, struct NedCoor_i *ned_speed)
893{
895
897 /* clear bits for all speed representations and only set the new one */
899}
900
902static inline void stateSetSpeedEnu_i(uint16_t id, struct EnuCoor_i *enu_speed)
903{
905
907 /* clear bits for all speed representations and only set the new one */
909}
910
912static inline void stateSetSpeedEcef_i(uint16_t id, struct EcefCoor_i *ecef_speed)
913{
915
917 /* clear bits for all speed representations and only set the new one */
919}
920
922static inline void stateSetSpeed_i(
923 uint16_t id,
924 struct EcefCoor_i *ecef_speed,
925 struct NedCoor_i *ned_speed,
926 struct EnuCoor_i *enu_speed)
927{
929
930 /* clear all status bit */
932 if (ecef_speed != NULL) {
935 }
936 if (ned_speed != NULL) {
939 }
940 if (enu_speed != NULL) {
943 }
944}
945
947static inline void stateSetSpeedNed_f(uint16_t id, struct NedCoor_f *ned_speed)
948{
950
952 /* clear bits for all speed representations and only set the new one */
954}
955
957static inline void stateSetSpeedEnu_f(uint16_t id, struct EnuCoor_f *enu_speed)
958{
960
962 /* clear bits for all speed representations and only set the new one */
964}
965
967static inline void stateSetSpeedEcef_f(uint16_t id, struct EcefCoor_f *ecef_speed)
968{
970
972 /* clear bits for all speed representations and only set the new one */
974}
975
977static inline void stateSetSpeed_f(
978 uint16_t id,
979 struct EcefCoor_f *ecef_speed,
980 struct NedCoor_f *ned_speed,
981 struct EnuCoor_f *enu_speed)
982{
984
985 /* clear all status bit */
987 if (ecef_speed != NULL) {
990 }
991 if (ned_speed != NULL) {
994 }
995 if (enu_speed != NULL) {
998 }
999}
1000
1001/************************ Get functions ****************************/
1002
1004static inline struct NedCoor_i *stateGetSpeedNed_i(void)
1005{
1008 }
1009 return &state.ned_speed_i;
1010}
1011
1013static inline struct EnuCoor_i *stateGetSpeedEnu_i(void)
1014{
1017 }
1018 return &state.enu_speed_i;
1019}
1020
1022static inline struct EcefCoor_i *stateGetSpeedEcef_i(void)
1023{
1026 }
1027 return &state.ecef_speed_i;
1028}
1029
1038
1041{
1044 }
1045 return state.h_speed_dir_i;
1046}
1047
1049static inline struct NedCoor_f *stateGetSpeedNed_f(void)
1050{
1053 }
1054 return &state.ned_speed_f;
1055}
1056
1058static inline struct EnuCoor_f *stateGetSpeedEnu_f(void)
1059{
1062 }
1063 return &state.enu_speed_f;
1064}
1065
1067static inline struct EcefCoor_f *stateGetSpeedEcef_f(void)
1068{
1071 }
1072 return &state.ecef_speed_f;
1073}
1074
1076static inline float stateGetHorizontalSpeedNorm_f(void)
1077{
1080 }
1081 return state.h_speed_norm_f;
1082}
1083
1085static inline float stateGetHorizontalSpeedDir_f(void)
1086{
1089 }
1090 return state.h_speed_dir_f;
1091}
1092
1094static inline struct Int32Vect3 *stateGetAccelBody_i(void)
1095{
1096 return &state.body_accel_i;
1097}
1102/******************************************************************************
1103 * *
1104 * Set and Get functions for the ACCELERATION representations *
1105 * *
1106 *****************************************************************************/
1110/************* declaration of transformation functions ************/
1111extern void stateCalcAccelNed_i(void);
1112extern void stateCalcAccelEcef_i(void);
1113extern void stateCalcAccelNed_f(void);
1114extern void stateCalcAccelEcef_f(void);
1115
1116/*********************** validity test functions ******************/
1117
1119static inline bool stateIsAccelValid(void)
1120{
1121 return (state.accel_status);
1122}
1123
1124/************************ Set functions ****************************/
1125
1127static inline void stateSetAccelNed_i(uint16_t id, struct NedCoor_i *ned_accel)
1128{
1130
1132 /* clear bits for all accel representations and only set the new one */
1134}
1135
1137static inline void stateSetAccelEcef_i(uint16_t id, struct EcefCoor_i *ecef_accel)
1138{
1140
1142 /* clear bits for all accel representations and only set the new one */
1144}
1145
1147static inline void stateSetAccelNed_f(uint16_t id, struct NedCoor_f *ned_accel)
1148{
1150
1152 /* clear bits for all accel representations and only set the new one */
1154}
1155
1157static inline void stateSetAccelEcef_f(uint16_t id, struct EcefCoor_f *ecef_accel)
1158{
1160
1162 /* clear bits for all accel representations and only set the new one */
1164}
1165
1167static inline void stateSetAccelBody_i(uint16_t id, struct Int32Vect3 *body_accel)
1168{
1170
1171 VECT3_COPY(state.body_accel_i, *body_accel);
1172}
1173
1174/************************ Get functions ****************************/
1175
1177static inline struct NedCoor_i *stateGetAccelNed_i(void)
1178{
1181 }
1182 return &state.ned_accel_i;
1183}
1184
1186static inline struct EcefCoor_i *stateGetAccelEcef_i(void)
1187{
1190 }
1191 return &state.ecef_accel_i;
1192}
1193
1195static inline struct NedCoor_f *stateGetAccelNed_f(void)
1196{
1199 }
1200 return &state.ned_accel_f;
1201}
1202
1204static inline struct EcefCoor_f *stateGetAccelEcef_f(void)
1205{
1208 }
1209 return &state.ecef_accel_f;
1210}
1213/******************************************************************************
1214* *
1215* Set and Get functions for the ATTITUDE representations *
1216* (Calls the functions in math/pprz_orientation_conversion) *
1217* *
1218*****************************************************************************/
1221/*********************** validity test functions ******************/
1222
1224static inline bool stateIsAttitudeValid(void)
1225{
1227}
1228
1229/************************ Set functions ****************************/
1230
1237
1244
1251
1258
1265
1272
1273/************************ Get functions ****************************/
1274
1276static inline struct Int32Quat *stateGetNedToBodyQuat_i(void)
1277{
1279}
1280
1282static inline struct Int32RMat *stateGetNedToBodyRMat_i(void)
1283{
1285}
1286
1292
1294static inline struct FloatQuat *stateGetNedToBodyQuat_f(void)
1295{
1297}
1298
1300static inline struct FloatRMat *stateGetNedToBodyRMat_f(void)
1301{
1303}
1304
1313/******************************************************************************
1314 * *
1315 * Set and Get functions for the ANGULAR RATE representations *
1316 * *
1317 *****************************************************************************/
1321/************* declaration of transformation functions ************/
1322extern void stateCalcBodyRates_i(void);
1323extern void stateCalcBodyRates_f(void);
1324
1325/*********************** validity test functions ******************/
1326
1328static inline bool stateIsRateValid(void)
1329{
1330 return (state.rate_status);
1331}
1332
1333/************************ Set functions ****************************/
1334
1336static inline void stateSetBodyRates_i(uint16_t id, struct Int32Rates *body_rate)
1337{
1339
1340 RATES_COPY(state.body_rates_i, *body_rate);
1341 /* clear bits for all attitude representations and only set the new one */
1342 state.rate_status = (1 << RATE_I);
1343}
1344
1346static inline void stateSetBodyRates_f(uint16_t id, struct FloatRates *body_rate)
1347{
1349
1350 RATES_COPY(state.body_rates_f, *body_rate);
1351 /* clear bits for all attitude representations and only set the new one */
1352 state.rate_status = (1 << RATE_F);
1353}
1354
1355/************************ Get functions ****************************/
1356
1358static inline struct Int32Rates *stateGetBodyRates_i(void)
1359{
1362 }
1363 return &state.body_rates_i;
1364}
1365
1367static inline struct FloatRates *stateGetBodyRates_f(void)
1368{
1371 }
1372 return &state.body_rates_f;
1373}
1374
1379/******************************************************************************
1380 * *
1381 * Set and Get functions for the WIND- AND AIRSPEED representations *
1382 * *
1383 *****************************************************************************/
1387/************* declaration of transformation functions ************/
1388extern void stateCalcHorizontalWindspeed_i(void);
1389extern void stateCalcVerticalWindspeed_i(void);
1390extern void stateCalcAirspeed_i(void);
1391extern void stateCalcHorizontalWindspeed_f(void);
1392extern void stateCalcVerticalWindspeed_f(void);
1393extern void stateCalcAirspeed_f(void);
1394
1395
1396/************************ validity test function *******************/
1397
1399static inline bool stateIsWindspeedValid(void)
1400{
1401 return (state.wind_air_status &= ~((1 << WINDSPEED_I) | (1 << WINDSPEED_F)));
1402}
1403
1405static inline bool stateIsVerticalWindspeedValid(void)
1406{
1407 return (state.wind_air_status &= ~((1 << DOWNWIND_I) | (1 << DOWNWIND_F)));
1408}
1409
1411static inline bool stateIsAirspeedValid(void)
1412{
1413 return (state.wind_air_status &= ~((1 << AIRSPEED_I) | (1 << AIRSPEED_F)));
1414}
1415
1417static inline bool stateIsAngleOfAttackValid(void)
1418{
1419 return (state.wind_air_status &= ~(1 << AOA_F));
1420}
1421
1423static inline bool stateIsSideslipValid(void)
1424{
1425 return (state.wind_air_status &= ~(1 << SIDESLIP_F));
1426}
1427
1428/************************ Set functions ****************************/
1429
1432{
1434
1436 /* clear bits for all horizontal windspeed representations and only set the new one */
1439}
1440
1443{
1445
1446 state.windspeed_i.vect3.z = v_windspeed;
1447 /* clear bits for all vertical windspeed representations and only set the new one */
1450}
1451
1453static inline void stateSetAirspeed_i(uint16_t id, int32_t airspeed)
1454{
1456
1457 state.airspeed_i = airspeed;
1458 /* clear bits for all airspeed representations and only set the new one */
1461}
1462
1465{
1467
1469 /* clear bits for all horizontal windspeed representations and only set the new one */
1472}
1473
1476{
1478
1479 state.windspeed_f.vect3.z = v_windspeed;
1480 /* clear bits for all vertical windspeed representations and only set the new one */
1483}
1484
1486static inline void stateSetAirspeed_f(uint16_t id, float airspeed)
1487{
1489
1490 state.airspeed_f = airspeed;
1491 /* clear bits for all airspeed representations and only set the new one */
1494}
1495
1497static inline void stateSetAngleOfAttack_f(uint16_t id, float aoa)
1498{
1500
1502 /* clear bits for all AOA representations and only set the new one */
1505}
1506
1508static inline void stateSetSideslip_f(uint16_t id, float sideslip)
1509{
1511
1512 state.sideslip_f = sideslip;
1513 /* clear bits for all sideslip representations and only set the new one */
1516}
1517
1518/************************ Get functions ****************************/
1519
1522{
1525 }
1526 return &state.windspeed_i.vect2;
1527}
1528
1530static inline float stateGetVerticalWindspeed_i(void)
1531{
1534 }
1535 return state.windspeed_i.vect3.z;
1536}
1537
1539static inline struct Int32Vect3 *stateGetWindspeed_i(void)
1540{
1543 }
1546 }
1547 return &state.windspeed_i.vect3;
1548}
1549
1551static inline int32_t stateGetAirspeed_i(void)
1552{
1555 }
1556 return state.airspeed_i;
1557}
1558
1561{
1564 }
1565 return &state.windspeed_f.vect2;
1566}
1567
1569static inline float stateGetVerticalWindspeed_f(void)
1570{
1573 }
1574 return state.windspeed_f.vect3.z;
1575}
1576
1578static inline struct FloatVect3 *stateGetWindspeed_f(void)
1579{
1582 }
1585 }
1586 return &state.windspeed_f.vect3;
1587}
1588
1590static inline float stateGetAirspeed_f(void)
1591{
1594 }
1595 return state.airspeed_f;
1596}
1597
1599static inline float stateGetAngleOfAttack_f(void)
1600{
1602// if (!bit_is_set(state.wind_air_status, AOA_F))
1603// stateCalcAOA_f();
1604 return state.angle_of_attack_f;
1605}
1606
1608static inline float stateGetSideslip_f(void)
1609{
1611// if (!bit_is_set(state.wind_air_status, SIDESLIP_F))
1612// stateCalcSideslip_f();
1613 return state.sideslip_f;
1614}
1615
1620#ifdef __cplusplus
1621} /* extern "C" */
1622#endif
1623
1624
1625#endif /* STATE_H */
euler angles
Roation quaternion.
rotation matrix
angular rates
#define RATES_COPY(_a, _b)
#define VECT2_COPY(_a, _b)
#define VECT3_COPY(_a, _b)
euler angles
Rotation quaternion.
rotation matrix
angular rates
#define LLA_COPY(_pos1, _pos2)
struct Int32RMat ltp_of_ecef
Rotation matrix.
int32_t hmsl
Height above mean sea level in mm.
struct LlaCoor_i lla
Reference point in lla.
struct EcefCoor_i ecef
Reference point in ecef.
#define ECEF_FLOAT_OF_BFP(_o, _i)
#define HIGH_RES_RMAT_FLOAT_OF_BFP(_ef, _ei)
#define LLA_FLOAT_OF_BFP(_o, _i)
#define M_OF_MM(_mm)
vector in EarthCenteredEarthFixed coordinates
vector in East North Up coordinates
vector in Latitude, Longitude and Altitude
definition of the local (flat earth) coordinate system
vector in North East Down coordinates
static void orientationSetRMat_f(struct OrientationReps *orientation, struct FloatRMat *rmat)
Set vehicle body attitude from rotation matrix (float).
static void orientationSetQuat_f(struct OrientationReps *orientation, struct FloatQuat *quat)
Set vehicle body attitude from quaternion (float).
static struct Int32Eulers * orientationGetEulers_i(struct OrientationReps *orientation)
Get vehicle body attitude euler angles (int).
static bool orienationCheckValid(struct OrientationReps *orientation)
Test if orientations are valid.
static void orientationSetEulers_f(struct OrientationReps *orientation, struct FloatEulers *eulers)
Set vehicle body attitude from euler angles (float).
static struct FloatRMat * orientationGetRMat_f(struct OrientationReps *orientation)
Get vehicle body attitude rotation matrix (float).
static void orientationSetQuat_i(struct OrientationReps *orientation, struct Int32Quat *quat)
Set vehicle body attitude from quaternion (int).
static struct FloatQuat * orientationGetQuat_f(struct OrientationReps *orientation)
Get vehicle body attitude quaternion (float).
static void orientationSetEulers_i(struct OrientationReps *orientation, struct Int32Eulers *eulers)
Set vehicle body attitude from euler angles (int).
static struct Int32Quat * orientationGetQuat_i(struct OrientationReps *orientation)
Get vehicle body attitude quaternion (int).
static void orientationSetRMat_i(struct OrientationReps *orientation, struct Int32RMat *rmat)
Set vehicle body attitude from rotation matrix (int).
static struct Int32RMat * orientationGetRMat_i(struct OrientationReps *orientation)
Get vehicle body attitude rotation matrix (int).
static struct FloatEulers * orientationGetEulers_f(struct OrientationReps *orientation)
Get vehicle body attitude euler angles (float).
#define ACCEL_ECEF_I
Definition state.h:106
static void stateSetAccelNed_i(uint16_t id, struct NedCoor_i *ned_accel)
Set acceleration in NED coordinates (int).
Definition state.h:1127
struct EcefCoor_f ecef_accel_f
Acceleration in EarthCenteredEarthFixed coordinates.
Definition state.h:400
struct Int32Vect3 body_accel_i
Acceleration in Body coordinates.
Definition state.h:376
static struct EcefCoor_i * stateGetAccelEcef_i(void)
Get acceleration in ECEF coordinates (int).
Definition state.h:1186
struct NedCoor_i ned_accel_i
Acceleration in North East Down coordinates.
Definition state.h:382
#define ACCEL_NED_F
Definition state.h:109
static struct EcefCoor_f * stateGetAccelEcef_f(void)
Get acceleration in ECEF coordinates (float).
Definition state.h:1204
uint8_t accel_status
Holds the status bits for all acceleration representations.
Definition state.h:365
void stateCalcAccelNed_i(void)
Definition state.c:1217
void stateCalcAccelEcef_i(void)
Definition state.c:1250
struct EcefCoor_i ecef_accel_i
Acceleration in EarthCenteredEarthFixed coordinates.
Definition state.h:388
static void stateSetAccelEcef_f(uint16_t id, struct EcefCoor_f *ecef_accel)
Set acceleration in ECEF coordinates (float).
Definition state.h:1157
static bool stateIsAccelValid(void)
Test if accelerations are valid.
Definition state.h:1119
#define ACCEL_ECEF_F
Definition state.h:108
void stateCalcAccelEcef_f(void)
Definition state.c:1315
uint16_t accel_input_filter
Holds the input filter id for acceleration.
Definition state.h:370
static void stateSetAccelNed_f(uint16_t id, struct NedCoor_f *ned_accel)
Set acceleration in NED coordinates (float).
Definition state.h:1147
static void stateSetAccelEcef_i(uint16_t id, struct EcefCoor_i *ecef_accel)
Set acceleration in ECEF coordinates (int).
Definition state.h:1137
struct NedCoor_f ned_accel_f
Acceleration in North East Down coordinates.
Definition state.h:394
#define ACCEL_NED_I
Definition state.h:107
static void stateSetAccelBody_i(uint16_t id, struct Int32Vect3 *body_accel)
Set acceleration in Body coordinates (int).
Definition state.h:1167
void stateCalcAccelNed_f(void)
Definition state.c:1282
static struct NedCoor_f * stateGetAccelNed_f(void)
Get acceleration in NED coordinates (float).
Definition state.h:1195
static struct NedCoor_i * stateGetAccelNed_i(void)
Get acceleration in NED coordinates (int).
Definition state.h:1177
static struct Int32Quat * stateGetNedToBodyQuat_i(void)
Get vehicle body attitude quaternion (int).
Definition state.h:1276
static struct FloatRMat * stateGetNedToBodyRMat_f(void)
Get vehicle body attitude rotation matrix (float).
Definition state.h:1300
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
Definition state.h:1288
static void stateSetNedToBodyQuat_f(uint16_t id, struct FloatQuat *ned_to_body_quat)
Set vehicle body attitude from quaternion (float).
Definition state.h:1253
static void stateSetNedToBodyQuat_i(uint16_t id, struct Int32Quat *ned_to_body_quat)
Set vehicle body attitude from quaternion (int).
Definition state.h:1232
static struct Int32RMat * stateGetNedToBodyRMat_i(void)
Get vehicle body attitude rotation matrix (int).
Definition state.h:1282
static bool stateIsAttitudeValid(void)
Test if attitudes are valid.
Definition state.h:1224
static void stateSetNedToBodyEulers_f(uint16_t id, struct FloatEulers *ned_to_body_eulers)
Set vehicle body attitude from euler angles (float).
Definition state.h:1267
static void stateSetNedToBodyEulers_i(uint16_t id, struct Int32Eulers *ned_to_body_eulers)
Set vehicle body attitude from euler angles (int).
Definition state.h:1246
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
Definition state.h:1306
static struct FloatQuat * stateGetNedToBodyQuat_f(void)
Get vehicle body attitude quaternion (float).
Definition state.h:1294
static void stateSetNedToBodyRMat_f(uint16_t id, struct FloatRMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (float).
Definition state.h:1260
static void stateSetNedToBodyRMat_i(uint16_t id, struct Int32RMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (int).
Definition state.h:1239
uint16_t attitude_input_filter
Holds the input filter id for attitude.
Definition state.h:411
struct OrientationReps ned_to_body_orientation
Definition state.h:406
#define STATE_CHECK_INPUT_AND_RETURN(flag, id)
Helper macro to check input filter and return if not valid input id.
Definition state.h:513
void stateSetInputFilter(uint8_t type, uint16_t flag)
set the input filter for a specified type of data.
Definition state.c:85
struct State state
Definition state.c:36
void stateInit(void)
Definition state.c:57
Structure holding vehicle state data.
Definition state.h:152
#define POS_LLA_F
Definition state.h:79
struct NedCoor_i ned_pos_i
Position in North East Down coordinates.
Definition state.h:206
#define POS_UTM_F
Definition state.h:80
static void stateSetPositionLla_f(uint16_t id, struct LlaCoor_f *lla_pos)
Set position from LLA coordinates (float).
Definition state.h:738
static struct LlaCoor_f * stateGetPositionLla_f(void)
Get position in LLA coordinates (float).
Definition state.h:857
static struct LtpDef_f * stateGetNedOrigin_f(void)
Get the coordinate NED frame origin (float)
Definition state.h:566
static void stateSetPositionNed_f(uint16_t id, struct NedCoor_f *ned_pos)
Set position from local NED coordinates (float).
Definition state.h:718
#define POS_LLA_I
Definition state.h:74
struct NedCoor_f ned_pos_f
Position in North East Down coordinates.
Definition state.h:271
#define POS_ENU_F
Definition state.h:78
struct EnuCoor_f enu_pos_f
Position in East North Up coordinates.
Definition state.h:278
#define POS_ECEF_F
Definition state.h:76
struct UtmCoor_f utm_pos_f
Position in UTM coordinates.
Definition state.h:220
static struct EcefCoor_i * stateGetPositionEcef_i(void)
Get position in ECEF coordinates (int).
Definition state.h:785
static void stateSetLocalOrigin_i(uint16_t id, struct LtpDef_i *ltp_def)
Set the local (flat earth) coordinate frame origin (int).
Definition state.h:519
static struct NedCoor_i * stateGetPositionNed_i(void)
Get position in local NED coordinates (int).
Definition state.h:794
void stateCalcPositionNed_f(void)
Definition state.c:582
static void stateSetPositionEnu_i(uint16_t id, struct EnuCoor_i *enu_pos)
Set position from local ENU coordinates (int).
Definition state.h:648
static void stateSetPosition_f(uint16_t id, struct EcefCoor_f *ecef_pos, struct NedCoor_f *ned_pos, struct EnuCoor_f *enu_pos, struct LlaCoor_f *lla_pos, struct UtmCoor_f *utm_pos)
Set multiple position coordinates (float).
Definition state.h:748
struct LtpDef_f ned_origin_f
Definition of the local (flat earth) coordinate system.
Definition state.h:248
struct LtpDef_i ned_origin_i
Definition of the local (flat earth) coordinate system.
Definition state.h:194
bool ned_initialized_f
True if local float coordinate frame is initialsed.
Definition state.h:251
struct EcefCoor_f stateGetEcefOrigin_f(void)
Get the ECEF position of the frame origin (float)
Definition state.c:175
uint16_t pos_status
Holds the status bits for all position representations.
Definition state.h:167
struct LlaCoor_i lla_pos_i
Position in Latitude, Longitude and Altitude.
Definition state.h:185
void stateCalcPositionUtm_f(void)
Definition state.c:514
static void stateSetPositionEnu_f(uint16_t id, struct EnuCoor_f *enu_pos)
Set position from local ENU coordinates (float).
Definition state.h:728
static struct LlaCoor_i * stateGetPositionLla_i(void)
Get position in LLA coordinates (int).
Definition state.h:812
void stateCalcPositionEnu_f(void)
Definition state.c:649
struct EcefCoor_f ecef_pos_f
Position in EarthCenteredEarthFixed coordinates.
Definition state.h:239
static void stateSetPositionUtm_f(uint16_t id, struct UtmCoor_f *utm_pos)
Set position from UTM coordinates (float).
Definition state.h:698
bool utm_initialized_f
True if utm origin (float) coordinate frame is initialsed.
Definition state.h:264
#define POS_ENU_I
Definition state.h:73
uint16_t origin_input_filter
Holds the input filter id for state origin.
Definition state.h:160
#define POS_ECEF_I
Definition state.h:71
static struct UtmCoor_f * stateGetUtmOrigin_f(void)
Get the coordinate UTM frame origin (int)
Definition state.h:576
#define POS_GLOBAL_COORD
Definition state.h:82
void stateCalcPositionEcef_f(void)
Definition state.c:551
#define POS_LOCAL_COORD
Definition state.h:81
struct EnuCoor_i enu_pos_i
Position in East North Up coordinates.
Definition state.h:213
bool ned_initialized_i
true if local int coordinate frame is initialsed
Definition state.h:199
static void stateSetPositionEcef_f(uint16_t id, struct EcefCoor_f *ecef_pos)
Set position from ECEF coordinates (float).
Definition state.h:708
static struct EnuCoor_i * stateGetPositionEnu_i(void)
Get position in local ENU coordinates (int).
Definition state.h:803
#define POS_NED_F
Definition state.h:77
static bool stateIsGlobalCoordinateValid(void)
Test if global coordinates are valid.
Definition state.h:620
float alt_agl_f
Altitude above ground level.
Definition state.h:226
void stateCalcPositionLla_f(void)
Definition state.c:722
static struct EcefCoor_f * stateGetPositionEcef_f(void)
Get position in ECEF coordinates (float).
Definition state.h:830
int32_t stateGetHmslOrigin_i(void)
Get the HMSL of the frame origin (int)
Definition state.c:190
static void stateSetLocalUtmOrigin_f(uint16_t id, struct UtmCoor_f *utm_def)
Set the local (flat earth) coordinate frame origin from UTM (float).
Definition state.h:541
void stateCalcPositionEcef_i(void)
Definition state.c:217
static void stateSetPositionEcef_i(uint16_t id, struct EcefCoor_i *ecef_pos)
Set position from ECEF coordinates (int).
Definition state.h:628
float stateGetHmslOrigin_f(void)
Get the HMSL of the frame origin (float)
Definition state.c:204
struct UtmCoor_f utm_origin_f
Definition of the origin of Utm coordinate system.
Definition state.h:261
struct LlaCoor_i stateGetLlaOrigin_i(void)
Get the LLA position of the frame origin (int)
Definition state.c:124
void stateCalcPositionNed_i(void)
Definition state.c:249
void stateCalcPositionLla_i(void)
Calculate LLA (int) from any other available representation.
Definition state.c:416
static bool stateIsLocalCoordinateValid(void)
Test if local coordinates are valid.
Definition state.h:613
struct LlaCoor_f stateGetLlaOrigin_f(void)
Get the LLA position of the frame origin (float)
Definition state.c:143
static struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
Definition state.h:821
static void stateSetPositionLla_i(uint16_t id, struct LlaCoor_i *lla_pos)
Set position from LLA coordinates (int).
Definition state.h:658
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
Definition state.h:848
static struct LtpDef_i * stateGetNedOrigin_i(void)
Get the coordinate NED frame origin (int)
Definition state.h:556
struct LlaCoor_f lla_pos_f
Position in Latitude, Longitude and Altitude.
Definition state.h:233
static void stateSetPosition_i(uint16_t id, struct EcefCoor_i *ecef_pos, struct NedCoor_i *ned_pos, struct EnuCoor_i *enu_pos, struct LlaCoor_i *lla_pos)
Set multiple position coordinates (int).
Definition state.h:668
uint16_t pos_input_filter
Holds the input filter id for position.
Definition state.h:172
struct EcefCoor_i ecef_pos_i
Position in EarthCenteredEarthFixed coordinates.
Definition state.h:178
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
Definition state.h:839
#define POS_NED_I
Definition state.h:72
static void stateSetPositionNed_i(uint16_t id, struct NedCoor_i *ned_pos)
Set position from local NED coordinates (int).
Definition state.h:638
struct EcefCoor_i stateGetEcefOrigin_i(void)
Get the ECEF position of the frame origin (int)
Definition state.c:160
void stateCalcPositionEnu_i(void)
Definition state.c:329
uint16_t rates_input_filter
Holds the input filter id for rates.
Definition state.h:426
static void stateSetBodyRates_i(uint16_t id, struct Int32Rates *body_rate)
Set vehicle body angular rate (int).
Definition state.h:1336
void stateCalcBodyRates_f(void)
Definition state.c:1371
#define RATE_F
Definition state.h:117
struct FloatRates body_rates_f
Angular rates in body frame.
Definition state.h:438
#define RATE_I
Definition state.h:116
static struct Int32Rates * stateGetBodyRates_i(void)
Get vehicle body angular rate (int).
Definition state.h:1358
void stateCalcBodyRates_i(void)
Definition state.c:1356
static void stateSetBodyRates_f(uint16_t id, struct FloatRates *body_rate)
Set vehicle body angular rate (float).
Definition state.h:1346
struct Int32Rates body_rates_i
Angular rates in body frame.
Definition state.h:432
uint8_t rate_status
Holds the status bits for all angular rate representations.
Definition state.h:421
static struct FloatRates * stateGetBodyRates_f(void)
Get vehicle body angular rate (float).
Definition state.h:1367
static bool stateIsRateValid(void)
Test if rates are valid.
Definition state.h:1328
#define SPEED_ENU_F
Definition state.h:96
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
Definition state.h:1076
static void stateSetSpeedEcef_f(uint16_t id, struct EcefCoor_f *ecef_speed)
Set ground speed in ECEF coordinates (float).
Definition state.h:967
#define SPEED_ENU_I
Definition state.h:91
static void stateSetSpeedNed_f(uint16_t id, struct NedCoor_f *ned_speed)
Set ground speed in local NED coordinates (float).
Definition state.h:947
static struct NedCoor_f * stateGetSpeedNed_f(void)
Get ground speed in local NED coordinates (float).
Definition state.h:1049
void stateCalcSpeedEnu_f(void)
Definition state.c:1077
struct NedCoor_f ned_speed_f
speed in North East Down coordinates
Definition state.h:336
static void stateSetSpeedNed_i(uint16_t id, struct NedCoor_i *ned_speed)
Set ground speed in local NED coordinates (int).
Definition state.h:892
static void stateSetSpeedEcef_i(uint16_t id, struct EcefCoor_i *ecef_speed)
Set ground speed in ECEF coordinates (int).
Definition state.h:912
#define SPEED_ECEF_F
Definition state.h:94
static struct NedCoor_i * stateGetSpeedNed_i(void)
Get ground speed in local NED coordinates (int).
Definition state.h:1004
void stateCalcSpeedNed_f(void)
Definition state.c:1027
uint16_t speed_input_filter
Holds the input filter id for speed.
Definition state.h:294
static struct Int32Vect3 * stateGetAccelBody_i(void)
Get acceleration in Body coordinates (int).
Definition state.h:1094
static void stateSetSpeed_f(uint16_t id, struct EcefCoor_f *ecef_speed, struct NedCoor_f *ned_speed, struct EnuCoor_f *enu_speed)
Set multiple speed coordinates (float).
Definition state.h:977
#define SPEED_ECEF_I
Definition state.h:89
static void stateSetSpeedEnu_f(uint16_t id, struct EnuCoor_f *enu_speed)
Set ground speed in local ENU coordinates (float).
Definition state.h:957
void stateCalcHorizontalSpeedDir_i(void)
Definition state.c:996
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
Definition state.h:1085
#define SPEED_NED_F
Definition state.h:95
struct NedCoor_i ned_speed_i
Velocity in North East Down coordinates.
Definition state.h:306
float h_speed_norm_f
Norm of horizontal ground speed.
Definition state.h:348
int32_t h_speed_dir_i
Direction of horizontal ground speed.
Definition state.h:325
float h_speed_dir_f
Direction of horizontal ground speed.
Definition state.h:354
void stateCalcHorizontalSpeedNorm_f(void)
Definition state.c:1152
void stateCalcHorizontalSpeedNorm_i(void)
Definition state.c:950
#define SPEED_LOCAL_COORD
Definition state.h:99
static int32_t stateGetHorizontalSpeedDir_i(void)
Get dir of horizontal ground speed (int).
Definition state.h:1040
struct EcefCoor_f ecef_speed_f
Velocity in EarthCenteredEarthFixed coordinates.
Definition state.h:331
static struct EcefCoor_f * stateGetSpeedEcef_f(void)
Get ground speed in ECEF coordinates (float).
Definition state.h:1067
void stateCalcSpeedEcef_f(void)
Definition state.c:1127
#define SPEED_HDIR_I
Definition state.h:93
void stateCalcSpeedEnu_i(void)
Definition state.c:873
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
Definition state.h:1058
#define SPEED_HNORM_F
Definition state.h:97
#define SPEED_NED_I
Definition state.h:90
struct EcefCoor_i ecef_speed_i
Velocity in EarthCenteredEarthFixed coordinates.
Definition state.h:300
void stateCalcHorizontalSpeedDir_f(void)
Definition state.c:1179
struct EnuCoor_i enu_speed_i
Velocity in East North Up coordinates.
Definition state.h:312
static struct EcefCoor_i * stateGetSpeedEcef_i(void)
Get ground speed in ECEF coordinates (int).
Definition state.h:1022
uint16_t speed_status
Holds the status bits for all ground speed representations.
Definition state.h:289
static void stateSetSpeedEnu_i(uint16_t id, struct EnuCoor_i *enu_speed)
Set ground speed in local ENU coordinates (int).
Definition state.h:902
static void stateSetSpeed_i(uint16_t id, struct EcefCoor_i *ecef_speed, struct NedCoor_i *ned_speed, struct EnuCoor_i *enu_speed)
Set multiple speed coordinates (int).
Definition state.h:922
void stateCalcSpeedNed_i(void)
Definition state.c:823
#define SPEED_HNORM_I
Definition state.h:92
static struct EnuCoor_i * stateGetSpeedEnu_i(void)
Get ground speed in local ENU coordinates (int).
Definition state.h:1013
uint32_t h_speed_norm_i
Norm of horizontal ground speed.
Definition state.h:318
static uint32_t stateGetHorizontalSpeedNorm_i(void)
Get norm of horizontal ground speed (int).
Definition state.h:1031
#define SPEED_HDIR_F
Definition state.h:98
struct EnuCoor_f enu_speed_f
Velocity in East North Up coordinates.
Definition state.h:342
void stateCalcSpeedEcef_i(void)
Definition state.c:925
static bool stateIsSideslipValid(void)
test if sideslip is available.
Definition state.h:1423
static void stateSetAngleOfAttack_f(uint16_t id, float aoa)
Set angle of attack in radians (float).
Definition state.h:1497
#define WINDSPEED_I
Definition state.h:124
static bool stateIsWindspeedValid(void)
test if wind speed is available.
Definition state.h:1399
static void stateSetSideslip_f(uint16_t id, float sideslip)
Set sideslip angle in radians (float).
Definition state.h:1508
int32_t airspeed_i
Norm of relative wind speed.
Definition state.h:469
#define DOWNWIND_F
Definition state.h:128
static float stateGetSideslip_f(void)
Get sideslip (float).
Definition state.h:1608
union State::@356 windspeed_f
Horizontal windspeed.
#define WINDSPEED_F
Definition state.h:127
float airspeed_f
Norm of relative air speed.
Definition state.h:484
static void stateSetVerticalWindspeed_f(uint16_t id, float v_windspeed)
Set vertical windspeed (float).
Definition state.h:1475
static bool stateIsAirspeedValid(void)
test if air speed is available.
Definition state.h:1411
uint8_t wind_air_status
Holds the status bits for all wind- and airspeed representations.
Definition state.h:449
#define AIRSPEED_I
Definition state.h:126
static void stateSetVerticalWindspeed_i(uint16_t id, int32_t v_windspeed)
Set vertical windspeed (int).
Definition state.h:1442
static struct FloatVect3 * stateGetWindspeed_f(void)
Get windspeed (float).
Definition state.h:1578
#define SIDESLIP_F
Definition state.h:131
static void stateSetAirspeed_i(uint16_t id, int32_t airspeed)
Set airspeed (int).
Definition state.h:1453
void stateCalcAirspeed_i(void)
Definition state.c:1428
static void stateSetHorizontalWindspeed_i(uint16_t id, struct Int32Vect2 *h_windspeed)
Set horizontal windspeed (int).
Definition state.h:1431
void stateCalcVerticalWindspeed_i(void)
Definition state.c:1413
static float stateGetAirspeed_f(void)
Get airspeed (float).
Definition state.h:1590
static struct FloatVect2 * stateGetHorizontalWindspeed_f(void)
Get horizontal windspeed (float).
Definition state.h:1560
static struct Int32Vect2 * stateGetHorizontalWindspeed_i(void)
Get horizontal windspeed (int).
Definition state.h:1521
static float stateGetVerticalWindspeed_i(void)
Get vertical windspeed (int).
Definition state.h:1530
static float stateGetAngleOfAttack_f(void)
Get angle of attack (float).
Definition state.h:1599
void stateCalcAirspeed_f(void)
Definition state.c:1474
#define AIRSPEED_F
Definition state.h:129
float sideslip_f
Sideslip angle Unit: rad.
Definition state.h:496
uint16_t wind_air_input_filter
Holds the input filter id for air data.
Definition state.h:454
void stateCalcHorizontalWindspeed_f(void)
Definition state.c:1443
static float stateGetVerticalWindspeed_f(void)
Get vertical windspeed (float).
Definition state.h:1569
static int32_t stateGetAirspeed_i(void)
Get airspeed (int).
Definition state.h:1551
static struct Int32Vect3 * stateGetWindspeed_i(void)
Get windspeed (int).
Definition state.h:1539
static void stateSetHorizontalWindspeed_f(uint16_t id, struct FloatVect2 *h_windspeed)
Set horizontal windspeed (float).
Definition state.h:1464
void stateCalcHorizontalWindspeed_i(void)
Definition state.c:1397
float angle_of_attack_f
Angle of attack Unit: rad.
Definition state.h:490
union State::@355 windspeed_i
Horizontal windspeed in north/east/down.
#define AOA_F
Definition state.h:130
static bool stateIsAngleOfAttackValid(void)
test if angle of attack is available.
Definition state.h:1417
#define DOWNWIND_I
Definition state.h:125
static void stateSetAirspeed_f(uint16_t id, float airspeed)
Set airspeed (float).
Definition state.h:1486
void stateCalcVerticalWindspeed_f(void)
Definition state.c:1459
static bool stateIsVerticalWindspeedValid(void)
test if vertical wind speed is available.
Definition state.h:1405
uint16_t foo
Definition main_demo5.c:58
Paparazzi floating point algebra.
Paparazzi fixed point algebra.
Paparazzi floating point math for geodetic calculations.
float hmsl
Height above mean sea level in meters.
struct FloatRMat ltp_of_ecef
rotation from ECEF to local frame
struct EcefCoor_f ecef
origin of local frame in ECEF
struct LlaCoor_f lla
origin of local frame in LLA
vector in EarthCenteredEarthFixed coordinates
vector in East North Up coordinates Units: meters
vector in Latitude, Longitude and Altitude
definition of the local (flat earth) coordinate system
vector in North East Down coordinates Units: meters
position in UTM coordinates Units: meters
Paparazzi fixed point math for geodetic calculations.
Generic orientation representation and conversions.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
int int32_t
Typedef defining 32 bit int type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.