Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vi_overo_link.c
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Copyright (C) 2010 The Paparazzi Team
5  *
6  * This file is part of paparazzi.
7  *
8  * paparazzi is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2, or (at your option)
11  * any later version.
12  *
13  * paparazzi is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with paparazzi; see the file COPYING. If not, write to
20  * the Free Software Foundation, 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23 
25 
26 #include "lisa/lisa_overo_link.h"
27 #include "subsystems/imu.h"
28 #include "subsystems/gps.h"
30 
31 
32 #include <string.h>
33 
34 static inline void on_overo_link_lost(void);
35 
36 void vi_impl_init(void) {
39 }
40 
41 void vi_impl_periodic(void) {
43 }
44 
45 void vi_impl_set_enabled(bool_t enabled __attribute__ ((unused))) {
46 
47 }
48 
49 static inline void on_overo_link_lost(void) {
50 
51 }
52 
54 
55  overo_link.up.msg.valid_sensors = vi.available_sensors;
56 
57  if (vi.available_sensors & (1<<VI_IMU_DATA_VALID)) {
60  vi.available_sensors &= ~(1<<VI_IMU_DATA_VALID);
61  }
62  if (vi.available_sensors & (1<<VI_MAG_DATA_VALID)) {
64  vi.available_sensors &= ~(1<<VI_MAG_DATA_VALID);
65  }
66  if (vi.available_sensors & (1<<VI_GPS_DATA_VALID)) {
69  vi.available_sensors &= ~(1<<VI_GPS_DATA_VALID);
70  }
71  if (vi.available_sensors & (1<<VI_BARO_ABS_DATA_VALID)) {
72  overo_link.up.msg.pressure_absolute = baro.absolute;
73  vi.available_sensors &= ~(1<<VI_BARO_ABS_DATA_VALID);
74  }
75 
76 }
77 
78 
80 
81 
82 }
83 
84 
86  vi.available_sensors |= (1<<VI_IMU_DATA_VALID);
87 }
88 
90  vi.available_sensors |= (1<<VI_GPS_DATA_VALID);
91 }
92 
94  vi.available_sensors |= (1<<VI_MAG_DATA_VALID);
95 }
96 
98  vi.available_sensors |= (1<<VI_BARO_ABS_DATA_VALID);
99 }
uint8_t available_sensors
Definition: vi.h:85
struct VehicleInterface vi
Definition: vi.c:32
struct EcefCoor_i ecef_vel
speed ECEF in cm/s
Definition: gps.h:67
#define RATES_COPY(_a, _b)
Definition: pprz_algebra.h:303
struct Int32Vect3 accel
accelerometer measurements
Definition: imu.h:41
struct EcefCoor_i ecef_pos
position in ECEF in cm
Definition: gps.h:63
int32_t absolute
Definition: baro.h:42
struct Baro baro
Definition: baro_board.c:34
Device independent GPS code (interface)
Inertial Measurement Unit interface.
struct Int32Vect3 mag
magnetometer measurements
Definition: imu.h:42
struct Int32Rates gyro
gyroscope measurements
Definition: imu.h:40
#define VECT3_COPY(_a, _b)
Definition: pprz_algebra.h:113
struct Imu imu
global IMU state
Definition: imu_aspirin2.c:50
__attribute__((always_inline))
Definition: i2c_arch.c:35
struct GpsState gps
global GPS state
Definition: gps.c:31