Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
|
Vectornav VN-200 INS subsystem. More...
#include "peripherals/vn200_serial.h"
Go to the source code of this file.
Functions | |
void | vn200_check_status (struct VNData *vn_data) |
Check INS status. More... | |
void | vn200_yaw_pitch_roll_to_attitude (struct FloatEulers *vn_attitude) |
Convert yaw, pitch, and roll data from VectorNav to correct attitude yaw(0), pitch(1), roll(2) -> phi, theta, psi [deg] -> rad. More... | |
static unsigned short | calculateCRC (unsigned char data[], unsigned int length) |
Calculates the 16-bit CRC for the given ASCII or binary message. More... | |
static bool | verify_chk (unsigned char data[], unsigned int length, uint16_t *calc_chk, uint16_t *rec_chk) |
Verify checksum. More... | |
static void | vn200_read_buffer (struct VNPacket *vnp) |
void | vn200_event (struct VNPacket *vnp) |
void | vn200_parse (struct VNPacket *vnp, uint8_t c) |
Packet Collection & state machine. More... | |
void | vn200_read_message (struct VNPacket *vn_packet, struct VNData *vn_data) |
Read received message and populate data struct with new measurements. More... | |
Vectornav VN-200 INS subsystem.
Definition in file vn200_serial.c.
|
inlinestatic |
Calculates the 16-bit CRC for the given ASCII or binary message.
The CRC is calculated over the packet starting just after the sync byte (not including the sync byte) and ending at the end of payload.
Definition at line 70 of file vn200_serial.c.
References crc.
Referenced by verify_chk().
|
inlinestatic |
Verify checksum.
Definition at line 88 of file vn200_serial.c.
References calculateCRC().
Referenced by vn200_parse().
void vn200_check_status | ( | struct VNData * | vn_data | ) |
Check INS status.
Definition at line 39 of file vn200_serial.c.
References VNData::err, VNData::ins_status, and VNData::mode.
Referenced by vn200_read_message().
void vn200_event | ( | struct VNPacket * | vnp | ) |
Definition at line 110 of file vn200_serial.c.
References uart_char_available(), and vn200_read_buffer().
Referenced by ahrs_vectornav_event(), imu_vectornav_event(), and ins_vectornav_event().
Packet Collection & state machine.
Definition at line 121 of file vn200_serial.c.
References VNPacket::calc_chk, VNPacket::chksm_error, VNPacket::counter, VNPacket::datalength, VNPacket::hdr_error, VNPacket::msg_available, VNPacket::msg_buf, VNPacket::msg_idx, VNPacket::rec_chk, VNPacket::status, verify_chk(), VN_GROUP_BYTES, VN_HEADER_SIZE, VN_OUTPUT_GROUP, VN_PAYLOAD_SIZE, VN_SYNC, VNMsgData, VNMsgGroup, VNMsgHeader, and VNMsgSync.
Referenced by vn200_read_buffer().
|
inlinestatic |
Definition at line 102 of file vn200_serial.c.
References VNPacket::msg_available, uart_char_available(), uart_getch(), and vn200_parse().
Referenced by vn200_event().
Read received message and populate data struct with new measurements.
Definition at line 180 of file vn200_serial.c.
References VNData::accel, VNData::attitude, VNData::gps_fix, VNData::gyro, idx, VNData::ins_status, VNData::lin_accel, VNPacket::msg_buf, VNData::nanostamp, VNData::num_sv, VNData::pos_lla, VNData::pos_u, VNData::timestamp, VNData::tow, VNData::vel_body, VNData::vel_ned, VNData::vel_u, vn200_check_status(), vn200_yaw_pitch_roll_to_attitude(), VN_HEADER_SIZE, and VNData::ypr_u.
Referenced by ahrs_vectornav_event(), imu_vectornav_event(), and ins_vectornav_event().
void vn200_yaw_pitch_roll_to_attitude | ( | struct FloatEulers * | vn_attitude | ) |
Convert yaw, pitch, and roll data from VectorNav to correct attitude yaw(0), pitch(1), roll(2) -> phi, theta, psi [deg] -> rad.
Definition at line 52 of file vn200_serial.c.
References FloatEulers::phi, FloatEulers::psi, and FloatEulers::theta.
Referenced by vn200_read_message().