Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
ahrs_vectornav_wrapper.c
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 Michal Podhradsky, michal.podhradsky@aggiemail.usu.edu
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  */
29 #include "modules/ahrs/ahrs.h"
30 #include "modules/core/abi.h"
31 #include "state.h"
32 
33 #ifndef AHRS_VECTORNAV_OUTPUT_ENABLED
34 #define AHRS_VECTORNAV_OUTPUT_ENABLED TRUE
35 #endif
36 PRINT_CONFIG_VAR(AHRS_VECTORNAV_OUTPUT_ENABLED)
37 
38 
41 
42 #if PERIODIC_TELEMETRY
44 
45 static void send_euler(struct transport_tx *trans, struct link_device *dev)
46 {
47  pprz_msg_send_AHRS_EULER(trans, dev, AC_ID,
52 }
53 #endif
54 
55 
56 static bool ahrs_vectornav_enable_output(bool enable)
57 {
60 }
61 
64 }
65 
67 {
71 
72 #if PERIODIC_TELEMETRY
73  register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_AHRS_EULER, send_euler);
74 #endif
75 }
76 
Main include for ABI (AirBorneInterface).
void ahrs_register_impl(AhrsEnableOutput enable)
Register an AHRS implementation.
Definition: ahrs.c:62
Dispatcher to register actual AHRS implementations.
#define AHRS_COMP_ID_VECTORNAV
Definition: ahrs.h:43
struct AhrsVectornav ahrs_vn
void ahrs_vectornav_init(void)
Initialize Vectornav struct.
struct VNData vn_data
Data struct.
static bool ahrs_vectornav_output_enabled
if TRUE with push the estimation results to the state interface
bool ahrs_vectornav_is_enabled(void)
void ahrs_vectornav_register(void)
#define AHRS_VECTORNAV_OUTPUT_ENABLED
static uint8_t ahrs_vectornav_id
static void send_euler(struct transport_tx *trans, struct link_device *dev)
static bool ahrs_vectornav_enable_output(bool enable)
Vectornav VN-200 as AHRS.
float phi
in radians
float theta
in radians
float psi
in radians
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition: telemetry.c:51
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
Definition: telemetry.h:66
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
Definition: vl53l1_types.h:98
struct FloatEulers attitude
Attitude, float, [rad], yaw, pitch, roll.
Definition: vn200_serial.h:87