Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
nav_cube.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 Martin Mueller
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, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
29 #ifndef NAV_CUBE_H
30 #define NAV_CUBE_H
31 
32 #include "std.h"
33 
34 #define MAX_LINES_X 8
35 #define STBY_OFFSET 500
36 
37 extern bool_t nav_cube_init(uint8_t turb, uint8_t tb, uint8_t te);
38 bool_t nav_cube(int8_t j, int8_t i,
39  uint8_t dest_b, uint8_t dest_e,
40  uint8_t src_b, uint8_t src_e);
41 
42 extern int32_t cube_alpha;
43 extern int32_t cube_size_x;
44 extern int32_t cube_size_y;
45 extern int32_t cube_size_z;
46 extern int32_t cube_grid_x;
47 extern int32_t cube_grid_z;
48 extern int32_t cube_offs_x;
49 extern int32_t cube_offs_y;
50 extern int32_t cube_offs_z;
51 
52 extern int32_t cube_sect;
53 extern int32_t cube_nsect_x;
54 extern int32_t cube_nsect_z;
55 
56 extern int32_t cube_nline_x;
57 extern int32_t cube_nline_z;
58 
59 #define nav_cube_SetAlpha(i) { cube_alpha=i; }
60 #define nav_cube_SetSect(i) { cube_sect=i; }
61 #define nav_cube_SetGridX(i) { cube_grid_x=i; }
62 #define nav_cube_SetGridZ(i) { cube_grid_z=i; }
63 #define nav_cube_SetSizeX(i) { cube_size_x=i; }
64 #define nav_cube_SetSizeY(i) { cube_size_y=i; }
65 #define nav_cube_SetSizeZ(i) { cube_size_z=i; }
66 #define nav_cube_SetOffsX(i) { cube_offs_x=i; }
67 #define nav_cube_SetOffsY(i) { cube_offs_y=i; }
68 #define nav_cube_SetOffsZ(i) { cube_offs_z=i; }
69 #define nav_cube_SetNSectX(i) { cube_nsect_x=i; }
70 #define nav_cube_SetNSectZ(i) { cube_nsect_z=i; }
71 
72 /*
73 
74  from above:
75 
76  | (offs_x)
77 
78  o [x, y] -
79  |
80  | (offs_y)
81  |
82  -
83  ^ ^ ^ ^ ^ |
84  | | | | | |
85  | | | | | | (size_y)
86  | | | | | |
87  | | | | | |
88  -
89  |--|
90  (grid_x)
91 
92  |-----------|
93  (size_x)
94 
95 
96  side view:
97 
98  ---------> - -
99  | (grid_z) |
100  ---------> - |
101  - | (size_z)
102  ---------> | (offs_z) |
103  o [alt] - |
104  ---------> -
105 
106  |----------|--------|
107  (size_y) (offs_y)
108 
109 
110  back view, 1x1 sector:
111 
112  -------
113  | |
114  | 1 | ^
115  | | |
116  s------- |
117 
118  ---->
119 
120 
121  back view, 3x2 sectors:
122 
123  ------- ------- -------
124  | | | |
125  | 4 | 5 | 6 | ^
126  | | | | |
127  s-------s-------s------- |
128  | | | |
129  | 1 | 2 | 3 | ^
130  | | | | |
131  s-------s-------s------- | (nsect_z)
132 
133  ----> ----> ---->
134  (nsect_x)
135 
136 */
137 
138 #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