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_line.c File Reference
#include "nav_line.h"
#include "generated/airframe.h"
#include "modules/guidance/gvf/gvf.h"
+ Include dependency graph for nav_line.c:

Go to the source code of this file.

Macros

#define GVF_LINE_KE   1
 
#define GVF_LINE_KN   1
 
#define GVF_LINE_HEADING   0
 
#define GVF_SEGMENT_D1   0
 
#define GVF_SEGMENT_D2   0
 

Functions

static void gvf_line (float a, float b, float heading)
 
static int out_of_segment_area (float x1, float y1, float x2, float y2, float d1, float d2)
 
bool nav_gvf_line_XY_heading (float a, float b, float heading)
 
bool nav_gvf_line_wp_heading (uint8_t wp, float heading)
 
bool nav_gvf_line_XY1_XY2 (float x1, float y1, float x2, float y2)
 
bool nav_gvf_line_wp1_wp2 (uint8_t wp1, uint8_t wp2)
 
bool nav_gvf_segment_loop_XY1_XY2 (float x1, float y1, float x2, float y2, float d1, float d2)
 
bool nav_gvf_segment_loop_wp1_wp2 (uint8_t wp1, uint8_t wp2, float d1, float d2)
 
bool nav_gvf_segment_XY1_XY2 (float x1, float y1, float x2, float y2)
 
bool nav_gvf_segment_wp1_wp2 (uint8_t wp1, uint8_t wp2)
 
bool nav_gvf_segment_points (struct FloatVect2 start, struct FloatVect2 end)
 

Variables

gvf_li_par gvf_line_par = {GVF_LINE_KE, GVF_LINE_KN, GVF_LINE_HEADING}
 
gvf_seg_par gvf_segment_par = {GVF_SEGMENT_D1, GVF_SEGMENT_D2}
 
static int gvf_p_len_wps = 0
 

Macro Definition Documentation

◆ GVF_LINE_HEADING

#define GVF_LINE_HEADING   0

Default heading in degrees for a trajectory called from gvf_line_**_HEADING

Definition at line 40 of file nav_line.c.

◆ GVF_LINE_KE

#define GVF_LINE_KE   1

Gain ke for the line trajectory

Definition at line 30 of file nav_line.c.

◆ GVF_LINE_KN

#define GVF_LINE_KN   1

Gain kn for the line trajectory

Definition at line 35 of file nav_line.c.

◆ GVF_SEGMENT_D1

#define GVF_SEGMENT_D1   0

In case of tracking a segment, how much distance in meters will go the vehicle beyond the point x1,y1 before turning back

Definition at line 45 of file nav_line.c.

◆ GVF_SEGMENT_D2

#define GVF_SEGMENT_D2   0

In case of tracking a segment, how much distance in meters will go the vehicle beyond the point x2,y2 before turning back

Definition at line 50 of file nav_line.c.

Function Documentation

◆ gvf_line()

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

Definition at line 61 of file nav_line.c.

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

Referenced by nav_gvf_line_XY_heading(), and nav_gvf_segment_loop_XY1_XY2().

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

◆ nav_gvf_line_wp1_wp2()

bool nav_gvf_line_wp1_wp2 ( uint8_t  wp1,
uint8_t  wp2 
)

Definition at line 161 of file nav_line.c.

References foo, gvf_p_len_wps, gvf_trajectory, nav_gvf_line_XY1_XY2(), gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ nav_gvf_line_wp_heading()

bool nav_gvf_line_wp_heading ( uint8_t  wp,
float  heading 
)

Definition at line 127 of file nav_line.c.

References b, foo, heading, nav_gvf_line_XY_heading(), WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ nav_gvf_line_XY1_XY2()

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

Definition at line 137 of file nav_line.c.

References foo, gvf_p_len_wps, gvf_segment, gvf_trajectory, nav_gvf_line_XY_heading(), gvf_tra::p, gvf_seg::seg, gvf_seg::x1, gvf_seg::x2, gvf_seg::y1, and gvf_seg::y2.

Referenced by nav_gvf_line_wp1_wp2(), and nav_gvf_segment_XY1_XY2().

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

◆ nav_gvf_line_XY_heading()

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

Definition at line 120 of file nav_line.c.

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

Referenced by nav_gvf_line_wp_heading(), and nav_gvf_line_XY1_XY2().

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

◆ nav_gvf_segment_loop_wp1_wp2()

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

Definition at line 201 of file nav_line.c.

References d1, d2, foo, gvf_p_len_wps, gvf_trajectory, nav_gvf_segment_loop_XY1_XY2(), gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ nav_gvf_segment_loop_XY1_XY2()

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

Definition at line 177 of file nav_line.c.

References alpha, d1, d2, foo, 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 nav_gvf_segment_loop_wp1_wp2().

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

◆ nav_gvf_segment_points()

bool nav_gvf_segment_points ( struct FloatVect2  start,
struct FloatVect2  end 
)

Definition at line 253 of file nav_line.c.

References nav_gvf_segment_XY1_XY2(), FloatVect2::x, and FloatVect2::y.

Referenced by nav_gvf_survey_polygon_run().

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

◆ nav_gvf_segment_wp1_wp2()

bool nav_gvf_segment_wp1_wp2 ( uint8_t  wp1,
uint8_t  wp2 
)

Definition at line 239 of file nav_line.c.

References foo, gvf_p_len_wps, gvf_trajectory, nav_gvf_segment_XY1_XY2(), gvf_tra::p, WaypointX, and WaypointY.

+ Here is the call graph for this function:

◆ nav_gvf_segment_XY1_XY2()

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

Definition at line 217 of file nav_line.c.

References foo, nav_gvf_line_XY1_XY2(), p, and stateGetPositionEnu_f().

Referenced by nav_gvf_segment_points(), and nav_gvf_segment_wp1_wp2().

+ 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 nav_line.c.

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

Referenced by nav_gvf_ik_segment_loop_XY1_XY2(), and nav_gvf_segment_loop_XY1_XY2().

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

Variable Documentation

◆ gvf_line_par


Definition at line 53 of file nav_line.c.

Referenced by gvf_line().

◆ gvf_p_len_wps

◆ gvf_segment_par

Definition at line 54 of file nav_line.c.