Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
nav_cube.h
Go to the documentation of this file.
1 /*
2  * $Id: nav_cube.h 1936 2007-10-23 12:12:38Z hecto $
3  *
4  * Copyright (C) 2010 Martin Mueller
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  *
23  */
24 
25 #ifndef NAV_CUBE_H
26 #define NAV_CUBE_H
27 
28 #include "std.h"
29 
30 #define MAX_LINES_X 8
31 #define STBY_OFFSET 500
32 
33 extern bool_t nav_cube_init(uint8_t turb, uint8_t tb, uint8_t te);
34 bool_t nav_cube(int8_t j, int8_t i,
35  uint8_t dest_b, uint8_t dest_e,
36  uint8_t src_b, uint8_t src_e);
37 
38 extern int32_t cube_alpha; /* angle of flight direction to north, clockwise */
39 extern int32_t cube_size_x; /* size of the cube x (perpendicular to flight dir) */
40 extern int32_t cube_size_y; /* size of the cube y (in flight dir) */
41 extern int32_t cube_size_z; /* height of the cube z */
42 extern int32_t cube_grid_x; /* grid distance x (horizontal) */
43 extern int32_t cube_grid_z; /* grid distance z (vertical) */
44 extern int32_t cube_offs_x; /* offset to center x (horizontal) */
45 extern int32_t cube_offs_y; /* offset to center y (in direction) */
46 extern int32_t cube_offs_z; /* offset to center z (vertical) */
47 
48 extern int32_t cube_sect; /* sector to fly in (1..[nsect_x*nsect_z]) */
49 extern int32_t cube_nsect_x; /* number of sectors horizontal */
50 extern int32_t cube_nsect_z; /* number of sectors vertical */
51 
52 extern int32_t cube_nline_x; /* number of lines x (horizontal) */
53 extern int32_t cube_nline_z; /* number of lines z (vertical) */
54 
55 #define nav_cube_SetAlpha(i) { cube_alpha=i; }
56 #define nav_cube_SetSect(i) { cube_sect=i; }
57 #define nav_cube_SetGridX(i) { cube_grid_x=i; }
58 #define nav_cube_SetGridZ(i) { cube_grid_z=i; }
59 #define nav_cube_SetSizeX(i) { cube_size_x=i; }
60 #define nav_cube_SetSizeY(i) { cube_size_y=i; }
61 #define nav_cube_SetSizeZ(i) { cube_size_z=i; }
62 #define nav_cube_SetOffsX(i) { cube_offs_x=i; }
63 #define nav_cube_SetOffsY(i) { cube_offs_y=i; }
64 #define nav_cube_SetOffsZ(i) { cube_offs_z=i; }
65 #define nav_cube_SetNSectX(i) { cube_nsect_x=i; }
66 #define nav_cube_SetNSectZ(i) { cube_nsect_z=i; }
67 
68 /*
69 
70  from above:
71 
72  | (offs_x)
73 
74  o [x, y] -
75  |
76  | (offs_y)
77  |
78  -
79  ^ ^ ^ ^ ^ |
80  | | | | | |
81  | | | | | | (size_y)
82  | | | | | |
83  | | | | | |
84  -
85  |--|
86  (grid_x)
87 
88  |-----------|
89  (size_x)
90 
91 
92  side view:
93 
94  ---------> - -
95  | (grid_z) |
96  ---------> - |
97  - | (size_z)
98  ---------> | (offs_z) |
99  o [alt] - |
100  ---------> -
101 
102  |----------|--------|
103  (size_y) (offs_y)
104 
105 
106  back view, 1x1 sector:
107 
108  -------
109  | |
110  | 1 | ^
111  | | |
112  s------- |
113 
114  ---->
115 
116 
117  back view, 3x2 sectors:
118 
119  ------- ------- -------
120  | | | |
121  | 4 | 5 | 6 | ^
122  | | | | |
123  s-------s-------s------- |
124  | | | |
125  | 1 | 2 | 3 | ^
126  | | | | |
127  s-------s-------s------- | (nsect_z)
128 
129  ----> ----> ---->
130  (nsect_x)
131 
132 */
133 
134 #endif /* NAV_CUBE_H */
signed long int32_t
Definition: types.h:19
unsigned char uint8_t
Definition: types.h:14
signed char int8_t
Definition: types.h:15