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 
35 /* The modification of the following variables do not affect
36  * the behavior of the flight plan
37  */
40 extern uint8_t last_wp __attribute__((unused));
41 
42 /* init function */
43 extern void common_flight_plan_init(void);
44 
46 extern void nav_init_stage(void);
47 
48 extern void nav_init_block(void);
49 extern void nav_goto_block(uint8_t block_id);
50 extern void nav_goto_next_block(void);
51 extern void nav_goto_next_stage(void);
52 extern void nav_return(uint8_t reset);
53 
54 /* Getter */
55 extern uint8_t get_nav_block(void);
56 extern uint8_t get_nav_stage(void);
57 extern uint8_t get_last_block(void);
58 extern uint8_t get_last_stage(void);
59 
60 /* Setter */
61 extern void set_nav_block(uint8_t block_id);
62 extern void set_nav_stage(uint8_t stage_id);
63 
65 extern void nav_on_enter_block(uint8_t block_id);
66 extern void nav_on_exit_block(uint8_t block_id);
67 
68 #define InitStage() nav_init_stage();
69 
70 #define Block(x) case x: set_nav_block(x);
71 #define NextBlock() nav_goto_next_block()
72 #define GotoBlock(b) nav_goto_block(b)
73 
74 #define Stage(s) case s: set_nav_stage(s);
75 #define NextStage() { nav_goto_next_stage(); } INTENTIONAL_FALLTHRU
76 #define NextStageAndBreak() { nav_goto_next_stage(); break; }
77 #define NextStageAndBreakFrom(wp) { last_wp = wp; NextStageAndBreak(); }
78 
79 #define Label(x) label_ ## x:
80 #define Goto(x) { goto label_ ## x; }
81 #define Return(x) nav_return(x)
82 
84 #define NavBlockTime() (block_time)
85 
87 #define Ptr(x) (&(x))
88 
89 #endif /* COMMON_FLIGHT_PLAN_H */
90 
static uint8_t reset[3]
Definition: baro_MS5534A.c:83
uint8_t nav_stage
void nav_goto_next_stage(void)
uint8_t get_nav_stage(void)
void nav_return(uint8_t reset)
void nav_init_stage(void)
needs to be implemented by fixedwing and rotorcraft seperately
Definition: nav.c:92
uint8_t last_wp
uint8_t get_nav_block(void)
void nav_on_exit_block(uint8_t block_id)
uint8_t last_block
To save the current block/stage to enable return.
void nav_on_enter_block(uint8_t block_id)
Functions generated by the flight plan.
uint8_t last_stage
void set_nav_block(uint8_t block_id)
uint8_t nav_block
void nav_init_block(void)
uint8_t get_last_block(void)
void common_flight_plan_init(void)
void set_nav_stage(uint8_t stage_id)
void nav_goto_block(uint8_t block_id)
uint16_t stage_time
In s.
void nav_goto_next_block(void)
uint16_t block_time
uint8_t get_last_stage(void)
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