Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ins_vn100.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010 ENAC
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  */
22 
29 #ifndef INS_VN100_H
30 #define INS_VN100_H
31 
32 #include "std.h"
33 #include "VN100.h"
35 
36 /* neutrals */
37 extern float ins_roll_neutral;
38 extern float ins_pitch_neutral;
39 extern float ins_yaw_neutral;
40 
41 /* state */
42 extern struct FloatEulers ins_eulers;
43 extern struct FloatQuat ins_quat;
44 extern struct FloatRates ins_rates;
45 extern struct FloatRMat ins_rmat;
46 extern struct FloatVect3 ins_accel;
47 extern struct FloatVect3 ins_mag;
48 
49 extern volatile uint8_t ins_msg_received;
50 
51 extern void vn100_init(void);
52 extern void vn100_periodic_task(void);
53 extern void vn100_event_task(void);
54 extern void vn100_report_task(void);
55 
56 /* last received SPI packet */
58 /* last send packet */
60 
61 /* output mode */
62 extern uint32_t ins_ador;
63 extern uint32_t ins_adof;
64 extern uint32_t ins_baud;
65 
66 #ifndef VN100_ADOR
67 #define VN100_ADOR VN100_ADOR_OFF
68 #endif
69 #ifndef VN100_ADOF
70 #define VN100_ADOF VN100_ADOF_5HZ
71 #endif
72 #ifndef VN100_BAUD
73 #define VN100_BAUD VN100_Baud_57600
74 #endif
75 
76 /* Init sequence */
78 #define INS_VN100_SET_BAUD 0
79 #define INS_VN100_SET_ADOR 1
80 #define INS_VN100_SET_ADOF 2
81 #define INS_VN100_READY 3
82 
83 /* Telemetry */
84 #define PERIODIC_SEND_AHRS(_chan, _dev) DOWNLINK_SEND_AHRS_LKF(_chan, _dev, \
85  &ins_eulers.phi, &ins_eulers.theta, &ins_eulers.psi, \
86  &ins_quat.qi, &ins_quat.qx, &ins_quat.qy, &ins_quat.qz, \
87  &ins_rates.p, &ins_rates.q, &ins_rates.r, \
88  &ins_accel.x, &ins_accel.y, &ins_accel.z, \
89  &ins_mag.x, &ins_mag.y, &ins_mag.z)
90 
91 #endif /* INS_VN100_H */
struct FloatVect3 ins_accel
Definition: ins_vn100.c:61
struct FloatQuat ins_quat
Definition: ins_vn100.c:58
float ins_roll_neutral
Definition: ins_arduimu.c:14
struct FloatEulers ins_eulers
Definition: ins_vn100.c:57
uint8_t ins_init_status
Definition: ins_vn100.c:76
VN100_Res_Packet last_received_packet
Definition: ins_vn100.c:67
volatile uint8_t ins_msg_received
Definition: ins_vn100.c:64
uint32_t ins_adof
Definition: ins_vn100.c:73
void vn100_periodic_task(void)
Definition: ins_vn100.c:140
void vn100_init(void)
Definition: ins_vn100.c:85
uint32_t ins_baud
Definition: ins_vn100.c:74
struct FloatVect3 ins_mag
Definition: ins_vn100.c:62
euler angles
Roation quaternion.
float ins_pitch_neutral
Definition: ins_arduimu.c:15
Paparazzi floating point algebra.
unsigned long uint32_t
Definition: types.h:18
void vn100_event_task(void)
Definition: ins_vn100.c:160
uint32_t ins_ador
Definition: ins_vn100.c:72
void vn100_report_task(void)
Definition: ins_vn100.c:311
struct FloatRates ins_rates
Definition: ins_vn100.c:59
struct FloatRMat ins_rmat
Definition: ins_vn100.c:60
VN100_Req_Packet last_send_packet
Definition: ins_vn100.c:69
unsigned char uint8_t
Definition: types.h:14
rotation matrix
float ins_yaw_neutral
Definition: ins_vn100.c:55
angular rates