Paparazzi UAS  v5.15_devel-81-gd13dafb
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cartography.c File Reference

Navigation functions for cartography of the ground. More...

#include "state.h"
#include "stdio.h"
#include "firmwares/fixedwing/nav.h"
#include "generated/flight_plan.h"
#include "std.h"
#include "modules/cartography/cartography.h"
#include "generated/modules.h"
#include "subsystems/datalink/downlink.h"
#include "mcu_periph/uart.h"
+ Include dependency graph for cartography.c:

Go to the source code of this file.

Macros

#define PRTDEB(TYPE, EXP)   ;
 
#define PRTDEBSTR(EXP)   ;
 
#define DISTXY(P1X, P1Y, P2X, P2Y)   (sqrt( ( (P2X-P1X) * (P2X-P1X) ) + ( (P2Y-P1Y) * (P2Y-P1Y) ) ) )
 
#define NORMXY(P1X, P1Y)   (sqrt( ( (P1X) * (P1X) ) + ( (P1Y) * (P1Y) ) ) )
 
#define DISTLIMIT   30
 
#define USE_ONBOARD_CAMERA   1
 

Functions

void init_carto (void)
 Automatic survey of an oriented rectangle (defined by three points) More...
 
void periodic_downlink_carto (void)
 
void start_carto (void)
 
void stop_carto (void)
 
bool nav_survey_Inc_railnumberSinceBoot (void)
 
bool nav_survey_Snapshoot (void)
 
bool nav_survey_Snapshoot_Continu (void)
 
bool nav_survey_StopSnapshoot (void)
 
bool nav_survey_computefourth_corner (uint8_t wp1, uint8_t wp2, uint8_t wp3, uint8_t wp4)
 
bool nav_survey_ComputeProjectionOnLine (struct point pointAf, struct point pointBf, float pos_xf, float pos_yf, float *normAMf, float *normBMf, float *distancefromrailf)
 
bool nav_survey_losange_carto_init (uint8_t wp1, uint8_t wp2, uint8_t wp3, float distrailinit, float distplusinit)
 
bool nav_survey_losange_carto (void)
 

Variables

uint16_t railnumberSinceBoot
 
uint16_t camera_snapshot_image_number = 0
 
bool survey_losange_uturn
 
int railnumber
 
int numberofrailtodo
 
float distrail
 
float distplus
 
float distrailinteractif
 
static struct point point1 point2 point3
 
static struct point pointA pointB pointC
 
static struct point vec12 vec13
 
float norm12
 
float norm13
 
float tempx
 
float tempy
 
float angle1213
 
float signforturn
 
float tempcircleradius
 
float circleradiusmin = 40
 
float normBM
 
float normAM
 
float distancefromrail
 
float course_next_rail
 
float angle_between
 
bool ProjectionInsideLimitOfRail
 

Detailed Description

Navigation functions for cartography of the ground.

Definition in file cartography.c.

Macro Definition Documentation

#define DISTLIMIT   30

Definition at line 80 of file cartography.c.

Referenced by nav_survey_losange_carto().

#define DISTXY (   P1X,
  P1Y,
  P2X,
  P2Y 
)    (sqrt( ( (P2X-P1X) * (P2X-P1X) ) + ( (P2Y-P1Y) * (P2Y-P1Y) ) ) )

Definition at line 71 of file cartography.c.

Referenced by nav_survey_ComputeProjectionOnLine(), and nav_survey_losange_carto().

#define NORMXY (   P1X,
  P1Y 
)    (sqrt( ( (P1X) * (P1X) ) + ( (P1Y) * (P1Y) ) ) )
#define PRTDEB (   TYPE,
  EXP 
)    ;
#define USE_ONBOARD_CAMERA   1

Definition at line 89 of file cartography.c.

Function Documentation

void init_carto ( void  )

Automatic survey of an oriented rectangle (defined by three points)

Definition at line 148 of file cartography.c.

bool nav_survey_computefourth_corner ( uint8_t  wp1,
uint8_t  wp2,
uint8_t  wp3,
uint8_t  wp4 
)

Definition at line 211 of file cartography.c.

References nav_survey_computefourth_corner(), PRTDEB, PRTDEBSTR, waypoints, point::x, and point::y.

Referenced by nav_survey_computefourth_corner().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool nav_survey_ComputeProjectionOnLine ( struct point  pointAf,
struct point  pointBf,
float  pos_xf,
float  pos_yf,
float *  normAMf,
float *  normBMf,
float *  distancefromrailf 
)

Definition at line 227 of file cartography.c.

References point::a, DISTXY, NORMXY, PRTDEB, PRTDEBSTR, point::x, and point::y.

Referenced by nav_survey_losange_carto().

+ Here is the caller graph for this function:

bool nav_survey_Inc_railnumberSinceBoot ( void  )

Definition at line 177 of file cartography.c.

References railnumberSinceBoot.

bool nav_survey_losange_carto_init ( uint8_t  wp1,
uint8_t  wp2,
uint8_t  wp3,
float  distrailinit,
float  distplusinit 
)
bool nav_survey_Snapshoot ( void  )

Definition at line 183 of file cartography.c.

References camera_snapshot_image_number, PRTDEBSTR, and railnumberSinceBoot.

bool nav_survey_Snapshoot_Continu ( void  )

Definition at line 192 of file cartography.c.

References camera_snapshot_image_number, PRTDEBSTR, and railnumberSinceBoot.

bool nav_survey_StopSnapshoot ( void  )

Definition at line 201 of file cartography.c.

References camera_snapshot_image_number, PRTDEBSTR, and STOP.

void periodic_downlink_carto ( void  )

Definition at line 152 of file cartography.c.

References camera_snapshot_image_number, DefaultChannel, and DefaultDevice.

void start_carto ( void  )

Definition at line 166 of file cartography.c.

void stop_carto ( void  )

Definition at line 170 of file cartography.c.

Variable Documentation

float angle1213

Definition at line 120 of file cartography.c.

Referenced by nav_survey_losange_carto_init().

float angle_between

Definition at line 131 of file cartography.c.

Referenced by nav_survey_losange_carto().

float circleradiusmin = 40

Definition at line 124 of file cartography.c.

Referenced by nav_survey_losange_carto().

float course_next_rail

Definition at line 130 of file cartography.c.

Referenced by nav_survey_losange_carto().

float distancefromrail

Definition at line 127 of file cartography.c.

Referenced by nav_survey_losange_carto().

float distplus

Definition at line 105 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float distrail

Definition at line 104 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float distrailinteractif
Initial value:
=
60

Definition at line 107 of file cartography.c.

float norm12

Definition at line 114 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float norm13

Definition at line 114 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float normAM

Definition at line 127 of file cartography.c.

Referenced by nav_survey_losange_carto().

float normBM

Definition at line 127 of file cartography.c.

Referenced by nav_survey_losange_carto().

int numberofrailtodo

Definition at line 102 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

struct point point1 point2 point3
static

Definition at line 111 of file cartography.c.

Referenced by nav_survey_losange_carto_init().

struct point pointA pointB pointC
static

Definition at line 112 of file cartography.c.

Referenced by nav_survey_losange_carto().

bool ProjectionInsideLimitOfRail

Definition at line 133 of file cartography.c.

Referenced by nav_survey_losange_carto().

int railnumber

Definition at line 101 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float signforturn

Definition at line 121 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

bool survey_losange_uturn

Definition at line 99 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float tempcircleradius

Definition at line 123 of file cartography.c.

Referenced by nav_survey_losange_carto().

float tempx

Definition at line 119 of file cartography.c.

Referenced by nav_survey_losange_carto().

float tempy

Definition at line 119 of file cartography.c.

Referenced by nav_survey_losange_carto().

struct point vec12 vec13
static

Definition at line 113 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().