Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
vn200_serial.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 VN200_SERIAl_H
30#define VN200_SERIAl_H
31
32#include "std.h"
33
34// Geodetic / Math
35#include "math/pprz_algebra.h"
39#include "math/pprz_isa.h"
40
41/*
42 * Defines for the serial communication
43 */
44#define VN_SYNC 0xFA
45#define VN_OUTPUT_GROUP 0x39
46#define VN_GROUP_BYTES 8
47
48#define VN_BUFFER_SIZE 512
49#define VN_HEADER_SIZE 9
50#define VN_PAYLOAD_SIZE 144
51
52
60
76
82
83struct VNData {
84 uint64_t nanostamp; // Timestamp [nanoseconds] since startup
85 float timestamp;
86 float ypr[3];
90 float pos_u[3];
91 float vel_u;
101 double pos_lla[3]; // Lla [deg, deg, m above elipsoid]
103};
104
105void vn200_event(struct VNPacket *vnp);
106void vn200_read_message(struct VNPacket *vnp, struct VNData *vndata);
107void vn200_parse(struct VNPacket *vnp, uint8_t c);
108
109
110#endif /* VN200_SERIAl_H */
euler angles
angular rates
uint16_t foo
Definition main_demo5.c:58
Paparazzi generic algebra macros.
Paparazzi floating point algebra.
Paparazzi floating point math for geodetic calculations.
vector in North East Down coordinates Units: meters
Paparazzi fixed point math for geodetic calculations.
Paparazzi atmospheric pressure conversion utilities.
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned long long uint64_t
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.
uint16_t framing_error
uint32_t hdr_error
uint8_t err
see page 122 of VN-200 datasheet
VNStatus
@ VNOutOfSpecs
@ VNNotTracking
@ VNOK
uint16_t overrun_error
struct FloatRates gyro
Rates in the imu frame m/s.
struct FloatEulers attitude
Attitude, float, [rad], yaw, pitch, roll.
uint16_t datalength
uint8_t msg_buf[VN_BUFFER_SIZE]
uint16_t calc_chk
void vn200_event(struct VNPacket *vnp)
struct FloatEulers ypr_u
Attitude uncertainty, 1sigma, float, [degrees], yaw, pitch, roll.
float ypr[3]
yaw, pitch, roll [deg]
uint64_t tow
tow (in nanoseconds), uint64
#define VN_BUFFER_SIZE
struct FloatVect3 accel
Acceleration in the imu frame, m/s.
uint8_t mode
0-not tracking, 1 - poor performance, 2- OK
float timestamp
Time since VN startup [s].
float pos_u[3]
The current GPS position uncertainty in the North East Down (NED) coordinate frame,...
VNMsgStatus
@ VNMsgData
@ VNMsgHeader
@ VNMsgCheck
@ VNMsgSync
@ VNMsgGroup
uint16_t ins_status
see page 122 of VN-200 datasheet
struct FloatVect3 vel_body
The estimated velocity in the imu frame, given in m/s.
double pos_lla[3]
float vel_u
NED velocity uncertainty [m/s].
uint8_t gps_fix
None|2D|3D.
uint8_t num_sv
number of visible satellites
void vn200_read_message(struct VNPacket *vnp, struct VNData *vndata)
Read received message and populate data struct with new measurements.
struct FloatVect3 lin_accel
Linear acceleration in imu frame [m/s^2].
uint16_t counter
uint64_t nanostamp
bool msg_available
struct NedCoor_f vel_ned
The estimated velocity in the North East Down (NED) frame, given in m/s.
void vn200_parse(struct VNPacket *vnp, uint8_t c)
Packet Collection & state machine.
uint16_t noise_error
uint16_t rec_chk
uint32_t chksm_error
uint8_t msg_idx
enum VNMsgStatus status