Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
nav_survey_polygon_gvf.c File Reference
#include "nav_survey_polygon_gvf.h"
#include "firmwares/fixedwing/nav.h"
#include "state.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
#include "modules/guidance/gvf/gvf.h"
+ Include dependency graph for nav_survey_polygon_gvf.c:

Go to the source code of this file.

Functions

static void gvf_circle_direction (float rad)
 
static bool gvf_intercept_two_lines (struct FloatVect2 *p, struct FloatVect2 x, struct FloatVect2 y, float a1, float a2, float b1, float b2)
 Intercept two lines and give back the point of intersection.
 
static bool gvf_get_two_intersects (struct FloatVect2 *x, struct FloatVect2 *y, struct FloatVect2 a, struct FloatVect2 b)
 Intersects a line with the polygon and gives back the two intersection points.
 
void nav_gvf_survey_polygon_setup (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.
 
bool nav_gvf_survey_polygon_run (void)
 Main navigation routine.
 

Variables

struct gvf_SurveyPolyAdv gvf_survey
 

Function Documentation

◆ gvf_circle_direction()

static void gvf_circle_direction ( float  rad)
static

Definition at line 46 of file nav_survey_polygon_gvf.c.

References gvf_set_direction().

Referenced by nav_gvf_survey_polygon_run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gvf_get_two_intersects()

static bool gvf_get_two_intersects ( struct FloatVect2 x,
struct FloatVect2 y,
struct FloatVect2  a,
struct FloatVect2  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
Parameters
x,yintersection points
a,bdefine the line to intersection

Definition at line 86 of file nav_survey_polygon_gvf.c.

References b, gvf_SurveyPolyAdv::dir_vec, foo, gvf_intercept_two_lines(), gvf_survey, gvf_SurveyPolyAdv::poly_count, gvf_SurveyPolyAdv::poly_first, waypoints, FloatVect2::x, point::x, FloatVect2::y, and point::y.

Referenced by nav_gvf_survey_polygon_run(), and nav_gvf_survey_polygon_setup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ gvf_intercept_two_lines()

static bool gvf_intercept_two_lines ( struct FloatVect2 p,
struct FloatVect2  x,
struct FloatVect2  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
Parameters
preturns intersection
x,yfirst line is defined by point x and y (goes through this points)
a1,a2,b1,b2second line by coordinates a1/a2, b1/b2

Definition at line 63 of file nav_survey_polygon_gvf.c.

References foo, p, FloatVect2::x, and FloatVect2::y.

Referenced by gvf_get_two_intersects().

+ Here is the caller graph for this function:

◆ nav_gvf_survey_polygon_run()

◆ nav_gvf_survey_polygon_setup()

void nav_gvf_survey_polygon_setup ( 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.


Parameters
first_wpthe first Waypoint of the polygon
sizethe number of points that make up the polygon
angleangle in which to do the flyovers
sweep_widthdistance between the sweeps
shot_distdistance between the shots
min_radminimal radius when navigating
altitudethe altitude that must be reached before the flyover starts

Definition at line 145 of file nav_survey_polygon_gvf.c.

References altitude, gvf_SurveyPolyAdv::dir_vec, gvf_SurveyPolyAdv::entry_center, FLOAT_VECT2_NORMALIZE, foo, gENTRY, gERR, gvf_get_two_intersects(), gvf_survey, NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, gvf_SurveyPolyAdv::poly_count, gvf_SurveyPolyAdv::poly_first, gvf_SurveyPolyAdv::psa_altitude, gvf_SurveyPolyAdv::psa_min_rad, gvf_SurveyPolyAdv::psa_shot_dist, gvf_SurveyPolyAdv::psa_sweep_width, gvf_SurveyPolyAdv::rad_vec, gvf_SurveyPolyAdv::return_angle, gvf_SurveyPolyAdv::seg_end, gvf_SurveyPolyAdv::seg_start, gvf_SurveyPolyAdv::segment_angle, gvf_SurveyPolyAdv::stage, sweep, gvf_SurveyPolyAdv::sweep_vec, VECT2_COPY, VECT2_DIFF, VECT2_SMUL, VECT2_SUM, waypoints, FloatVect2::x, point::x, FloatVect2::y, and point::y.

+ Here is the call graph for this function:

Variable Documentation

◆ gvf_survey