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.c
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 
26 
27 #include "generated/airframe.h"
28 #include "generated/flight_plan.h"
29 
30 // Flightplan Variables
31 #ifndef PHOTOGRAMMETRY_SWEEP_ANGLE
32 #define PHOTOGRAMMETRY_SWEEP_ANGLE 0
33 #endif
34 
35 #ifndef PHOTOGRAMMETRY_OVERLAP
36 #define PHOTOGRAMMETRY_OVERLAP 50
37 #endif
38 
39 #ifndef PHOTOGRAMMETRY_SIDELAP
40 #define PHOTOGRAMMETRY_SIDELAP 50
41 #endif
42 
43 
44 // Flightplan Paramters
45 float photogrammetry_sweep_angle = 0; // in rad
46 
50 
51 // Photogrammetry Goals
52 int photogrammetry_sidelap; // Percent 0 - 100
53 int photogrammetry_overlap; // Percent 0 - 100
54 int photogrammetry_resolution; // Millimeter per pixel
55 
56 // Safety Aspects
60 
61 
63 {
65 
68  photogrammetry_resolution = PHOTOGRAMMETRY_RESOLUTION;
69 
70  photogrammetry_height_min = PHOTOGRAMMETRY_HEIGHT_MIN;
71  photogrammetry_height_max = PHOTOGRAMMETRY_HEIGHT_MAX;
72  photogrammetry_radius_min = PHOTOGRAMMETRY_RADIUS_MIN;
73 
75 }
76 
78 {
79 
80  // Photogrammetry Goals
81  float photogrammetry_sidelap_f = ((float) photogrammetry_sidelap) / 100.0f;
82  float photogrammetry_overlap_f = ((float) photogrammetry_overlap) / 100.0f;
83 
84  // Linear Projection Camera Model
85  float viewing_ratio_height = ((float) PHOTOGRAMMETRY_SENSOR_HEIGHT) / ((float)PHOTOGRAMMETRY_FOCAL_LENGTH);
86  float viewing_ratio_width = ((float) PHOTOGRAMMETRY_SENSOR_WIDTH) / ((float)PHOTOGRAMMETRY_FOCAL_LENGTH);
87  float pixel_projection_width = viewing_ratio_width / ((float)PHOTOGRAMMETRY_PIXELS_WIDTH);
88 
89  // Flightplan Variables
90  photogrammetry_height = ((float) photogrammetry_resolution) / pixel_projection_width / 1000.0f;
91 
96 
97  photogrammetry_sidestep = viewing_ratio_width * photogrammetry_height * (1.0f - photogrammetry_sidelap_f);
98  photogrammetry_triggerstep = viewing_ratio_height * photogrammetry_height * (1.0f - photogrammetry_overlap_f);
99 }
100 
101 
int photogrammetry_radius_min
#define PHOTOGRAMMETRY_SIDELAP
int photogrammetry_height_max
#define PHOTOGRAMMETRY_OVERLAP
int photogrammetry_height_min
int photogrammetry_resolution
void photogrammetry_calculator_update(void)
#define PHOTOGRAMMETRY_SWEEP_ANGLE
void init_photogrammetry_calculator(void)
int photogrammetry_sidestep
int photogrammetry_overlap
float photogrammetry_sweep_angle
int photogrammetry_height
int photogrammetry_triggerstep
Add to airframe file:
int photogrammetry_sidelap