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
poly_survey_adv.c File Reference
#include "poly_survey_adv.h"
#include "subsystems/nav.h"
#include "estimator.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
+ Include dependency graph for poly_survey_adv.c:

Go to the source code of this file.

Macros

#define VEC_CALC(A, B, C, OP)   A.x = B.x OP C.x; A.y = B.y OP C.y;
 

Functions

static point2d vec_add (point2d a, point2d b)
 
static void nav_points (point2d start, point2d end)
 
static bool_t intercept_two_lines (point2d *p, point2d x, point2d y, float a1, float a2, float b1, float b2)
 intercept two lines and give back the point of intersection returns : FALSE if no intersection can be found or intersection does not lie between points a and b else TRUE p : returns intersection x, y : first line is defined by point x and y (goes through this points) a1, a2, b1, b2 : second line by coordinates a1/a2, b1/b2 More...
 
static bool_t get_two_intersects (point2d *x, point2d *y, point2d a, point2d b)
 intersects a line with the polygon and gives back the two intersection points returns : TRUE if two intersection can be found, else FALSE x, y : intersection points a, b : define the line to intersection More...
 
bool_t init_poly_survey_adv (uint8_t first_wp, uint8_t size, float angle, float sweep_width, float shot_dist, float min_rad, float altitude)
 initializes the variables needed for the survey to start first_wp : the first Waypoint of the polygon size : the number of points that make up the polygon angle : angle in which to do the flyovers sweep_width : distance between the sweeps shot_dist : distance between the shots min_rad : minimal radius when navigating altitude : the altitude that must be reached before the flyover starts More...
 
bool_t poly_survey_adv (void)
 main navigation routine. More...
 

Variables

point2d dir_vec
 The following variables are set by poly_survey_init and not changed later on. More...
 
point2d sweep_vec
 
point2d rad_vec
 
uint8_t poly_first
 
uint8_t poly_count
 
float psa_min_rad
 
float psa_sweep_width
 
float psa_shot_dist
 
float psa_altitude
 
int segment_angle
 
int return_angle
 
survey_stage psa_stage
 The Following variables are dynamic, changed while navigating. More...
 
point2d seg_start
 
point2d seg_end
 
point2d seg_center1
 
point2d seg_center2
 
point2d entry_center
 
point2d ret_start
 
point2d ret_end
 

Macro Definition Documentation

#define VEC_CALC (   A,
  B,
  C,
  OP 
)    A.x = B.x OP C.x; A.y = B.y OP C.y;

Definition at line 63 of file poly_survey_adv.c.

Referenced by init_poly_survey_adv(), poly_survey_adv(), and vec_add().

Function Documentation

static bool_t get_two_intersects ( point2d x,
point2d y,
point2d  a,
point2d  b 
)
static

intersects a line with the polygon and gives back the two intersection points returns : TRUE if two intersection can be found, else FALSE x, y : intersection points a, b : define the line to intersection

Definition at line 108 of file poly_survey_adv.c.

References FALSE, intercept_two_lines(), poly_count, poly_first, TRUE, waypoints, point2d::x, and point2d::y.

Referenced by init_poly_survey_adv(), and poly_survey_adv().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool_t init_poly_survey_adv ( uint8_t  first_wp,
uint8_t  size,
float  angle,
float  sweep_width,
float  shot_dist,
float  min_rad,
float  altitude 
)

initializes the variables needed for the survey to start first_wp : the first Waypoint of the polygon size : the number of points that make up the polygon angle : angle in which to do the flyovers sweep_width : distance between the sweeps shot_dist : distance between the shots min_rad : minimal radius when navigating altitude : the altitude that must be reached before the flyover starts

Definition at line 163 of file poly_survey_adv.c.

References ENTRY, ERR, FALSE, get_two_intersects(), NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, poly_count, poly_first, psa_altitude, psa_min_rad, psa_shot_dist, psa_stage, psa_sweep_width, return_angle, segment_angle, VEC_CALC, waypoints, point2d::x, EnuCoor_i::x, point2d::y, and EnuCoor_i::y.

+ Here is the call graph for this function:

static bool_t intercept_two_lines ( point2d p,
point2d  x,
point2d  y,
float  a1,
float  a2,
float  b1,
float  b2 
)
static

intercept two lines and give back the point of intersection returns : FALSE if no intersection can be found or intersection does not lie between points a and b else TRUE p : returns intersection x, y : first line is defined by point x and y (goes through this points) a1, a2, b1, b2 : second line by coordinates a1/a2, b1/b2

Definition at line 86 of file poly_survey_adv.c.

References FALSE, TRUE, point2d::x, and point2d::y.

Referenced by get_two_intersects().

+ Here is the caller graph for this function:

static void nav_points ( point2d  start,
point2d  end 
)
static

Definition at line 73 of file poly_survey_adv.c.

References nav_route_xy(), point2d::x, and point2d::y.

Referenced by poly_survey_adv().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool_t poly_survey_adv ( void  )

main navigation routine.

This is called periodically evaluates the current Position and stage and navigates accordingly. Returns True until the survey is finished

Definition at line 272 of file poly_survey_adv.c.

References dc_stop(), dc_survey(), ENTRY, estimator_z, FALSE, get_two_intersects(), last_x, last_y, nav_approaching_xy(), nav_circle_XY(), nav_init_stage(), nav_points(), NavCourseCloseTo, NavVerticalAutoThrottleMode, psa_altitude, psa_min_rad, psa_shot_dist, psa_stage, psa_sweep_width, RET, return_angle, SEG, segment_angle, TRUE, TURN1, TURN2, vec_add(), VEC_CALC, point2d::x, and point2d::y.

+ Here is the call graph for this function:

static point2d vec_add ( point2d  a,
point2d  b 
)
static

Definition at line 65 of file poly_survey_adv.c.

References VEC_CALC.

Referenced by poly_survey_adv().

+ Here is the caller graph for this function:

Variable Documentation

point2d dir_vec

The following variables are set by poly_survey_init and not changed later on.

Definition at line 18 of file poly_survey_adv.c.

point2d entry_center

Definition at line 57 of file poly_survey_adv.c.

uint8_t poly_count

Definition at line 24 of file poly_survey_adv.c.

Referenced by get_two_intersects(), and init_poly_survey_adv().

uint8_t poly_first

Definition at line 23 of file poly_survey_adv.c.

Referenced by get_two_intersects(), and init_poly_survey_adv().

float psa_altitude

Definition at line 30 of file poly_survey_adv.c.

Referenced by init_poly_survey_adv(), and poly_survey_adv().

float psa_min_rad

Definition at line 27 of file poly_survey_adv.c.

Referenced by init_poly_survey_adv(), and poly_survey_adv().

float psa_shot_dist

Definition at line 29 of file poly_survey_adv.c.

Referenced by init_poly_survey_adv(), and poly_survey_adv().

survey_stage psa_stage

The Following variables are dynamic, changed while navigating.

Definition at line 50 of file poly_survey_adv.c.

Referenced by init_poly_survey_adv(), and poly_survey_adv().

float psa_sweep_width

Definition at line 28 of file poly_survey_adv.c.

Referenced by init_poly_survey_adv(), and poly_survey_adv().

point2d rad_vec

Definition at line 20 of file poly_survey_adv.c.

point2d ret_end

Definition at line 59 of file poly_survey_adv.c.

point2d ret_start

Definition at line 58 of file poly_survey_adv.c.

int return_angle

Definition at line 34 of file poly_survey_adv.c.

Referenced by init_poly_survey_adv(), and poly_survey_adv().

point2d seg_center1

Definition at line 55 of file poly_survey_adv.c.

point2d seg_center2

Definition at line 56 of file poly_survey_adv.c.

point2d seg_end

Definition at line 54 of file poly_survey_adv.c.

point2d seg_start

Definition at line 53 of file poly_survey_adv.c.

int segment_angle

Definition at line 33 of file poly_survey_adv.c.

Referenced by init_poly_survey_adv(), and poly_survey_adv().

point2d sweep_vec

Definition at line 19 of file poly_survey_adv.c.