Paparazzi UAS  v5.10_stable-5-g83a0da5-dirty
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
navdata.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 The Paparazzi Team
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 
21 /* Thanks to TU Delft by assigning students Dino Hensen, Vincent van Hoek */
22 
33 #ifndef NAVDATA_H_
34 #define NAVDATA_H_
35 
36 #include "std.h"
37 #include <unistd.h>
38 
46 
50 
56 
58 
63 
67 
69 
70  uint32_t sum_echo; //unsigned long
72 
74 
77 
81 
83 
84 } __attribute__((packed));
85 
86 /* The baro calibration received from the navboard */
99 
100  // These values are calculated
102 };
103 
104 /* Navdata board defines */
105 #define NAVDATA_PACKET_SIZE 60
106 #define NAVDATA_START_BYTE 0x3A
107 #define NAVDATA_CMD_START 0x01
108 #define NAVDATA_CMD_STOP 0x02
109 #define NAVDATA_CMD_BARO_CALIB 0x17
110 
111 #define ARDRONE_GPIO_PORT 0x32524
112 #define ARDRONE_GPIO_PIN_NAVDATA 177
113 
114 /* Main navdata structure */
115 struct navdata_t {
117  int fd;
118 
124 
127 
130  bool imu_lost;
131 };
132 extern struct navdata_t navdata;
133 
134 
135 bool navdata_init(void);
136 void navdata_update(void);
137 int16_t navdata_height(void);
138 
139 /* FIXME: This should be moved to the uart handling part! */
140 ssize_t full_write(int fd, const uint8_t *buf, size_t count);
141 ssize_t full_read(int fd, uint8_t *buf, size_t count);
142 
143 #endif /* NAVDATA_H_ */
unsigned short uint16_t
Definition: types.h:16
unsigned long uint32_t
Definition: types.h:18
signed short int16_t
Definition: types.h:17
signed long int32_t
Definition: types.h:19
unsigned char uint8_t
Definition: types.h:14
int fd
Definition: serial.c:26