Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
vn200_serial.c File Reference

Vectornav VN-200 INS subsystem. More...

+ Include dependency graph for vn200_serial.c:

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...
 

Detailed Description

Vectornav VN-200 INS subsystem.

Author
Michal Podhradsky micha.nosp@m.l.po.nosp@m.dhrad.nosp@m.sky@.nosp@m.aggie.nosp@m.mail.nosp@m..usu..nosp@m.edu

Definition in file vn200_serial.c.

Function Documentation

◆ calculateCRC()

static unsigned short calculateCRC ( unsigned char  data[],
unsigned int  length 
)
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 72 of file vn200_serial.c.

References logger_uart_parse::crc.

Referenced by verify_chk().

+ Here is the caller graph for this function:

◆ verify_chk()

static bool verify_chk ( unsigned char  data[],
unsigned int  length,
uint16_t calc_chk,
uint16_t rec_chk 
)
inlinestatic

Verify checksum.

Definition at line 90 of file vn200_serial.c.

References calculateCRC().

Referenced by vn200_parse().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vn200_check_status()

void vn200_check_status ( struct VNData vn_data)

Check INS status.

Definition at line 41 of file vn200_serial.c.

References VNData::err, VNData::ins_status, and VNData::mode.

Referenced by vn200_read_message().

+ Here is the caller graph for this function:

◆ vn200_event()

void vn200_event ( struct VNPacket vnp)

Definition at line 113 of file vn200_serial.c.

References dev, and vn200_read_buffer().

Referenced by ahrs_vectornav_event(), imu_vectornav_event(), and ins_vectornav_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vn200_parse()

void vn200_parse ( struct VNPacket vnp,
uint8_t  c 
)

◆ vn200_read_buffer()

static void vn200_read_buffer ( struct VNPacket vnp)
inlinestatic

Definition at line 104 of file vn200_serial.c.

References dev, VNPacket::msg_available, and vn200_parse().

Referenced by vn200_event().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ vn200_read_message()

void vn200_read_message ( struct VNPacket vn_packet,
struct VNData vn_data 
)

◆ vn200_yaw_pitch_roll_to_attitude()

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 54 of file vn200_serial.c.

References FloatEulers::phi, FloatEulers::psi, and FloatEulers::theta.

Referenced by vn200_read_message().

+ Here is the caller graph for this function: