Paparazzi UAS  v5.15_devel-88-gb3ad7fe
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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 "subsystems/ahrs.h"
30 #include "subsystems/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 {
58  ahrs_vectornav_output_enabled = enable;
60 }
61 
64 }
65 
67 {
68  ahrs_vectornav_output_enabled = AHRS_VECTORNAV_OUTPUT_ENABLED;
71 
72 #if PERIODIC_TELEMETRY
73  register_periodic_telemetry(DefaultPeriodic, PPRZ_MSG_ID_AHRS_EULER, send_euler);
74 #endif
75 }
76 
Dispatcher to register actual AHRS implementations.
float phi
in radians
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
Periodic telemetry system header (includes downlink utility and generated code).
Main include for ABI (AirBorneInterface).
float psi
in radians
static void send_euler(struct transport_tx *trans, struct link_device *dev)
struct FloatEulers attitude
Attitude, float, [rad], yaw, pitch, roll.
Definition: vn200_serial.h:88
float theta
in radians
void ahrs_register_impl(AhrsEnableOutput enable)
Register an AHRS implementation.
Definition: ahrs.c:62
Vectornav VN-200 as AHRS.
#define DefaultPeriodic
Set default periodic telemetry.
Definition: telemetry.h:66
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:73
static bool ahrs_vectornav_enable_output(bool enable)
unsigned char uint8_t
Definition: types.h:14
API to get/set the generic vehicle states.
bool ahrs_vectornav_is_enabled(void)
#define AHRS_COMP_ID_VECTORNAV
Definition: ahrs.h:43
#define AHRS_VECTORNAV_OUTPUT_ENABLED
static uint8_t ahrs_vectornav_id
struct AhrsVectornav ahrs_vn
void ahrs_vectornav_register(void)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition: telemetry.c:46