ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ControlEngine / iPhone / Classes / ControlData.h
1 /*
2  *  ControlData.h
3  *  ARDroneEngine
4  *
5  *  Created by Frederic D'HAEYER on 14/01/10.
6  *  Copyright 2010 Parrot SA. All rights reserved.
7  *
8  */
9 #ifndef _CONTROLDATA_H_
10 #define _CONTROLDATA_H_
11 #include "ConstantsAndMacros.h"
12
13 #define SMALL_STRING_SIZE       16
14 #define MEDIUM_STRING_SIZE      64
15
16 typedef enum _EMERGENCY_STATE_
17 {
18         EMERGENCY_STATE_EMERGENCY,
19         EMERGENCY_STATE_RESET
20 } EMERGENCY_STATE;
21
22 typedef enum _CONFIG_STATE_
23 {
24         CONFIG_STATE_IDLE,
25         CONFIG_STATE_NEEDED,
26         CONFIG_STATE_IN_PROGRESS,
27 } CONFIG_STATE; 
28
29 typedef struct
30 {
31         /**
32          * Current navdata_connected
33          */
34         bool_t navdata_connected;
35         
36         /**
37          * Progressive commands
38          * And accelerometers values transmitted to drone, FALSE otherwise
39          */
40         float yaw, gaz, accelero_phi, accelero_theta;
41         int32_t accelero_flag;
42         
43         /**
44          * variable to know if setting is needed
45          */
46         EMERGENCY_STATE isInEmergency;
47         
48         bool_t wifiReachabled;
49         
50         int framecounter;
51         bool_t needSetEmergency;
52         bool_t needSetTakeOff;
53         
54         int needVideoSwitch;
55
56         bool_t needAnimation;
57         char needAnimationParam[SMALL_STRING_SIZE];
58         
59         bool_t needLedAnimation;
60         char needLedAnimationParam[SMALL_STRING_SIZE];
61         
62         CONFIG_STATE applicationDefaultConfigState;
63         CONFIG_STATE configurationState;
64         
65         /**
66          * Strings to display in interface
67          */     
68         char error_msg[MEDIUM_STRING_SIZE];
69         char takeoff_msg[SMALL_STRING_SIZE];
70         char emergency_msg[SMALL_STRING_SIZE];
71 } ControlData;
72
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);
82 void emergency(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_