Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
ins_vectornav.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Michal Podhradsky, michal.podhradsky@aggiemail.usu.edu
3  * Utah State University, http://aggieair.usu.edu/
4  *
5  * This file is part of paparazzi.
6  *
7  * paparazzi is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  *
12  * paparazzi is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with paparazzi; see the file COPYING. If not, write to
19  * the Free Software Foundation, 59 Temple Place - Suite 330,
20  * Boston, MA 02111-1307, USA.
21  */
29 #ifndef INS_VECTORNAV_H
30 #define INS_VECTORNAV_H
31 
32 // Subsystems
33 #include "subsystems/gps.h"
34 #include "subsystems/ins.h"
35 
36 // Peripheral
38 
39 // Geodetic / Math
40 #include "math/pprz_algebra.h"
41 #include "math/pprz_geodetic_int.h"
43 #include "math/pprz_geodetic_int.h"
44 #include "math/pprz_isa.h"
45 
46 // Generated
47 #include "generated/airframe.h"
48 
49 // Systime
50 #include "mcu_periph/sys_time.h"
51 
52 // Abi
53 #include "subsystems/abi.h"
54 
55 
56 #if !defined INS_VN_BODY_TO_IMU_PHI && !defined INS_VN_BODY_TO_IMU_THETA && !defined INS_VN_BODY_TO_IMU_PSI
57 #define INS_VN_BODY_TO_IMU_PHI 0
58 #define INS_VN_BODY_TO_IMU_THETA 0
59 #define INS_VN_BODY_TO_IMU_PSI 0
60 #endif
61 
62 
63 // Ins implementation state (fixed point)
64 struct InsVectornav {
65  struct LtpDef_i ltp_def; // initial position
66  bool ltp_initialized; // status indicator
67 
68  // output LTP NED for telemetry messages
74 
75  // baro [height above ground]
76  float baro_z;
77  float qfe;
78 
79  // Packet data
81  struct VNData vn_data;
84 
85  // in fixed point for sending as ABI and telemetry msgs
88 
91 };
92 
93 
94 // global INS state
95 extern struct InsVectornav ins_vn;
96 
97 extern void ins_vectornav_init(void);
98 extern void ins_vectornav_event(void);
99 extern void ins_vectornav_set_sacc(void);
100 extern void ins_vectornav_set_pacc(void);
101 extern void ins_vectornav_propagate(void);
102 extern void ins_vectornav_monitor(void);
103 
104 #endif /* INS_VECTORNAV_H */
ins_vectornav_set_sacc
void ins_vectornav_set_sacc(void)
Set speed (velocity) uncertainty (NED) speed accuracy in cm/s.
Definition: ins_vectornav.c:217
InsVectornav::gyro_i
struct Int32Rates gyro_i
Definition: ins_vectornav.h:87
OrientationReps
Definition: pprz_orientation_conversion.h:79
ins.h
uint16_t
unsigned short uint16_t
Definition: types.h:16
NedCoor_f
vector in North East Down coordinates Units: meters
Definition: pprz_geodetic_float.h:63
InsVectornav::ltp_pos_i
struct NedCoor_i ltp_pos_i
Definition: ins_vectornav.h:69
Int32Rates
angular rates
Definition: pprz_algebra_int.h:179
abi.h
LtpDef_i
definition of the local (flat earth) coordinate system
Definition: pprz_geodetic_int.h:98
pprz_geodetic_int.h
Paparazzi fixed point math for geodetic calculations.
ins_vectornav_propagate
void ins_vectornav_propagate(void)
Propagate the received states into the vehicle state machine.
Definition: ins_vectornav.c:244
InsVectornav::vn_rate
uint16_t vn_rate
data frequency
Definition: ins_vectornav.h:83
pprz_algebra_float.h
Paparazzi floating point algebra.
InsVectornav::lla_pos
struct LlaCoor_f lla_pos
Definition: ins_vectornav.h:72
VNPacket
Definition: vn200_serial.h:62
InsVectornav::body_to_imu
struct OrientationReps body_to_imu
body_to_imu rotation
Definition: ins_vectornav.h:90
ins_vectornav_set_pacc
void ins_vectornav_set_pacc(void)
Find maximum uncertainty (NED) position accuracy in cm.
Definition: ins_vectornav.c:226
gps.h
Device independent GPS code (interface)
InsVectornav::vn_packet
struct VNPacket vn_packet
Packet struct.
Definition: ins_vectornav.h:80
NedCoor_i
vector in North East Down coordinates
Definition: pprz_geodetic_int.h:68
Int32Vect3
Definition: pprz_algebra_int.h:88
sys_time.h
Architecture independent timing functions.
VNStatus
VNStatus
Definition: vn200_serial.h:78
InsVectornav::ltp_def
struct LtpDef_i ltp_def
Definition: ins_vectornav.h:65
InsVectornav::accel_i
struct Int32Vect3 accel_i
Definition: ins_vectornav.h:86
InsVectornav::ltp_speed_i
struct NedCoor_i ltp_speed_i
Definition: ins_vectornav.h:70
InsVectornav::vn_status
enum VNStatus vn_status
VN status.
Definition: ins_vectornav.h:82
InsVectornav::ltp_initialized
bool ltp_initialized
Definition: ins_vectornav.h:66
vn200_serial.h
ins_vectornav_monitor
void ins_vectornav_monitor(void)
Monitors vectornav data rate and changes GPS lock if the data rate is too low.
Definition: ins_vectornav.c:112
InsVectornav::vn_data
struct VNData vn_data
Data struct.
Definition: ins_vectornav.h:81
InsVectornav::qfe
float qfe
Definition: ins_vectornav.h:77
InsVectornav::baro_z
float baro_z
z-position calculated from baro in meters (z-down)
Definition: ins_vectornav.h:76
InsVectornav::ltp_accel_f
struct NedCoor_f ltp_accel_f
Definition: ins_vectornav.h:73
pprz_algebra.h
Paparazzi generic algebra macros.
InsVectornav
Definition: ins_vectornav.h:64
VNData
Definition: vn200_serial.h:84
ins_vectornav_event
void ins_vectornav_event(void)
Event handling for Vectornav.
Definition: ins_vectornav.c:146
ins_vectornav_init
void ins_vectornav_init(void)
Initialize Vectornav struct.
Definition: ins_vectornav.c:163
InsVectornav::ltp_accel_i
struct NedCoor_i ltp_accel_i
Definition: ins_vectornav.h:71
pprz_isa.h
Paparazzi atmospheric pressure conversion utilities.
ins_vn
struct InsVectornav ins_vn
Definition: ins_vectornav.c:32
LlaCoor_f
vector in Latitude, Longitude and Altitude
Definition: pprz_geodetic_float.h:54