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}
1108
1109
1110/******************************************************************************
1111 * *
1112 * Set and Get functions for the ACCELERATION representations *
1113 * *
1114 *****************************************************************************/
1118/************* declaration of transformation functions ************/
1119extern void stateCalcAccelNed_i(void);
1120extern void stateCalcAccelEcef_i(void);
1121extern void stateCalcAccelNed_f(void);
1122extern void stateCalcAccelEcef_f(void);
1123
1124/*********************** validity test functions ******************/
1125
1127static inline bool stateIsAccelValid(void)
1128{
1129 return (state.accel_status);
1130}
1131
1132/************************ Set functions ****************************/
1133
1135static inline void stateSetAccelNed_i(uint16_t id, struct NedCoor_i *ned_accel)
1136{
1138
1140 /* clear bits for all accel representations and only set the new one */
1142}
1143
1145static inline void stateSetAccelEcef_i(uint16_t id, struct EcefCoor_i *ecef_accel)
1146{
1148
1150 /* clear bits for all accel representations and only set the new one */
1152}
1153
1155static inline void stateSetAccelNed_f(uint16_t id, struct NedCoor_f *ned_accel)
1156{
1158
1160 /* clear bits for all accel representations and only set the new one */
1162}
1163
1165static inline void stateSetAccelEcef_f(uint16_t id, struct EcefCoor_f *ecef_accel)
1166{
1168
1170 /* clear bits for all accel representations and only set the new one */
1172}
1173
1175static inline void stateSetAccelBody_i(uint16_t id, struct Int32Vect3 *body_accel)
1176{
1178
1179 VECT3_COPY(state.body_accel_i, *body_accel);
1180}
1181
1182/************************ Get functions ****************************/
1183
1185static inline struct NedCoor_i *stateGetAccelNed_i(void)
1186{
1189 }
1190 return &state.ned_accel_i;
1191}
1192
1194static inline struct EcefCoor_i *stateGetAccelEcef_i(void)
1195{
1198 }
1199 return &state.ecef_accel_i;
1200}
1201
1203static inline struct NedCoor_f *stateGetAccelNed_f(void)
1204{
1207 }
1208 return &state.ned_accel_f;
1209}
1210
1212static inline struct EcefCoor_f *stateGetAccelEcef_f(void)
1213{
1216 }
1217 return &state.ecef_accel_f;
1218}
1221/******************************************************************************
1222* *
1223* Set and Get functions for the ATTITUDE representations *
1224* (Calls the functions in math/pprz_orientation_conversion) *
1225* *
1226*****************************************************************************/
1229/*********************** validity test functions ******************/
1230
1232static inline bool stateIsAttitudeValid(void)
1233{
1235}
1236
1237/************************ Set functions ****************************/
1238
1245
1252
1259
1266
1273
1280
1281/************************ Get functions ****************************/
1282
1284static inline struct Int32Quat *stateGetNedToBodyQuat_i(void)
1285{
1287}
1288
1290static inline struct Int32RMat *stateGetNedToBodyRMat_i(void)
1291{
1293}
1294
1300
1302static inline struct FloatQuat *stateGetNedToBodyQuat_f(void)
1303{
1305}
1306
1308static inline struct FloatRMat *stateGetNedToBodyRMat_f(void)
1309{
1311}
1312
1321/******************************************************************************
1322 * *
1323 * Set and Get functions for the ANGULAR RATE representations *
1324 * *
1325 *****************************************************************************/
1329/************* declaration of transformation functions ************/
1330extern void stateCalcBodyRates_i(void);
1331extern void stateCalcBodyRates_f(void);
1332
1333/*********************** validity test functions ******************/
1334
1336static inline bool stateIsRateValid(void)
1337{
1338 return (state.rate_status);
1339}
1340
1341/************************ Set functions ****************************/
1342
1344static inline void stateSetBodyRates_i(uint16_t id, struct Int32Rates *body_rate)
1345{
1347
1348 RATES_COPY(state.body_rates_i, *body_rate);
1349 /* clear bits for all attitude representations and only set the new one */
1350 state.rate_status = (1 << RATE_I);
1351}
1352
1354static inline void stateSetBodyRates_f(uint16_t id, struct FloatRates *body_rate)
1355{
1357
1358 RATES_COPY(state.body_rates_f, *body_rate);
1359 /* clear bits for all attitude representations and only set the new one */
1360 state.rate_status = (1 << RATE_F);
1361}
1362
1363/************************ Get functions ****************************/
1364
1366static inline struct Int32Rates *stateGetBodyRates_i(void)
1367{
1370 }
1371 return &state.body_rates_i;
1372}
1373
1375static inline struct FloatRates *stateGetBodyRates_f(void)
1376{
1379 }
1380 return &state.body_rates_f;
1381}
1382
1387/******************************************************************************
1388 * *
1389 * Set and Get functions for the WIND- AND AIRSPEED representations *
1390 * *
1391 *****************************************************************************/
1395/************* declaration of transformation functions ************/
1396extern void stateCalcHorizontalWindspeed_i(void);
1397extern void stateCalcVerticalWindspeed_i(void);
1398extern void stateCalcAirspeed_i(void);
1399extern void stateCalcHorizontalWindspeed_f(void);
1400extern void stateCalcVerticalWindspeed_f(void);
1401extern void stateCalcAirspeed_f(void);
1402
1403
1404/************************ validity test function *******************/
1405
1407static inline bool stateIsWindspeedValid(void)
1408{
1409 return (state.wind_air_status & ((1 << WINDSPEED_I) | (1 << WINDSPEED_F)));
1410}
1411
1413static inline bool stateIsVerticalWindspeedValid(void)
1414{
1415 return (state.wind_air_status & ((1 << DOWNWIND_I) | (1 << DOWNWIND_F)));
1416}
1417
1419static inline bool stateIsAirspeedValid(void)
1420{
1421 return (state.wind_air_status & ((1 << AIRSPEED_I) | (1 << AIRSPEED_F)));
1422}
1423
1425static inline bool stateIsAngleOfAttackValid(void)
1426{
1427 return (state.wind_air_status & (1 << AOA_F));
1428}
1429
1431static inline bool stateIsSideslipValid(void)
1432{
1433 return (state.wind_air_status & (1 << SIDESLIP_F));
1434}
1435
1436/************************ Set functions ****************************/
1437
1440{
1442
1444 /* clear bits for all horizontal windspeed representations and only set the new one */
1447}
1448
1451{
1453
1454 state.windspeed_i.vect3.z = v_windspeed;
1455 /* clear bits for all vertical windspeed representations and only set the new one */
1458}
1459
1461static inline void stateSetAirspeed_i(uint16_t id, int32_t airspeed)
1462{
1464
1465 state.airspeed_i = airspeed;
1466 /* clear bits for all airspeed representations and only set the new one */
1469}
1470
1473{
1475
1477 /* clear bits for all horizontal windspeed representations and only set the new one */
1480}
1481
1484{
1486
1487 state.windspeed_f.vect3.z = v_windspeed;
1488 /* clear bits for all vertical windspeed representations and only set the new one */
1491}
1492
1494static inline void stateSetAirspeed_f(uint16_t id, float airspeed)
1495{
1497
1498 state.airspeed_f = airspeed;
1499 /* clear bits for all airspeed representations and only set the new one */
1502}
1503
1505static inline void stateSetAngleOfAttack_f(uint16_t id, float aoa)
1506{
1508
1510 /* clear bits for all AOA representations and only set the new one */
1513}
1514
1516static inline void stateSetSideslip_f(uint16_t id, float sideslip)
1517{
1519
1520 state.sideslip_f = sideslip;
1521 /* clear bits for all sideslip representations and only set the new one */
1524}
1525
1526/************************ Get functions ****************************/
1527
1530{
1533 }
1534 return &state.windspeed_i.vect2;
1535}
1536
1538static inline float stateGetVerticalWindspeed_i(void)
1539{
1542 }
1543 return state.windspeed_i.vect3.z;
1544}
1545
1547static inline struct Int32Vect3 *stateGetWindspeed_i(void)
1548{
1551 }
1554 }
1555 return &state.windspeed_i.vect3;
1556}
1557
1559static inline int32_t stateGetAirspeed_i(void)
1560{
1563 }
1564 return state.airspeed_i;
1565}
1566
1569{
1572 }
1573 return &state.windspeed_f.vect2;
1574}
1575
1577static inline float stateGetVerticalWindspeed_f(void)
1578{
1581 }
1582 return state.windspeed_f.vect3.z;
1583}
1584
1586static inline struct FloatVect3 *stateGetWindspeed_f(void)
1587{
1590 }
1593 }
1594 return &state.windspeed_f.vect3;
1595}
1596
1598static inline float stateGetAirspeed_f(void)
1599{
1602 }
1603 return state.airspeed_f;
1604}
1605
1607static inline float stateGetAngleOfAttack_f(void)
1608{
1610// if (!bit_is_set(state.wind_air_status, AOA_F))
1611// stateCalcAOA_f();
1612 return state.angle_of_attack_f;
1613}
1614
1616static inline float stateGetSideslip_f(void)
1617{
1619// if (!bit_is_set(state.wind_air_status, SIDESLIP_F))
1620// stateCalcSideslip_f();
1621 return state.sideslip_f;
1622}
1623
1628#ifdef __cplusplus
1629} /* extern "C" */
1630#endif
1631
1632
1633#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)
#define INT32_ACCEL_FRAC
#define FLOAT_OF_BFP(_vbfp, _frac)
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:1135
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:1194
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:1212
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:1165
static bool stateIsAccelValid(void)
Test if accelerations are valid.
Definition state.h:1127
#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:1155
static void stateSetAccelEcef_i(uint16_t id, struct EcefCoor_i *ecef_accel)
Set acceleration in ECEF coordinates (int).
Definition state.h:1145
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:1175
void stateCalcAccelNed_f(void)
Definition state.c:1282
static struct NedCoor_f * stateGetAccelNed_f(void)
Get acceleration in NED coordinates (float).
Definition state.h:1203
static struct NedCoor_i * stateGetAccelNed_i(void)
Get acceleration in NED coordinates (int).
Definition state.h:1185
static struct Int32Quat * stateGetNedToBodyQuat_i(void)
Get vehicle body attitude quaternion (int).
Definition state.h:1284
static struct FloatRMat * stateGetNedToBodyRMat_f(void)
Get vehicle body attitude rotation matrix (float).
Definition state.h:1308
static struct Int32Eulers * stateGetNedToBodyEulers_i(void)
Get vehicle body attitude euler angles (int).
Definition state.h:1296
static void stateSetNedToBodyQuat_f(uint16_t id, struct FloatQuat *ned_to_body_quat)
Set vehicle body attitude from quaternion (float).
Definition state.h:1261
static void stateSetNedToBodyQuat_i(uint16_t id, struct Int32Quat *ned_to_body_quat)
Set vehicle body attitude from quaternion (int).
Definition state.h:1240
static struct Int32RMat * stateGetNedToBodyRMat_i(void)
Get vehicle body attitude rotation matrix (int).
Definition state.h:1290
static bool stateIsAttitudeValid(void)
Test if attitudes are valid.
Definition state.h:1232
static void stateSetNedToBodyEulers_f(uint16_t id, struct FloatEulers *ned_to_body_eulers)
Set vehicle body attitude from euler angles (float).
Definition state.h:1275
static void stateSetNedToBodyEulers_i(uint16_t id, struct Int32Eulers *ned_to_body_eulers)
Set vehicle body attitude from euler angles (int).
Definition state.h:1254
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
Definition state.h:1314
static struct FloatQuat * stateGetNedToBodyQuat_f(void)
Get vehicle body attitude quaternion (float).
Definition state.h:1302
static void stateSetNedToBodyRMat_f(uint16_t id, struct FloatRMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (float).
Definition state.h:1268
static void stateSetNedToBodyRMat_i(uint16_t id, struct Int32RMat *ned_to_body_rmat)
Set vehicle body attitude from rotation matrix (int).
Definition state.h:1247
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
static struct FloatVect3 * stateGetAccelBody_f(void)
Definition state.h:1100
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:1344
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:1366
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:1354
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:1375
static bool stateIsRateValid(void)
Test if rates are valid.
Definition state.h:1336
#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:1431
static void stateSetAngleOfAttack_f(uint16_t id, float aoa)
Set angle of attack in radians (float).
Definition state.h:1505
#define WINDSPEED_I
Definition state.h:124
static bool stateIsWindspeedValid(void)
test if wind speed is available.
Definition state.h:1407
static void stateSetSideslip_f(uint16_t id, float sideslip)
Set sideslip angle in radians (float).
Definition state.h:1516
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:1616
#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:1483
static bool stateIsAirspeedValid(void)
test if air speed is available.
Definition state.h:1419
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:1450
static struct FloatVect3 * stateGetWindspeed_f(void)
Get windspeed (float).
Definition state.h:1586
#define SIDESLIP_F
Definition state.h:131
static void stateSetAirspeed_i(uint16_t id, int32_t airspeed)
Set airspeed (int).
Definition state.h:1461
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:1439
union State::@359 windspeed_i
Horizontal windspeed in north/east/down.
void stateCalcVerticalWindspeed_i(void)
Definition state.c:1413
union State::@360 windspeed_f
Horizontal windspeed.
static float stateGetAirspeed_f(void)
Get airspeed (float).
Definition state.h:1598
static struct FloatVect2 * stateGetHorizontalWindspeed_f(void)
Get horizontal windspeed (float).
Definition state.h:1568
static struct Int32Vect2 * stateGetHorizontalWindspeed_i(void)
Get horizontal windspeed (int).
Definition state.h:1529
static float stateGetVerticalWindspeed_i(void)
Get vertical windspeed (int).
Definition state.h:1538
static float stateGetAngleOfAttack_f(void)
Get angle of attack (float).
Definition state.h:1607
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:1577
static int32_t stateGetAirspeed_i(void)
Get airspeed (int).
Definition state.h:1559
static struct Int32Vect3 * stateGetWindspeed_i(void)
Get windspeed (int).
Definition state.h:1547
static void stateSetHorizontalWindspeed_f(uint16_t id, struct FloatVect2 *h_windspeed)
Set horizontal windspeed (float).
Definition state.h:1472
void stateCalcHorizontalWindspeed_i(void)
Definition state.c:1397
float angle_of_attack_f
Angle of attack Unit: rad.
Definition state.h:490
#define AOA_F
Definition state.h:130
static bool stateIsAngleOfAttackValid(void)
test if angle of attack is available.
Definition state.h:1425
#define DOWNWIND_I
Definition state.h:125
static void stateSetAirspeed_f(uint16_t id, float airspeed)
Set airspeed (float).
Definition state.h:1494
void stateCalcVerticalWindspeed_f(void)
Definition state.c:1459
static bool stateIsVerticalWindspeedValid(void)
test if vertical wind speed is available.
Definition state.h:1413
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.
struct FloatVect3 body_accel_f
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.