Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
#include "firmwares/fixedwing/nav.h"
#include "state.h"
#include "autopilot.h"
#include "generated/flight_plan.h"
#include "modules/guidance/gvf/gvf.h"
Go to the source code of this file.
Functions | |
static void | gvf_nav_points (struct FloatVect2 start, struct FloatVect2 end) |
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 More... | |
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 More... | |
void | gvf_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... | |
void | gvf_nav_direction_circle (float rad) |
main navigation routine. More... | |
bool | gvf_nav_survey_polygon_run (void) |
Variables | |
struct gvf_SurveyPolyAdv | gvf_survey |
|
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_gvf.c.
References b, gvf_SurveyPolyAdv::dir_vec, gvf_intercept_two_lines(), gvf_survey, gvf_SurveyPolyAdv::poly_count, gvf_SurveyPolyAdv::poly_first, waypoints, point::x, FloatVect2::x, point::y, and FloatVect2::y.
Referenced by gvf_nav_survey_polygon_run(), and gvf_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_gvf.c.
References logger_uart_parse::a1, logger_uart_parse::a2, p, FloatVect2::x, and FloatVect2::y.
Referenced by gvf_get_two_intersects().
void gvf_nav_direction_circle | ( | float | rad | ) |
main navigation routine.
This is called periodically evaluates the current Position and stage and navigates accordingly.
Definition at line 236 of file nav_survey_polygon_gvf.c.
References gvf_set_direction().
Referenced by gvf_nav_survey_polygon_run().
|
static |
Definition at line 42 of file nav_survey_polygon_gvf.c.
References gvf_segment_XY1_XY2(), FloatVect2::x, and FloatVect2::y.
Referenced by gvf_nav_survey_polygon_run().
bool gvf_nav_survey_polygon_run | ( | void | ) |
Definition at line 245 of file nav_survey_polygon_gvf.c.
References CARROT, dc_stop(), dc_survey(), gvf_SurveyPolyAdv::dir_vec, gvf_SurveyPolyAdv::entry_center, gENTRY, gRET, gSEG, gTURN1, gTURN2, gvf_ellipse_XY(), gvf_get_two_intersects(), gvf_nav_direction_circle(), gvf_nav_points(), gvf_survey, last_x, last_y, nav_approaching_xy(), nav_init_stage(), NavCourseCloseTo, NavVerticalAltitudeMode, NavVerticalAutoThrottleMode, 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::ret_end, gvf_SurveyPolyAdv::ret_start, gvf_SurveyPolyAdv::return_angle, gvf_SurveyPolyAdv::seg_center1, gvf_SurveyPolyAdv::seg_center2, gvf_SurveyPolyAdv::seg_end, gvf_SurveyPolyAdv::seg_start, gvf_SurveyPolyAdv::segment_angle, gvf_SurveyPolyAdv::stage, stateGetPositionUtm_f(), gvf_SurveyPolyAdv::sweep_vec, VECT2_DIFF, VECT2_SUM, FloatVect2::x, and FloatVect2::y.
void gvf_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_gvf.c.
References altitude, gvf_SurveyPolyAdv::dir_vec, gvf_SurveyPolyAdv::entry_center, FLOAT_VECT2_NORMALIZE, 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, point::x, FloatVect2::x, point::y, and FloatVect2::y.
struct gvf_SurveyPolyAdv gvf_survey |
Definition at line 40 of file nav_survey_polygon_gvf.c.
Referenced by gvf_get_two_intersects(), gvf_nav_survey_polygon_run(), and gvf_nav_survey_polygon_setup().