Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
gvf.c File Reference
#include <math.h>
#include "std.h"
#include "gvf.h"
#include "gvf_low_level_control.h"
#include "trajectories/gvf_ellipse.h"
#include "trajectories/gvf_line.h"
#include "trajectories/gvf_sin.h"
#include "autopilot.h"
#include "../gvf_common.h"
#include "modules/datalink/telemetry.h"
+ Include dependency graph for gvf.c:

Go to the source code of this file.

Functions

static void send_gvf (struct transport_tx *trans, struct link_device *dev)
 
static int out_of_segment_area (float x1, float y1, float x2, float y2, float d1, float d2)
 
void gvf_init (void)
 
void gvf_control_2D (float ke, float kn, float e, struct gvf_grad *grad, struct gvf_Hess *hess)
 
void gvf_set_speed (float speed)
 
void gvf_set_align (bool align)
 
void gvf_set_direction (int8_t s)
 
static void gvf_line (float a, float b, float heading)
 
bool gvf_line_XY_heading (float a, float b, float heading)
 
bool gvf_line_XY1_XY2 (float x1, float y1, float x2, float y2)
 
bool gvf_line_wp1_wp2 (uint8_t wp1, uint8_t wp2)
 
bool gvf_segment_loop_XY1_XY2 (float x1, float y1, float x2, float y2, float d1, float d2)
 
bool gvf_segment_loop_wp1_wp2 (uint8_t wp1, uint8_t wp2, float d1, float d2)
 
bool gvf_segment_XY1_XY2 (float x1, float y1, float x2, float y2)
 
bool gvf_segment_wp1_wp2 (uint8_t wp1, uint8_t wp2)
 
bool gvf_line_wp_heading (uint8_t wp, float heading)
 
bool gvf_ellipse_XY (float x, float y, float a, float b, float alpha)
 
bool gvf_ellipse_wp (uint8_t wp, float a, float b, float alpha)
 
bool gvf_sin_XY_alpha (float a, float b, float alpha, float w, float off, float A)
 
bool gvf_sin_wp1_wp2 (uint8_t wp1, uint8_t wp2, float w, float off, float A)
 
bool gvf_sin_wp_alpha (uint8_t wp, float alpha, float w, float off, float A)
 

Variables

gvf_con gvf_control
 
gvf_st gvf_state
 
gvf_tra gvf_trajectory
 
gvf_seg gvf_segment
 
uint32_t gvf_t0 = 0
 
int gvf_plen = 1
 
int gvf_plen_wps = 0
 

Function Documentation

◆ gvf_control_2D()

◆ gvf_ellipse_wp()

bool gvf_ellipse_wp ( uint8_t  wp,
float  a,
float  b,
float  alpha 
)

Definition at line 472 of file gvf.c.

References alpha, b, gvf_ellipse_XY(), gvf_plen_wps, gvf_trajectory, gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ gvf_ellipse_XY()

bool gvf_ellipse_XY ( float  x,
float  y,
float  a,
float  b,
float  alpha 
)

Definition at line 433 of file gvf.c.

References alpha, b, gvf_con::error, gvf_control, gvf_control_2D(), gvf_ellipse_info(), gvf_ellipse_par, gvf_plen, gvf_plen_wps, gvf_trajectory, gvf_con::ke, gvf_ell_par::ke, gvf_ell_par::kn, gvf_tra::p, and gvf_tra::type.

Referenced by distributed_circular(), gvf_ellipse_wp(), and gvf_nav_survey_polygon_run().

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

◆ gvf_init()

void gvf_init ( void  )

Definition at line 116 of file gvf.c.

References gvf_con::align, DefaultPeriodic, gvf_control, gvf_trajectory, gvf_con::ke, gvf_con::kn, NONE, register_periodic_telemetry(), gvf_con::s, send_gvf(), gvf_con::speed, and gvf_tra::type.

+ Here is the call graph for this function:

◆ gvf_line()

static void gvf_line ( float  a,
float  b,
float  heading 
)
static

Definition at line 273 of file gvf.c.

References b, gvf_con::error, gvf_control, gvf_control_2D(), gvf_line_info(), gvf_line_par, gvf_plen, gvf_plen_wps, gvf_segment, gvf_trajectory, heading, gvf_con::ke, gvf_li_par::ke, gvf_li_par::kn, gvf_tra::p, gvf_seg::seg, and gvf_tra::type.

Referenced by gvf_line_XY_heading(), and gvf_segment_loop_XY1_XY2().

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

◆ gvf_line_wp1_wp2()

bool gvf_line_wp1_wp2 ( uint8_t  wp1,
uint8_t  wp2 
)

Definition at line 328 of file gvf.c.

References gvf_line_XY1_XY2(), gvf_plen_wps, gvf_trajectory, gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ gvf_line_wp_heading()

bool gvf_line_wp_heading ( uint8_t  wp,
float  heading 
)

Definition at line 418 of file gvf.c.

References b, gvf_line_XY_heading(), gvf_plen_wps, gvf_trajectory, heading, gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ gvf_line_XY1_XY2()

bool gvf_line_XY1_XY2 ( float  x1,
float  y1,
float  x2,
float  y2 
)

Definition at line 304 of file gvf.c.

References gvf_line_XY_heading(), gvf_plen_wps, gvf_segment, gvf_trajectory, gvf_tra::p, gvf_seg::seg, gvf_seg::x1, gvf_seg::x2, gvf_seg::y1, and gvf_seg::y2.

Referenced by gvf_line_wp1_wp2(), and gvf_segment_XY1_XY2().

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

◆ gvf_line_XY_heading()

bool gvf_line_XY_heading ( float  a,
float  b,
float  heading 
)

Definition at line 297 of file gvf.c.

References b, gvf_line(), gvf_set_direction(), and heading.

Referenced by gvf_line_wp_heading(), and gvf_line_XY1_XY2().

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

◆ gvf_segment_loop_wp1_wp2()

bool gvf_segment_loop_wp1_wp2 ( uint8_t  wp1,
uint8_t  wp2,
float  d1,
float  d2 
)

Definition at line 366 of file gvf.c.

References d1, d2, gvf_plen_wps, gvf_segment_loop_XY1_XY2(), gvf_trajectory, gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ gvf_segment_loop_XY1_XY2()

bool gvf_segment_loop_XY1_XY2 ( float  x1,
float  y1,
float  x2,
float  y2,
float  d1,
float  d2 
)

Definition at line 342 of file gvf.c.

References alpha, d1, d2, gvf_line(), gvf_segment, gvf_set_direction(), out_of_segment_area(), s, gvf_seg::seg, gvf_seg::x1, gvf_seg::x2, gvf_seg::y1, and gvf_seg::y2.

Referenced by gvf_segment_loop_wp1_wp2().

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

◆ gvf_segment_wp1_wp2()

bool gvf_segment_wp1_wp2 ( uint8_t  wp1,
uint8_t  wp2 
)

Definition at line 404 of file gvf.c.

References gvf_plen_wps, gvf_segment_XY1_XY2(), gvf_trajectory, gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ gvf_segment_XY1_XY2()

bool gvf_segment_XY1_XY2 ( float  x1,
float  y1,
float  x2,
float  y2 
)

Definition at line 382 of file gvf.c.

References gvf_line_XY1_XY2(), p, and stateGetPositionEnu_f().

Referenced by gvf_nav_points(), and gvf_segment_wp1_wp2().

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

◆ gvf_set_align()

void gvf_set_align ( bool  align)

Definition at line 259 of file gvf.c.

References gvf_con::align, and gvf_control.

◆ gvf_set_direction()

void gvf_set_direction ( int8_t  s)

Definition at line 266 of file gvf.c.

References gvf_control, gvf_con::s, and s.

Referenced by gvf_line_XY_heading(), gvf_nav_direction_circle(), and gvf_segment_loop_XY1_XY2().

+ Here is the caller graph for this function:

◆ gvf_set_speed()

void gvf_set_speed ( float  speed)

Definition at line 253 of file gvf.c.

References gvf_control, and gvf_con::speed.

◆ gvf_sin_wp1_wp2()

bool gvf_sin_wp1_wp2 ( uint8_t  wp1,
uint8_t  wp2,
float  w,
float  off,
float  A 
)

Definition at line 508 of file gvf.c.

References A, alpha, gvf_plen_wps, gvf_sin_XY_alpha(), gvf_trajectory, gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ gvf_sin_wp_alpha()

bool gvf_sin_wp_alpha ( uint8_t  wp,
float  alpha,
float  w,
float  off,
float  A 
)

Definition at line 531 of file gvf.c.

References A, alpha, gvf_plen_wps, gvf_sin_XY_alpha(), gvf_trajectory, gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ gvf_sin_XY_alpha()

bool gvf_sin_XY_alpha ( float  a,
float  b,
float  alpha,
float  w,
float  off,
float  A 
)

Definition at line 483 of file gvf.c.

References A, alpha, b, gvf_con::error, gvf_control, gvf_control_2D(), gvf_plen, gvf_plen_wps, gvf_sin_info(), gvf_sin_par, gvf_trajectory, gvf_con::ke, gvf_s_par::ke, gvf_s_par::kn, gvf_tra::p, and gvf_tra::type.

Referenced by gvf_sin_wp1_wp2(), and gvf_sin_wp_alpha().

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

◆ out_of_segment_area()

static int out_of_segment_area ( float  x1,
float  y1,
float  x2,
float  y2,
float  d1,
float  d2 
)
static

Definition at line 85 of file gvf.c.

References alpha, d1, d2, p, s, and stateGetPositionEnu_f().

Referenced by gvf_segment_loop_XY1_XY2().

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

◆ send_gvf()

static void send_gvf ( struct transport_tx *  trans,
struct link_device *  dev 
)
static

Definition at line 54 of file gvf.c.

References dev, ELLIPSE, gvf_con::error, get_sys_time_msec(), gvf_control, gvf_plen, gvf_segment, gvf_t0, gvf_trajectory, gvf_con::ke, LINE, gvf_tra::p, gvf_con::s, gvf_seg::seg, gvf_tra::type, gvf_seg::x1, gvf_seg::x2, gvf_seg::y1, and gvf_seg::y2.

Referenced by gvf_init().

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

Variable Documentation

◆ gvf_control

◆ gvf_plen

int gvf_plen = 1

Definition at line 49 of file gvf.c.

Referenced by gvf_ellipse_XY(), gvf_line(), gvf_sin_XY_alpha(), and send_gvf().

◆ gvf_plen_wps

◆ gvf_segment

gvf_seg gvf_segment

Definition at line 43 of file gvf.c.

Referenced by gvf_line(), gvf_line_XY1_XY2(), gvf_segment_loop_XY1_XY2(), and send_gvf().

◆ gvf_state

gvf_st gvf_state

Definition at line 39 of file gvf.c.

Referenced by gvf_control_2D(), and gvf_low_level_getState().

◆ gvf_t0

uint32_t gvf_t0 = 0

Definition at line 46 of file gvf.c.

Referenced by gvf_control_2D(), and send_gvf().

◆ gvf_trajectory