Paparazzi UAS  v5.18.0_stable
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 "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 {
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 
ahrs_vectornav_is_enabled
bool ahrs_vectornav_is_enabled(void)
Definition: ahrs_vectornav_wrapper.c:62
ahrs_vectornav_wrapper.h
abi.h
AHRS_COMP_ID_VECTORNAV
#define AHRS_COMP_ID_VECTORNAV
Definition: ahrs.h:43
ahrs_vectornav_enable_output
static bool ahrs_vectornav_enable_output(bool enable)
Definition: ahrs_vectornav_wrapper.c:56
AHRS_VECTORNAV_OUTPUT_ENABLED
#define AHRS_VECTORNAV_OUTPUT_ENABLED
Definition: ahrs_vectornav_wrapper.c:34
VNData::attitude
struct FloatEulers attitude
Attitude, float, [rad], yaw, pitch, roll.
Definition: vn200_serial.h:88
ahrs_vectornav_id
static uint8_t ahrs_vectornav_id
Definition: ahrs_vectornav_wrapper.c:40
FloatEulers::theta
float theta
in radians
Definition: pprz_algebra_float.h:86
ahrs_vn
struct AhrsVectornav ahrs_vn
Definition: ahrs_vectornav.c:33
telemetry.h
FloatEulers::phi
float phi
in radians
Definition: pprz_algebra_float.h:85
ahrs_vectornav_output_enabled
static bool ahrs_vectornav_output_enabled
if TRUE with push the estimation results to the state interface
Definition: ahrs_vectornav_wrapper.c:39
dev
static const struct usb_device_descriptor dev
Definition: usb_ser_hw.c:74
ahrs_vectornav_register
void ahrs_vectornav_register(void)
Definition: ahrs_vectornav_wrapper.c:66
uint8_t
unsigned char uint8_t
Definition: types.h:14
register_periodic_telemetry
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Definition: telemetry.c:46
ahrs.h
send_euler
static void send_euler(struct transport_tx *trans, struct link_device *dev)
Definition: ahrs_vectornav_wrapper.c:45
AhrsVectornav::vn_data
struct VNData vn_data
Data struct.
Definition: ahrs_vectornav.h:50
ahrs_vectornav_init
void ahrs_vectornav_init(void)
Initialize Vectornav struct.
Definition: ahrs_vectornav.c:96
ahrs_register_impl
void ahrs_register_impl(AhrsEnableOutput enable)
Register an AHRS implementation.
Definition: ahrs.c:62
state.h
FloatEulers::psi
float psi
in radians
Definition: pprz_algebra_float.h:87
DefaultPeriodic
#define DefaultPeriodic
Set default periodic telemetry.
Definition: telemetry.h:66