Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures 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 "subsystems/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
 
#define DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE
 

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_t nav_survey_Inc_railnumberSinceBoot (void)
 
bool_t nav_survey_Snapshoot (void)
 
bool_t nav_survey_Snapshoot_Continu (void)
 
bool_t nav_survey_StopSnapshoot (void)
 
bool_t nav_survey_computefourth_corner (uint8_t wp1, uint8_t wp2, uint8_t wp3, uint8_t wp4)
 
bool_t nav_survey_ComputeProjectionOnLine (struct point pointAf, struct point pointBf, float pos_xf, float pos_yf, float *normAMf, float *normBMf, float *distancefromrailf)
 
bool_t nav_survey_losange_carto_init (uint8_t wp1, uint8_t wp2, uint8_t wp3, float distrailinit, float distplusinit)
 
bool_t nav_survey_losange_carto (void)
 

Variables

uint16_t railnumberSinceBoot =1
 
uint16_t camera_snapshot_image_number =0
 
bool_t survey_losange_uturn
 
int railnumber
 
int numberofrailtodo
 
float distrail
 
float distplus
 
float distrailinteractif =60
 
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_t 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 DOWNLINK_DEVICE   DOWNLINK_AP_DEVICE

Definition at line 140 of file cartography.c.

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

Definition at line 88 of file cartography.c.

Function Documentation

void init_carto ( void  )

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

Definition at line 149 of file cartography.c.

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

Definition at line 199 of file cartography.c.

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

Referenced by nav_survey_computefourth_corner().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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

Definition at line 214 of file cartography.c.

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

Referenced by nav_survey_losange_carto().

+ Here is the caller graph for this function:

bool_t nav_survey_Inc_railnumberSinceBoot ( void  )

Definition at line 165 of file cartography.c.

References FALSE, and railnumberSinceBoot.

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

Definition at line 171 of file cartography.c.

References camera_snapshot_image_number, FALSE, PRTDEBSTR, and railnumberSinceBoot.

bool_t nav_survey_Snapshoot_Continu ( void  )

Definition at line 180 of file cartography.c.

References camera_snapshot_image_number, PRTDEBSTR, railnumberSinceBoot, and TRUE.

bool_t nav_survey_StopSnapshoot ( void  )

Definition at line 189 of file cartography.c.

References camera_snapshot_image_number, FALSE, and PRTDEBSTR.

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 156 of file cartography.c.

void stop_carto ( void  )

Definition at line 159 of file cartography.c.

Variable Documentation

float angle1213

Definition at line 118 of file cartography.c.

Referenced by nav_survey_losange_carto_init().

float angle_between

Definition at line 129 of file cartography.c.

Referenced by nav_survey_losange_carto().

float circleradiusmin =40

Definition at line 122 of file cartography.c.

Referenced by nav_survey_losange_carto().

float course_next_rail

Definition at line 128 of file cartography.c.

Referenced by nav_survey_losange_carto().

float distancefromrail

Definition at line 125 of file cartography.c.

Referenced by nav_survey_losange_carto().

float distplus

Definition at line 104 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float distrail

Definition at line 103 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float distrailinteractif =60

Definition at line 106 of file cartography.c.

float norm12

Definition at line 112 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float norm13

Definition at line 112 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float normAM

Definition at line 125 of file cartography.c.

Referenced by nav_survey_losange_carto().

float normBM

Definition at line 125 of file cartography.c.

Referenced by nav_survey_losange_carto().

int numberofrailtodo

Definition at line 101 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 109 of file cartography.c.

Referenced by nav_survey_losange_carto_init().

struct point pointA pointB pointC
static

Definition at line 110 of file cartography.c.

Referenced by nav_survey_losange_carto().

bool_t ProjectionInsideLimitOfRail

Definition at line 131 of file cartography.c.

Referenced by nav_survey_losange_carto().

int railnumber

Definition at line 100 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float signforturn

Definition at line 119 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

bool_t survey_losange_uturn

Definition at line 98 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().

float tempcircleradius

Definition at line 121 of file cartography.c.

Referenced by nav_survey_losange_carto().

float tempx

Definition at line 117 of file cartography.c.

Referenced by nav_survey_losange_carto().

float tempy

Definition at line 117 of file cartography.c.

Referenced by nav_survey_losange_carto().

struct point vec12 vec13
static

Definition at line 111 of file cartography.c.

Referenced by nav_survey_losange_carto(), and nav_survey_losange_carto_init().