Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
common_flight_plan.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007-2011 The Paparazzi Team
3  *
4  * This file is part of paparazzi.
5  *
6  * paparazzi is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * paparazzi is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with paparazzi; see the file COPYING. If not, write to
18  * the Free Software Foundation, 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
27 #ifndef COMMON_FLIGHT_PLAN_H
28 #define COMMON_FLIGHT_PLAN_H
29 
30 #include "std.h"
31 
34 
37 extern uint8_t last_wp __attribute__((unused));
38 
40 void nav_init_stage(void);
41 
42 void nav_init_block(void);
43 void nav_goto_block(uint8_t block_id);
44 
45 #define InitStage() nav_init_stage();
46 
47 #define Block(x) case x: nav_block=x;
48 #define NextBlock() nav_goto_block(nav_block + 1)
49 #define GotoBlock(b) nav_goto_block(b)
50 
51 #define Stage(s) case s: nav_stage=s;
52 #define NextStage() { nav_stage++; InitStage(); } INTENTIONAL_FALLTHRU
53 #define NextStageAndBreak() { nav_stage++; InitStage(); break; }
54 #define NextStageAndBreakFrom(wp) { last_wp = wp; NextStageAndBreak(); }
55 
56 #define Label(x) label_ ## x:
57 #define Goto(x) { goto label_ ## x; }
58 #define Return(x) { nav_block=last_block; if (x==1) {nav_stage=0;} else {nav_stage=last_stage;} block_time=0;}
59 
61 #define NavBlockTime() (block_time)
62 
63 #endif /* COMMON_FLIGHT_PLAN_H */
uint8_t nav_stage
void nav_init_stage(void)
needs to be implemented by fixedwing and rotorcraft seperately
Definition: nav.c:92
uint8_t last_wp
uint8_t last_block
To save the current block/stage to enable return.
uint8_t last_stage
uint8_t nav_block
void nav_init_block(void)
void nav_goto_block(uint8_t block_id)
uint16_t stage_time
In s.
uint16_t block_time
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
Definition: vl53l1_types.h:88
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98