Paparazzi UAS  v4.2.2_stable-4-gcc32f65
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 
104 
105 // Update Flightplan on Camera Change
106 #define photogrammetry_calculator_UpdateSideLap(X) { \
107  photogrammetry_sidelap = X; \
108  photogrammetry_calculator_update_camera2flightplan(); \
109 }
110 
111 #define photogrammetry_calculator_UpdateOverLap(X) { \
112  photogrammetry_overlap = X; \
113  photogrammetry_calculator_update_camera2flightplan(); \
114 }
115 
116 #define photogrammetry_calculator_UpdateResolution(X) { \
117  photogrammetry_resolution = X; \
118  photogrammetry_calculator_update_camera2flightplan(); \
119 }
120 
121 // Update Camera on Flightplan Change
122 #define photogrammetry_calculator_UpdateHeight(X) { \
123  photogrammetry_height = X; \
124  photogrammetry_calculator_update_flightplan2camera(); \
125 }
126 
127 #define photogrammetry_calculator_UpdateSideStep(X) { \
128  photogrammetry_sidestep = X; \
129  photogrammetry_calculator_update_flightplan2camera(); \
130 }
131 
132 #define photogrammetry_calculator_UpdateTriggerStep(X) { \
133  photogrammetry_triggerstep = X; \
134  photogrammetry_calculator_update_flightplan2camera(); \
135 }
136 
137 
138 // Flightplan Routine Wrappers
139 #define PhotogrammetryCalculatorPolygonSurvey(_WP, _COUNT) { \
140  WaypointAlt(_WP) = photogrammetry_height + GROUND_ALT; \
141  int _ang = 90 - DegOfRad(photogrammetry_sweep_angle); \
142  if (_ang > 90) _ang -= 180; if (_ang < -90) _ang += 180; \
143  InitializePolygonSurvey((_WP), (_COUNT), 2*photogrammetry_sidestep, _ang); \
144 }
145 
146 #define PhotogrammetryCalculatorPolygonSurveyADV(_WP, _COUNT) { \
147  init_poly_survey_adv((_WP), (_COUNT), DegOfRad(photogrammetry_sweep_angle), \
148  photogrammetry_sidestep, photogrammetry_triggerstep, \
149  photogrammetry_radius_min, photogrammetry_height + GROUND_ALT); \
150 }
151 
152 #endif
void init_photogrammetry_calculator(void)
int photogrammetry_height_min
int photogrammetry_resolution
int photogrammetry_radius_min
int photogrammetry_sidelap
int photogrammetry_sidestep
int photogrammetry_overlap
void photogrammetry_calculator_update_camera2flightplan(void)
int photogrammetry_height
int photogrammetry_triggerstep
void photogrammetry_calculator_update_flightplan2camera(void)
int photogrammetry_height_max
float photogrammetry_sweep_angle