Paparazzi UAS
v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
|
Advanced polygon survey for fixedwings from Uni Stuttgart. More...
#include "nav_survey_polygon.h"
#include "firmwares/fixedwing/nav.h"
#include "state.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
Go to the source code of this file.
Functions | |
static void | nav_points (struct FloatVect2 start, struct FloatVect2 end) |
static bool | 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 More... | |
static bool | 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 More... | |
void | nav_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 More... | |
bool | nav_survey_polygon_run (void) |
main navigation routine. More... | |
Variables | |
struct SurveyPolyAdv | survey |
Advanced polygon survey for fixedwings from Uni Stuttgart.
Definition in file nav_survey_polygon.c.
|
static |
intersects a line with the polygon and gives back the two intersection points
x,y | intersection points |
a,b | define the line to intersection |
Definition at line 78 of file nav_survey_polygon.c.
References SurveyPolyAdv::dir_vec, intercept_two_lines(), SurveyPolyAdv::poly_count, SurveyPolyAdv::poly_first, survey, waypoints, point::x, FloatVect2::x, point::y, and FloatVect2::y.
Referenced by nav_survey_polygon_run(), and nav_survey_polygon_setup().
|
static |
intercept two lines and give back the point of intersection
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 55 of file nav_survey_polygon.c.
References FloatVect2::x, and FloatVect2::y.
Referenced by get_two_intersects().
|
static |
Definition at line 42 of file nav_survey_polygon.c.
References nav_route_xy(), FloatVect2::x, and FloatVect2::y.
Referenced by nav_survey_polygon_run().
bool nav_survey_polygon_run | ( | void | ) |
main navigation routine.
This is called periodically evaluates the current Position and stage and navigates accordingly.
Definition at line 232 of file nav_survey_polygon.c.
References CARROT, dc_stop(), dc_survey(), SurveyPolyAdv::dir_vec, ENTRY, SurveyPolyAdv::entry_center, get_two_intersects(), last_x, last_y, nav_approaching_xy(), nav_circle_XY(), nav_init_stage(), nav_points(), NavCourseCloseTo, NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, SurveyPolyAdv::psa_altitude, SurveyPolyAdv::psa_min_rad, SurveyPolyAdv::psa_shot_dist, SurveyPolyAdv::psa_sweep_width, SurveyPolyAdv::rad_vec, RET, SurveyPolyAdv::ret_end, SurveyPolyAdv::ret_start, SurveyPolyAdv::return_angle, SEG, SurveyPolyAdv::seg_center1, SurveyPolyAdv::seg_center2, SurveyPolyAdv::seg_end, SurveyPolyAdv::seg_start, SurveyPolyAdv::segment_angle, SurveyPolyAdv::stage, stateGetPositionUtm_f(), survey, SurveyPolyAdv::sweep_vec, TURN1, TURN2, VECT2_DIFF, VECT2_SUM, FloatVect2::x, and FloatVect2::y.
void nav_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
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 135 of file nav_survey_polygon.c.
References altitude, SurveyPolyAdv::dir_vec, ENTRY, SurveyPolyAdv::entry_center, ERR, FLOAT_VECT2_NORMALIZE, get_two_intersects(), NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, SurveyPolyAdv::poly_count, SurveyPolyAdv::poly_first, SurveyPolyAdv::psa_altitude, SurveyPolyAdv::psa_min_rad, SurveyPolyAdv::psa_shot_dist, SurveyPolyAdv::psa_sweep_width, SurveyPolyAdv::rad_vec, SurveyPolyAdv::return_angle, SurveyPolyAdv::seg_end, SurveyPolyAdv::seg_start, SurveyPolyAdv::segment_angle, SurveyPolyAdv::stage, survey, SurveyPolyAdv::sweep_vec, VECT2_COPY, VECT2_DIFF, VECT2_SMUL, VECT2_SUM, waypoints, point::x, FloatVect2::x, point::y, and FloatVect2::y.
struct SurveyPolyAdv survey |
Definition at line 40 of file nav_survey_polygon.c.
Referenced by get_two_intersects(), nav_survey_polygon_run(), and nav_survey_polygon_setup().