Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
common_flight_plan.h File Reference

Common flight_plan functions shared between fixedwing and rotorcraft. More...

#include "std.h"
+ Include dependency graph for common_flight_plan.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define InitStage()   nav_init_stage();
 
#define Block(x)   case x: nav_block=x;
 
#define NextBlock()   nav_goto_block(nav_block + 1)
 
#define GotoBlock(b)   nav_goto_block(b)
 
#define Stage(s)   case s: nav_stage=s;
 
#define NextStage()   { nav_stage++; InitStage(); } INTENTIONAL_FALLTHRU
 
#define NextStageAndBreak()   { nav_stage++; InitStage(); break; }
 
#define NextStageAndBreakFrom(wp)   { last_wp = wp; NextStageAndBreak(); }
 
#define Label(x)   label_ ## x:
 
#define Goto(x)   { goto label_ ## x; }
 
#define Return(x)   { nav_block=last_block; if (x==1) {nav_stage=0;} else {nav_stage=last_stage;} block_time=0;}
 
#define NavBlockTime()   (block_time)
 Time in s since the entrance in the current block. More...
 

Functions

void nav_init_stage (void)
 needs to be implemented by fixedwing and rotorcraft seperately More...
 
void nav_init_block (void)
 
void nav_goto_block (uint8_t block_id)
 

Variables

uint16_t stage_time
 In s. More...
 
uint16_t block_time
 
uint8_t nav_stage
 
uint8_t nav_block
 
uint8_t last_block
 To save the current block/stage to enable return. More...
 
uint8_t last_stage
 
uint8_t last_wp
 

Detailed Description

Common flight_plan functions shared between fixedwing and rotorcraft.

Definition in file common_flight_plan.h.

Macro Definition Documentation

◆ Block

#define Block (   x)    case x: nav_block=x;

Definition at line 47 of file common_flight_plan.h.

◆ Goto

#define Goto (   x)    { goto label_ ## x; }

Definition at line 57 of file common_flight_plan.h.

◆ GotoBlock

#define GotoBlock (   b)    nav_goto_block(b)

Definition at line 49 of file common_flight_plan.h.

◆ InitStage

#define InitStage ( )    nav_init_stage();

Definition at line 45 of file common_flight_plan.h.

◆ Label

#define Label (   x)    label_ ## x:

Definition at line 56 of file common_flight_plan.h.

◆ NavBlockTime

#define NavBlockTime ( )    (block_time)

Time in s since the entrance in the current block.

Definition at line 61 of file common_flight_plan.h.

◆ NextBlock

#define NextBlock ( )    nav_goto_block(nav_block + 1)

Definition at line 48 of file common_flight_plan.h.

◆ NextStage

#define NextStage ( )    { nav_stage++; InitStage(); } INTENTIONAL_FALLTHRU

Definition at line 52 of file common_flight_plan.h.

◆ NextStageAndBreak

#define NextStageAndBreak ( )    { nav_stage++; InitStage(); break; }

Definition at line 53 of file common_flight_plan.h.

◆ NextStageAndBreakFrom

#define NextStageAndBreakFrom (   wp)    { last_wp = wp; NextStageAndBreak(); }

Definition at line 54 of file common_flight_plan.h.

◆ Return

#define Return (   x)    { nav_block=last_block; if (x==1) {nav_stage=0;} else {nav_stage=last_stage;} block_time=0;}

Definition at line 58 of file common_flight_plan.h.

◆ Stage

#define Stage (   s)    case s: nav_stage=s;

Definition at line 51 of file common_flight_plan.h.

Function Documentation

◆ nav_goto_block()

void nav_goto_block ( uint8_t  block_id)

Definition at line 51 of file common_flight_plan.c.

References b, last_block, last_stage, nav_block, nav_init_block(), and nav_stage.

Referenced by gsm_receive_content(), mavlink_block_message_handler(), and nav_parse_BLOCK().

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

◆ nav_init_block()

void nav_init_block ( void  )

Definition at line 41 of file common_flight_plan.c.

References block_time, InitStage, nav_block, and nav_stage.

Referenced by nav_goto_block().

+ Here is the caller graph for this function:

◆ nav_init_stage()

Variable Documentation

◆ block_time

uint16_t block_time

Definition at line 33 of file common_flight_plan.h.

◆ last_block

uint8_t last_block
extern

To save the current block/stage to enable return.

Definition at line 37 of file common_flight_plan.c.

Referenced by nav_goto_block().

◆ last_stage

uint8_t last_stage

Definition at line 36 of file common_flight_plan.h.

◆ last_wp

uint8_t last_wp
extern

◆ nav_block

uint8_t nav_block

Definition at line 35 of file common_flight_plan.h.

◆ nav_stage

uint8_t nav_stage
extern

Definition at line 34 of file common_flight_plan.c.

Referenced by nav_goto_block(), nav_init(), nav_init_block(), and send_nav_status().

◆ stage_time