Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
vi_overo_link.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 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 
23 
24 #include "lisa/lisa_overo_link.h"
25 #include "subsystems/imu.h"
26 #include "subsystems/gps.h"
28 
29 
30 #include <string.h>
31 
32 static inline void on_overo_link_lost(void);
33 
34 void vi_impl_init(void) {
37 }
38 
39 void vi_impl_periodic(void) {
41 }
42 
43 void vi_impl_set_enabled(bool_t enabled __attribute__ ((unused))) {
44 
45 }
46 
47 static inline void on_overo_link_lost(void) {
48 
49 }
50 
52 
53  overo_link.up.msg.valid_sensors = vi.available_sensors;
54 
55  if (vi.available_sensors & (1<<VI_IMU_DATA_VALID)) {
58  vi.available_sensors &= ~(1<<VI_IMU_DATA_VALID);
59  }
60  if (vi.available_sensors & (1<<VI_MAG_DATA_VALID)) {
62  vi.available_sensors &= ~(1<<VI_MAG_DATA_VALID);
63  }
64  if (vi.available_sensors & (1<<VI_GPS_DATA_VALID)) {
67  vi.available_sensors &= ~(1<<VI_GPS_DATA_VALID);
68  }
69  if (vi.available_sensors & (1<<VI_BARO_ABS_DATA_VALID)) {
70  overo_link.up.msg.pressure_absolute = baro.absolute;
71  vi.available_sensors &= ~(1<<VI_BARO_ABS_DATA_VALID);
72  }
73 
74 }
75 
76 
78 
79 
80 }
81 
82 
84  vi.available_sensors |= (1<<VI_IMU_DATA_VALID);
85 }
86 
88  vi.available_sensors |= (1<<VI_GPS_DATA_VALID);
89 }
90 
92  vi.available_sensors |= (1<<VI_MAG_DATA_VALID);
93 }
94 
96  vi.available_sensors |= (1<<VI_BARO_ABS_DATA_VALID);
97 }
uint8_t available_sensors
Definition: vi.h:83
struct VehicleInterface vi
Definition: vi.c:30
struct EcefCoor_i ecef_vel
speed ECEF in cm/s
Definition: gps.h:68
Common barometric sensor implementation.
#define RATES_COPY(_a, _b)
Definition: pprz_algebra.h:301
struct Int32Vect3 accel
accelerometer measurements
Definition: imu.h:41
struct EcefCoor_i ecef_pos
position in ECEF in cm
Definition: gps.h:64
int32_t absolute
Definition: baro.h:41
Device independent GPS code (interface)
struct Imu imu
global IMU state
Definition: imu_aspirin2.c:50
Inertial Measurement Unit interface.
struct Int32Vect3 mag
magnetometer measurements
Definition: imu.h:42
struct Baro baro
Definition: baro_board.c:36
struct Int32Rates gyro
gyroscope measurements
Definition: imu.h:40
#define VECT3_COPY(_a, _b)
Definition: pprz_algebra.h:111
struct GpsState gps
global GPS state
Definition: gps.c:33