Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Vectornav VN-200 INS subsystem. More...
#include "subsystems/ins/ins_vectornav.h"
Go to the source code of this file.
Macros | |
#define | USE_INS_NAV_INIT TRUE |
Functions | |
PRINT_CONFIG_MSG ("USE_INS_NAV_INIT defaulting to TRUE") | |
void | ins_vectornav_event (void) |
Event handling for Vectornav. More... | |
void | ins_vectornav_init (void) |
Initialize Vectornav struct. More... | |
void | ins_vectornav_read_message (void) |
Read received data. More... | |
void | ins_vectornav_check_status (void) |
Check INS status. More... | |
void | ins_vectornav_set_sacc (void) |
Set speed (velocity) uncertainty (NED) speed accuracy in cm/s. More... | |
void | ins_vectornav_set_pacc (void) |
Find maximum uncertainty (NED) position accuracy in cm. More... | |
void | ins_vectornav_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... | |
void | ins_vectornav_propagate () |
Propagate the received states into the vehicle state machine. More... | |
void | ins_init_origin_from_flightplan (void) |
initialize the local origin (ltp_def) from flight plan position More... | |
Variables | |
struct InsVectornav | ins_vn |
Vectornav VN-200 INS subsystem.
Definition in file ins_vectornav.c.
#define USE_INS_NAV_INIT TRUE |
Definition at line 100 of file ins_vectornav.c.
void ins_init_origin_from_flightplan | ( | void | ) |
initialize the local origin (ltp_def) from flight plan position
Definition at line 442 of file ins_vectornav.c.
References LlaCoor_i::alt, ecef_of_lla_i(), LtpDef_i::hmsl, ins_vn, LlaCoor_i::lat, LlaCoor_i::lon, InsVectornav::ltp_def, ltp_def_from_ecef_i(), and stateSetLocalOrigin_i().
Referenced by ins_vectornav_init().
void ins_vectornav_check_status | ( | void | ) |
Check INS status.
Definition at line 263 of file ins_vectornav.c.
References InsVectornav::err, InsVectornav::ins_status, ins_vn, and InsVectornav::mode.
Referenced by ins_vectornav_propagate().
void ins_vectornav_event | ( | void | ) |
Event handling for Vectornav.
Definition at line 107 of file ins_vectornav.c.
References FALSE, ins_vectornav_read_message(), ins_vn, VNPacket::msg_available, vn200_event(), and InsVectornav::vn_packet.
void ins_vectornav_init | ( | void | ) |
Initialize Vectornav struct.
Definition at line 123 of file ins_vectornav.c.
References InsVectornav::body_to_imu, VNPacket::chksm_error, DefaultPeriodic, FALSE, FLOAT_VECT3_ZERO, VNPacket::framing_error, get_sys_time_float(), VNPacket::hdr_error, ins_init_origin_from_flightplan(), ins_vn, INS_VN_BODY_TO_IMU_PHI, INS_VN_BODY_TO_IMU_PSI, INS_VN_BODY_TO_IMU_THETA, INT32_VECT3_ZERO, InsVectornav::lin_accel, InsVectornav::ltp_accel_i, InsVectornav::ltp_initialized, InsVectornav::ltp_pos_i, InsVectornav::ltp_speed_i, VNPacket::msg_available, VNPacket::msg_idx, VNPacket::noise_error, orientationSetEulers_f(), VNPacket::overrun_error, register_periodic_telemetry(), VNPacket::status, TRUE, InsVectornav::vel_body, InsVectornav::vel_ned, InsVectornav::vn_packet, InsVectornav::vn_status, InsVectornav::vn_time, VNMsgSync, and VNNotTracking.
Referenced by ins_vectornav_register().
void ins_vectornav_propagate | ( | void | ) |
Propagate the received states into the vehicle state machine.
Definition at line 317 of file ins_vectornav.c.
References InsVectornav::accel, InsVectornav::accel_i, ACCELS_BFP_OF_REAL, LlaCoor_f::alt, LlaCoor_i::alt, UtmCoor_f::alt, UtmCoor_i::alt, InsVectornav::attitude, InsVectornav::body_to_imu, GpsState::course, UtmCoor_f::east, UtmCoor_i::east, ECEF_BFP_OF_REAL, ecef_of_ned_point_f(), GpsState::ecef_pos, GpsState::ecef_vel, GpsState::fix, float_quat_of_eulers(), float_rmat_comp(), float_rmat_of_quat(), float_rmat_ratemult(), float_rmat_transp_vmult(), get_sys_time_usec(), gps, GPS_FIX_3D, GPS_UBX_ID, GpsState::gspeed, InsVectornav::gyro, InsVectornav::gyro_i, GpsState::hmsl, IMU_ASPIRIN_ID, ins_vectornav_check_status(), ins_vectornav_set_pacc(), ins_vectornav_set_sacc(), ins_vectornav_yaw_pitch_roll_to_attitude(), ins_vn, GpsState::last_3dfix_ticks, GpsState::last_3dfix_time, GpsState::last_msg_ticks, GpsState::last_msg_time, LlaCoor_f::lat, InsVectornav::lin_accel, LLA_BFP_OF_REAL, GpsState::lla_pos, InsVectornav::lla_pos, LlaCoor_f::lon, InsVectornav::ltp_accel_f, InsVectornav::ltp_accel_i, ltp_def_from_lla_f(), InsVectornav::ltp_pos_i, InsVectornav::ltp_speed_i, nav_utm_zone0, sys_time::nb_sec, sys_time::nb_sec_rem, UtmCoor_f::north, UtmCoor_i::north, orientationGetRMat_f(), InsVectornav::pos_lla, RATES_BFP_OF_REAL, stateGetAccelNed_i(), stateGetPositionEcef_i(), stateGetPositionNed_i(), stateGetSpeedNed_i(), stateSetAccelNed_f(), stateSetBodyRates_f(), stateSetNedToBodyRMat_f(), stateSetPositionLla_i(), stateSetSpeedNed_f(), utm_of_lla_f(), GpsState::utm_pos, VECT3_ASSIGN, InsVectornav::vel_ned, EcefCoor_i::x, FloatVect3::x, NedCoor_f::x, EcefCoor_i::y, FloatVect3::y, NedCoor_f::y, EcefCoor_i::z, FloatVect3::z, UtmCoor_f::zone, and UtmCoor_i::zone.
Referenced by ins_vectornav_read_message().
void ins_vectornav_read_message | ( | void | ) |
Read received data.
Definition at line 173 of file ins_vectornav.c.
References InsVectornav::accel, InsVectornav::attitude, GpsState::fix, get_sys_time_float(), gps, InsVectornav::gyro, InsVectornav::ins_status, ins_vectornav_propagate(), ins_vn, InsVectornav::lin_accel, VNPacket::msg_buf, GpsState::num_sv, InsVectornav::pos_lla, InsVectornav::pos_u, InsVectornav::timestamp, GpsState::tow, InsVectornav::vel_body, InsVectornav::vel_ned, InsVectornav::vel_u, VN_HEADER_SIZE, InsVectornav::vn_packet, InsVectornav::vn_time, and InsVectornav::ypr_u.
Referenced by ins_vectornav_event().
void ins_vectornav_set_pacc | ( | void | ) |
Find maximum uncertainty (NED) position accuracy in cm.
Definition at line 282 of file ins_vectornav.c.
References gps, ins_vn, GpsState::pacc, and InsVectornav::pos_u.
Referenced by ins_vectornav_propagate().
void ins_vectornav_set_sacc | ( | void | ) |
Set speed (velocity) uncertainty (NED) speed accuracy in cm/s.
Definition at line 273 of file ins_vectornav.c.
References gps, ins_vn, GpsState::sacc, and InsVectornav::vel_u.
Referenced by ins_vectornav_propagate().
void ins_vectornav_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 301 of file ins_vectornav.c.
References FloatEulers::phi, FloatEulers::psi, and FloatEulers::theta.
Referenced by ins_vectornav_propagate().
PRINT_CONFIG_MSG | ( | "USE_INS_NAV_INIT defaulting to TRUE" | ) |
Referenced by accel_cb(), adc_init(), adc_init_single(), ahrs_dcm_update_accel(), Drift_correction(), gyro_cb(), mag_cb(), mcu_arch_init(), and opticflow_module_init().
struct InsVectornav ins_vn |
Definition at line 31 of file ins_vectornav.c.
Referenced by ins_init_origin_from_flightplan(), ins_vectornav_check_status(), ins_vectornav_event(), ins_vectornav_init(), ins_vectornav_propagate(), ins_vectornav_read_message(), ins_vectornav_set_pacc(), and ins_vectornav_set_sacc().