Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
nav_survey_rectangle_rotorcraft.c File Reference

Automatic survey of a rectangle for rotorcraft. More...

#include "mcu_periph/uart.h"
#include "pprzlink/messages.h"
#include "modules/datalink/downlink.h"
#include "modules/datalink/telemetry.h"
#include "firmwares/rotorcraft/navigation.h"
#include "modules/nav/nav_survey_rectangle_rotorcraft.h"
#include "state.h"
#include "generated/flight_plan.h"
+ Include dependency graph for nav_survey_rectangle_rotorcraft.c:

Go to the source code of this file.

Macros

#define RECTANGLE_SURVEY_DEFAULT_SWEEP   25
 
#define USE_INTERLEAVE   FALSE
 
#define RECTANGLE_SURVEY_HEADING_NS   0.f
 
#define RECTANGLE_SURVEY_HEADING_WE   90.f
 
#define SurveyGoingNorth()   ((survey_orientation == NS) && (survey_to.y > survey_from.y))
 
#define SurveyGoingSouth()   ((survey_orientation == NS) && (survey_to.y < survey_from.y))
 
#define SurveyGoingEast()   ((survey_orientation == WE) && (survey_to.x > survey_from.x))
 
#define SurveyGoingWest()   ((survey_orientation == WE) && (survey_to.x < survey_from.x))
 
#define LINE_START_FUNCTION   {}
 
#define LINE_STOP_FUNCTION   {}
 

Functions

static void send_survey (struct transport_tx *trans, struct link_device *dev)
 
void nav_survey_rectangle_rotorcraft_init (void)
 
void nav_survey_rectangle_rotorcraft_setup (uint8_t wp1, uint8_t wp2, float grid, survey_orientation_t so)
 
bool nav_survey_rectangle_rotorcraft_run (uint8_t wp1, uint8_t wp2)
 

Variables

float sweep = RECTANGLE_SURVEY_DEFAULT_SWEEP
 
static bool nav_survey_rectangle_active = false
 
uint16_t rectangle_survey_sweep_num
 
bool nav_in_segment = false
 
bool nav_in_circle = false
 
bool interleave = USE_INTERLEAVE
 
static struct EnuCoor_f survey_from survey_to
 
static bool survey_uturn = false
 
static survey_orientation_t survey_orientation = NS
 
static bool nav_survey_send = false
 
float nav_survey_shift
 
float nav_survey_west
 
float nav_survey_east
 
float nav_survey_north
 
float nav_survey_south
 

Detailed Description

Automatic survey of a rectangle for rotorcraft.

Rectangle is defined by two points, sweep can be south-north or west-east.

Definition in file nav_survey_rectangle_rotorcraft.c.

Macro Definition Documentation

◆ LINE_START_FUNCTION

#define LINE_START_FUNCTION   {}

Definition at line 86 of file nav_survey_rectangle_rotorcraft.c.

◆ LINE_STOP_FUNCTION

#define LINE_STOP_FUNCTION   {}

Definition at line 89 of file nav_survey_rectangle_rotorcraft.c.

◆ RECTANGLE_SURVEY_DEFAULT_SWEEP

#define RECTANGLE_SURVEY_DEFAULT_SWEEP   25

Definition at line 32 of file nav_survey_rectangle_rotorcraft.c.

◆ RECTANGLE_SURVEY_HEADING_NS

#define RECTANGLE_SURVEY_HEADING_NS   0.f

Definition at line 55 of file nav_survey_rectangle_rotorcraft.c.

◆ RECTANGLE_SURVEY_HEADING_WE

#define RECTANGLE_SURVEY_HEADING_WE   90.f

Definition at line 59 of file nav_survey_rectangle_rotorcraft.c.

◆ SurveyGoingEast

#define SurveyGoingEast ( )    ((survey_orientation == WE) && (survey_to.x > survey_from.x))

Definition at line 80 of file nav_survey_rectangle_rotorcraft.c.

◆ SurveyGoingNorth

#define SurveyGoingNorth ( )    ((survey_orientation == NS) && (survey_to.y > survey_from.y))

Definition at line 78 of file nav_survey_rectangle_rotorcraft.c.

◆ SurveyGoingSouth

#define SurveyGoingSouth ( )    ((survey_orientation == NS) && (survey_to.y < survey_from.y))

Definition at line 79 of file nav_survey_rectangle_rotorcraft.c.

◆ SurveyGoingWest

#define SurveyGoingWest ( )    ((survey_orientation == WE) && (survey_to.x < survey_from.x))

Definition at line 81 of file nav_survey_rectangle_rotorcraft.c.

◆ USE_INTERLEAVE

#define USE_INTERLEAVE   FALSE

Definition at line 38 of file nav_survey_rectangle_rotorcraft.c.

Function Documentation

◆ nav_survey_rectangle_rotorcraft_init()

void nav_survey_rectangle_rotorcraft_init ( void  )

Definition at line 101 of file nav_survey_rectangle_rotorcraft.c.

References DefaultPeriodic, register_periodic_telemetry(), and send_survey().

+ Here is the call graph for this function:

◆ nav_survey_rectangle_rotorcraft_run()

◆ nav_survey_rectangle_rotorcraft_setup()

◆ send_survey()

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

Definition at line 92 of file nav_survey_rectangle_rotorcraft.c.

References dev, nav_survey_east, nav_survey_north, nav_survey_send, nav_survey_south, and nav_survey_west.

Referenced by nav_survey_rectangle_rotorcraft_init().

+ Here is the caller graph for this function:

Variable Documentation

◆ interleave

bool interleave = USE_INTERLEAVE

◆ nav_in_circle

bool nav_in_circle = false

◆ nav_in_segment

bool nav_in_segment = false

◆ nav_survey_east

◆ nav_survey_north

◆ nav_survey_rectangle_active

bool nav_survey_rectangle_active = false
static

◆ nav_survey_send

bool nav_survey_send = false
static

◆ nav_survey_shift

float nav_survey_shift

◆ nav_survey_south

◆ nav_survey_west

◆ rectangle_survey_sweep_num

uint16_t rectangle_survey_sweep_num

◆ survey_orientation

◆ survey_to

◆ survey_uturn

bool survey_uturn = false
static

◆ sweep