Paparazzi UAS  v5.2.2_stable-0-gd6b9f29
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
vi.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2010 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 
22 #include "vehicle_interface/vi.h"
23 
24 #include "subsystems/imu.h"
25 #include "subsystems/ahrs.h"
26 #include "subsystems/gps.h"
27 
28 #include "generated/airframe.h"
29 
31 
32 #ifndef VI_TIMEOUT
33 #define VI_TIMEOUT 100
34 #endif
35 
36 void vi_init(void) {
37 
38  vi.enabled = FALSE;
39  vi.timeouted = TRUE;
41 
45  vi.input.v_sp.climb = 0;
46  vi_impl_init();
47 
48 }
49 
50 void vi_periodic(void) {
51 #if (VI_TIMEOUT != 0)
52  if (vi.last_msg < VI_TIMEOUT)
53  vi.last_msg++;
54  else {
55  vi.timeouted = TRUE;
59  vi.input.v_sp.climb = 0;
60  }
61 #endif
63 }
64 
65 void vi_set_enabled(bool_t enabled) {
66  vi_impl_set_enabled(enabled);
67 
68 }
69 
70 void vi_update_info(void) {
71 
72 }
void vi_periodic(void)
Definition: vi.c:50
void vi_impl_periodic(void)
Definition: vi_datalink.c:27
struct VehicleInterface vi
Definition: vi.c:30
Attitude and Heading Reference System interface.
struct Vi_command input
Definition: vi.h:82
void vi_init(void)
Definition: vi.c:36
bool_t timeouted
Definition: vi.h:79
#define GUIDANCE_H_MODE_ATTITUDE
Definition: guidance_h.h:54
void vi_set_enabled(bool_t enabled)
Definition: vi.c:65
#define INT_EULERS_ZERO(_e)
union Vi_command::@20 v_sp
#define FALSE
Definition: imu_chimu.h:141
Device independent GPS code (interface)
#define GUIDANCE_V_MODE_CLIMB
Definition: guidance_v.h:38
bool_t enabled
Definition: vi.h:78
void vi_impl_set_enabled(bool_t enabled)
Definition: vi_datalink.c:30
#define VI_TIMEOUT
Definition: vi.c:33
union Vi_command::@19 h_sp
Inertial Measurement Unit interface.
#define TRUE
Definition: imu_chimu.h:144
struct Int32Eulers attitude
Definition: vi.h:64
void vi_update_info(void)
Definition: vi.c:70
uint8_t last_msg
Definition: vi.h:80
int32_t climb
Definition: vi.h:70
uint8_t h_mode
Definition: vi.h:73
uint8_t v_mode
Definition: vi.h:74
void vi_impl_init(void)
Definition: vi_datalink.c:24