5 * Created by Frederic D'HAEYER on 14/01/10.
6 * Copyright 2010 Parrot SA. All rights reserved.
9 #ifndef _CONTROLDATA_H_
10 #define _CONTROLDATA_H_
11 #include "ConstantsAndMacros.h"
13 #define SMALL_STRING_SIZE 16
14 #define MEDIUM_STRING_SIZE 64
16 typedef enum _EMERGENCY_STATE_
18 EMERGENCY_STATE_EMERGENCY,
22 typedef enum _CONFIG_STATE_
26 CONFIG_STATE_IN_PROGRESS,
32 * Current navdata_connected
34 bool_t navdata_connected;
37 * Progressive commands
38 * And accelerometers values transmitted to drone, FALSE otherwise
40 float yaw, gaz, accelero_phi, accelero_theta;
41 int32_t accelero_flag;
44 * variable to know if setting is needed
46 EMERGENCY_STATE isInEmergency;
48 bool_t wifiReachabled;
51 bool_t needSetEmergency;
52 bool_t needSetTakeOff;
57 char needAnimationParam[SMALL_STRING_SIZE];
59 bool_t needLedAnimation;
60 char needLedAnimationParam[SMALL_STRING_SIZE];
62 CONFIG_STATE applicationDefaultConfigState;
63 CONFIG_STATE configurationState;
66 * Strings to display in interface
68 char error_msg[MEDIUM_STRING_SIZE];
69 char takeoff_msg[SMALL_STRING_SIZE];
70 char emergency_msg[SMALL_STRING_SIZE];
73 void initControlData(void);
74 void resetControlData(void);
75 void initNavdataControlData(void);
76 void checkErrors(void);
77 void controlfps(void);
78 void sendControls(void);
79 void configuration_get(void);
80 void setApplicationDefaultConfig(void);
81 void switchTakeOff(void);
83 void handleAccelerometers(void);
84 void disableAccelerometers(void);
85 void inputYaw(float percent);
86 void inputGaz(float percent);
87 void inputPitch(float percent);
88 void inputRoll(float percent);
89 void signal_input(int new_input);
90 void send_inputs(void);
91 #endif // _CONTROLDATA_H_