Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
nav_survey_poly_osam.c File Reference
#include "modules/nav/nav_survey_poly_osam.h"
#include "firmwares/fixedwing/nav.h"
#include "state.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
+ Include dependency graph for nav_survey_poly_osam.c:

Go to the source code of this file.

Data Structures

struct  Point2D
 
struct  Line
 

Macros

#define PolygonSize   10
 
#define MaxFloat   1000000000
 
#define MinFloat   -1000000000
 
#define LINE_START_FUNCTION   {}
 
#define LINE_STOP_FUNCTION   {}
 

Enumerations

enum  SurveyStatus { Init, Entry, Sweep, SweepCircle }
 This routine will cover the enitre area of any Polygon defined in the flightplan which is a convex polygon. More...
 

Functions

static void TranslateAndRotateFromWorld (struct Point2D *p, float Zrot, float transX, float transY)
 
static void RotateAndTranslateToWorld (struct Point2D *p, float Zrot, float transX, float transY)
 Rotates point round z by -Zrot then translates so (0,0) becomes (transX,transY) More...
 
static void FindInterceptOfTwoLines (float *x, float *y, struct Line L1, struct Line L2)
 
static float EvaluateLineForX (float y, struct Line L)
 
bool_t nav_survey_poly_osam_setup (uint8_t EntryWP, uint8_t Size, float sw, float Orientation)
 
bool_t nav_survey_poly_osam_run (void)
 

Variables

static enum SurveyStatus CSurveyStatus
 
static struct Point2D SmallestCorner
 
static struct Line Edges [PolygonSize]
 
static float EdgeMaxY [PolygonSize]
 
static float EdgeMinY [PolygonSize]
 
static float SurveyTheta
 
static float dSweep
 
static float SurveyRadius
 
static struct Point2D SurveyToWP
 
static struct Point2D SurveyFromWP
 
static struct Point2D SurveyCircle
 
static uint8_t SurveyEntryWP
 
static uint8_t SurveySize
 
static float SurveyCircleQdr
 
static float MaxY
 
uint16_t PolySurveySweepNum
 
uint16_t PolySurveySweepBackNum
 

Macro Definition Documentation

#define LINE_START_FUNCTION   {}

Definition at line 48 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run().

#define LINE_STOP_FUNCTION   {}

Definition at line 51 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

#define MaxFloat   1000000000

Definition at line 44 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_setup().

#define MinFloat   -1000000000

Definition at line 45 of file nav_survey_poly_osam.c.

#define PolygonSize   10

Definition at line 43 of file nav_survey_poly_osam.c.

Enumeration Type Documentation

This routine will cover the enitre area of any Polygon defined in the flightplan which is a convex polygon.

Enumerator
Init 
Entry 
Sweep 
SweepCircle 

Definition at line 59 of file nav_survey_poly_osam.c.

Function Documentation

float EvaluateLineForX ( float  y,
struct Line  L 
)
static

Definition at line 498 of file nav_survey_poly_osam.c.

References Line::b, and Line::m.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

+ Here is the caller graph for this function:

void FindInterceptOfTwoLines ( float *  x,
float *  y,
struct Line  L1,
struct Line  L2 
)
static

Definition at line 491 of file nav_survey_poly_osam.c.

References Line::b, and Line::m.

Referenced by nav_survey_poly_osam_setup().

+ Here is the caller graph for this function:

void RotateAndTranslateToWorld ( struct Point2D p,
float  Zrot,
float  transX,
float  transY 
)
static

Rotates point round z by -Zrot then translates so (0,0) becomes (transX,transY)

Definition at line 480 of file nav_survey_poly_osam.c.

References Point2D::x, and Point2D::y.

Referenced by nav_survey_poly_osam_run().

+ Here is the caller graph for this function:

void TranslateAndRotateFromWorld ( struct Point2D p,
float  Zrot,
float  transX,
float  transY 
)
static

Definition at line 467 of file nav_survey_poly_osam.c.

References Point2D::x, and Point2D::y.

Referenced by nav_survey_poly_osam_setup().

+ Here is the caller graph for this function:

Variable Documentation

enum SurveyStatus CSurveyStatus
static

Definition at line 60 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

float dSweep
static

Definition at line 66 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

float EdgeMaxY[PolygonSize]
static

Definition at line 63 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

float EdgeMinY[PolygonSize]
static

Definition at line 64 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

struct Line Edges[PolygonSize]
static

Definition at line 62 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

float MaxY
static

Definition at line 74 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

uint16_t PolySurveySweepBackNum

Definition at line 76 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

uint16_t PolySurveySweepNum

Definition at line 75 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

struct Point2D SmallestCorner
static

Definition at line 61 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

struct Point2D SurveyCircle
static

Definition at line 70 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

float SurveyCircleQdr
static

Definition at line 73 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

uint8_t SurveyEntryWP
static

Definition at line 71 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

struct Point2D SurveyFromWP
static

Definition at line 69 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

float SurveyRadius
static

Definition at line 67 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

uint8_t SurveySize
static

Definition at line 72 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

float SurveyTheta
static

Definition at line 65 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().

struct Point2D SurveyToWP
static

Definition at line 68 of file nav_survey_poly_osam.c.

Referenced by nav_survey_poly_osam_run(), and nav_survey_poly_osam_setup().