ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / Examples / Android / ardrone / project / jni / navdata.h
1 #ifndef _NAVDATA_H_
2 #define _NAVDATA_H_
3
4 #include <ardrone_api.h>
5 #include <VP_Os/vp_os_types.h>
6
7 typedef struct _instance_navdata_t 
8 {
9                 uint32_t ardrone_state;
10                 bool_t flyingState;             /// Tells whether ARDrone is flying or not
11                 bool_t commandState;            /// ???
12                 bool_t comWatchdog;             /// Tells if we are loosing communication with ARDrone
13                 /// Be aware that at startup, comWatchdog is set to 1 because no input reach the drone yet
14                 bool_t emergencyLanding;        /// Tells ARDrone landed because of a serious reason
15                 bool_t timerElapsed;        /// Tells ARDrone can take off again
16                 bool_t startPressed;            /// Start button state by ARDrone
17                 bool_t bootstrap;                       /// mykonos is starting
18                 
19                 unsigned int remainingBattery; /// Remaining battery in mV
20                 
21                 float pitch;                    /// cabrement en radians (nez vers le bas negatif)
22                 float roll;                             /// roulis en radians (pencher a gauche = negatif)
23                 float yaw;                              /// lacet en radians (tourner vers la gauche = negatif)
24                 
25                 float trimPitch;                        /// trim on pitch
26                 float trimRoll;                         /// trim on roll
27                 float trimYaw;                          /// trim on yaw
28                 
29                 float vx;                               // Horizontal velocity on x-axis
30                 float vy;                               // Horizontal velocity on y-axis
31                 float vz;                               // Horizontal velocity on y-axis
32                 
33                 float altitude;                 /// altitude en m
34                 
35                 int nbDetectedOpponent; /// Does we see an opponent?
36                 int     xOpponent[4];                   /// Position (in screen space) of the opponent
37                 int yOpponent[4];
38                 int     widthOpponent[4];                       /// Position (in screen space) of the opponent
39                 int heightOpponent[4];  
40                 int distOpponent[4];            /// Distance from the opponent
41                 
42                 // Video num frames
43                 int videoNumFrames;
44                 
45                 // Camera parameters compute by detection
46                 float detectCameraRot[3][3];
47                 float detectCameraHomo[3][3];
48                 float detectCameraTrans[3];
49                 int       detectTagIndex;
50                 
51                 // Type of detection
52                 int   detectionType;
53
54                 // Camera parameters compute by drone
55                 float droneCameraRot[3][3];
56                 float droneCameraTrans[3];
57                 
58                 bool_t cutoutProblem;
59                 bool_t cameraProblem;
60                 bool_t adcVersionProblem;
61                 bool_t adcProblem;
62                 bool_t ultrasoundProblem;
63                 bool_t visionProblem;
64                 bool_t anglesProblem;
65                 bool_t vbatLowProblem;
66                 bool_t motorsProblem;
67                 bool_t userEmergency;
68                 
69                 bool_t videoThreadOn;
70                 bool_t navdataThreadOn;
71 } instance_navdata_t;
72 C_RESULT ardrone_navdata_reset_data(instance_navdata_t *nav);
73 C_RESULT ardrone_navdata_get_data(instance_navdata_t *data);
74 C_RESULT ardrone_navdata_write_to_file(bool_t enable);
75
76 #endif // _NAVDATA_H_