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
photogrammetry_calculator.h
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 2009 Christophe De Wagter
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 
75 #ifndef PHOTOGRAMMETRY_CALCULATOR_H
76 #define PHOTOGRAMMETRY_CALCULATOR_H
77 
78 #include "std.h"
79 #include "paparazzi.h"
80 
83 
84 
85 // Flightplan Variables
86 extern float photogrammetry_sweep_angle;
87 extern int photogrammetry_sidestep;
89 extern int photogrammetry_height;
90 
91 extern int photogrammetry_height_min;
92 extern int photogrammetry_height_max;
93 extern int photogrammetry_radius_min;
94 
95 
96 // Photogrammetry Goals
97 extern int photogrammetry_sidelap;
98 extern int photogrammetry_overlap;
99 extern int photogrammetry_resolution;
100 
103 
104 // Update Parameters on Settings Change
105 #define photogrammetry_calculator_UpdateSideLap(X) { \
106  photogrammetry_sidelap = X; \
107  photogrammetry_calculator_update(); \
108 }
109 
110 #define photogrammetry_calculator_UpdateOverLap(X) { \
111  photogrammetry_overlap = X; \
112  photogrammetry_calculator_update(); \
113 }
114 
115 #define photogrammetry_calculator_UpdateResolution(X) { \
116  photogrammetry_resolution = X; \
117  photogrammetry_calculator_update(); \
118 }
119 
120 // Flightplan Routine Wrappers
121 #define PhotogrammetryCalculatorPolygonSurvey(_WP, _COUNT) { \
122  WaypointAlt(_WP) = photogrammetry_height + GROUND_ALT; \
123  int _ang = 90 - DegOfRad(photogrammetry_sweep_angle); \
124  if (_ang > 90) _ang -= 180; if (_ang < -90) _ang += 180; \
125  InitializePolygonSurvey((_WP), (_COUNT), 2*photogrammetry_sidestep, _ang); \
126 }
127 
128 #define PhotogrammetryCalculatorPolygonSurveyADV(_WP, _COUNT) { \
129  init_poly_survey_adv((_WP), (_COUNT), DegOfRad(photogrammetry_sweep_angle), \
130  photogrammetry_sidestep, photogrammetry_triggerstep, \
131  photogrammetry_radius_min, photogrammetry_height + GROUND_ALT); \
132 }
133 
134 #endif
void init_photogrammetry_calculator(void)
int photogrammetry_height_min
int photogrammetry_resolution
int photogrammetry_radius_min
int photogrammetry_sidelap
int photogrammetry_sidestep
void photogrammetry_calculator_update(void)
int photogrammetry_overlap
int photogrammetry_height
int photogrammetry_triggerstep
int photogrammetry_height_max
float photogrammetry_sweep_angle