-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
zamboni_survey.h
76 lines (67 loc) · 2.42 KB
/
zamboni_survey.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Copyright (C) 2013 Jorn Anke, Felix Ruess
*
* This file is part of paparazzi.
*
* paparazzi is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* paparazzi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with paparazzi; see the file COPYING. If not, write to
* the Free Software Foundation, 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
/**
* @file modules/nav/zamboni_survey.h
*
* Zamboni pattern survey for fixedwings.
*/
#ifndef ZAMBONI_SURVEY_H
#define ZAMBONI_SURVEY_H
#include "std.h"
#include "math/pprz_algebra_float.h"
typedef enum {Z_ERR, Z_ENTRY, Z_SEG, Z_TURN1, Z_RET, Z_TURN2} z_survey_stage;
struct ZamboniSurvey {
/* variables used to store values from the flight plan */
struct FloatVect2 wp_center;
struct FloatVect2 wp_dir;
struct FloatVect2 sweep_width;
float altitude;
/** in degrees. Leave turncircles a small angle before the 180deg turns are completed
* to get a smoother transition to flight-lines
*/
int pre_leave_angle;
float flight_angle; ///< in degrees
float return_angle; ///< in degrees
int current_laps;
int total_laps;
float turnradius1;
float turnradius2;
struct FloatVect2 turn_center1;
struct FloatVect2 turn_center2;
struct FloatVect2 seg_start;
struct FloatVect2 seg_end;
struct FloatVect2 ret_start;
struct FloatVect2 ret_end;
/**
* z_stage starts at ENTRY and than circles trought the other
* states until to rectangle is completely covered
* ENTRY : getting in the right position and height for the first flyover
* SEG : fly from seg_start to seg_end and take pictures,
* then calculate navigation points of next flyover
* TURN1 : do a 180° turn around seg_center1
* RET : fly from ret_start to ret_end
* TURN2 : do a 180° turn around seg_center2
*/
z_survey_stage stage;
};
extern bool_t init_zamboni_survey(uint8_t center_wp, uint8_t dir_wp, float sweep_length, float sweep_spacing, int sweep_lines, float altitude);
extern bool_t zamboni_survey(void);
#endif //ZAMBONI_SURVEY_H