Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Driver for Microstrain GX3 IMU/AHRS subsystem. More...
Go to the source code of this file.
Macros | |
#define | GX3_CHKSM(_ubx_payload) (uint16_t)((uint16_t)(*((uint8_t*)_ubx_payload+66+1))|(uint16_t)(*((uint8_t*)_ubx_payload+66+0))<<8) |
Functions | |
static bool_t | gx3_verify_chk (volatile uint8_t *buff_add) |
static float | bef (volatile uint8_t *c) |
void | ahrs_gx3_align (void) |
void | imu_impl_init (void) |
must be defined by underlying hardware More... | |
void | imu_periodic (void) |
optional. More... | |
void | gx3_packet_read_message (void) |
void | gx3_packet_parse (uint8_t c) |
void | ahrs_gx3_init (void) |
void | ahrs_gx3_register (void) |
void | imu_scale_gyro (struct Imu *_imu) |
void | imu_scale_accel (struct Imu *_imu) |
void | imu_scale_mag (struct Imu *_imu) |
void | ahrs_gx3_publish_imu (void) |
Variables | |
struct AhrsGX3 | ahrs_gx3 |
Axis definition: X axis pointing forward, Y axis pointing to the right and Z axis pointing down. More... | |
Driver for Microstrain GX3 IMU/AHRS subsystem.
Takes care of configuration of the IMU, communication and parsing the received packets. See GX3 datasheet for configuration options.
Definition in file ahrs_gx3.c.
#define GX3_CHKSM | ( | _ubx_payload | ) | (uint16_t)((uint16_t)(*((uint8_t*)_ubx_payload+66+1))|(uint16_t)(*((uint8_t*)_ubx_payload+66+0))<<8) |
Definition at line 39 of file ahrs_gx3.c.
Referenced by gx3_packet_read_message().
void ahrs_gx3_align | ( | void | ) |
Definition at line 75 of file ahrs_gx3.c.
References ahrs_gx3, FALSE, AhrsGX3::is_aligned, TRUE, and uart_put_byte().
Referenced by imu_impl_init().
void ahrs_gx3_init | ( | void | ) |
Definition at line 327 of file ahrs_gx3.c.
References ahrs_gx3, Imu::body_to_imu, FALSE, imu, AhrsGX3::is_aligned, AhrsGX3::ltp_to_imu_quat, AhrsGX3::mag_offset, orientationGetQuat_f(), and QUAT_COPY.
Referenced by ahrs_gx3_register().
void ahrs_gx3_publish_imu | ( | void | ) |
Definition at line 353 of file ahrs_gx3.c.
References Imu::accel, get_sys_time_usec(), Imu::gyro, imu, IMU_GX3_ID, and Imu::mag.
Referenced by ImuEvent().
void ahrs_gx3_register | ( | void | ) |
Definition at line 340 of file ahrs_gx3.c.
References ahrs_gx3_init(), and ahrs_register_impl().
|
inlinestatic |
Definition at line 53 of file ahrs_gx3.c.
References p.
Referenced by gx3_packet_read_message().
void gx3_packet_parse | ( | uint8_t | c | ) |
Definition at line 294 of file ahrs_gx3.c.
References ahrs_gx3, GX3Packet::chksm_error, FALSE, GX3_HEADER, GX3_MSG_LEN, gx3_verify_chk(), GX3PacketReading, GX3PacketWaiting, GX3Packet::hdr_error, GX3Packet::msg_available, GX3Packet::msg_buf, GX3Packet::msg_idx, AhrsGX3::packet, GX3Packet::status, and TRUE.
Referenced by ReadGX3Buffer().
void gx3_packet_read_message | ( | void | ) |
Definition at line 226 of file ahrs_gx3.c.
References AhrsGX3::accel, Imu::accel, ACCELS_BFP_OF_REAL, ahrs_gx3, bef(), Imu::body_to_imu, AhrsGX3::chksm, GpsState::course, float_eulers_of_rmat(), FLOAT_RMAT_COMP, FLOAT_RMAT_TRANSP_RATEMULT, AhrsGX3::freq, gps, GX3_CHKSM, Imu::gyro, imu, AhrsGX3::ltime, FloatRMat::m, AhrsGX3::mag_offset, GX3Packet::msg_buf, orientationGetRMat_f(), FloatRates::p, AhrsGX3::packet, FloatEulers::psi, FloatRates::q, FloatRates::r, AhrsGX3::rate, RATES_BFP_OF_REAL, AhrsGX3::rmat, stateSetBodyRates_f(), stateSetNedToBodyEulers_f(), stateSetNedToBodyRMat_f(), AhrsGX3::time, VECT3_SMUL, FloatVect3::x, FloatVect3::y, and FloatVect3::z.
Referenced by ImuEvent().
|
inlinestatic |
Definition at line 65 of file ahrs_gx3.c.
References chk_calc, and GX3_MSG_LEN.
Referenced by gx3_packet_parse().
void imu_impl_init | ( | void | ) |
must be defined by underlying hardware
Definition at line 106 of file ahrs_gx3.c.
References ahrs_gx3, ahrs_gx3_align(), GX3Packet::chksm_error, DefaultPeriodic, FALSE, GX3PacketWaiting, GX3Packet::hdr_error, IMU_GX3_LONG_DELAY, AhrsGX3::is_aligned, GX3Packet::msg_available, GX3Packet::msg_idx, AhrsGX3::packet, register_periodic_telemetry(), GX3Packet::status, and uart_put_byte().
void imu_periodic | ( | void | ) |
optional.
If not provided by implementation, empty function is used
Definition at line 218 of file ahrs_gx3.c.
void imu_scale_accel | ( | struct Imu * | _imu | ) |
Definition at line 350 of file ahrs_gx3.c.
Referenced by aspirin2_subsystem_event(), handle_ins_msg(), imu_apogee_event(), imu_aspirin2_event(), imu_aspirin_event(), imu_aspirin_i2c_event(), imu_b2_event(), imu_bebop_event(), imu_christa_event(), imu_drotek2_event(), imu_gl1_i2c_event(), imu_hbmini_event(), imu_mpu9250_event(), imu_mpu_hmc_event(), imu_mpu_i2c_event(), imu_mpu_spi_event(), imu_navgo_event(), imu_navstik_event(), imu_nps_event(), imu_periodic(), imu_ppzuav_event(), imu_px4fmu_event(), imu_umarim_event(), and navdata_publish_imu().
void imu_scale_gyro | ( | struct Imu * | _imu | ) |
Definition at line 349 of file ahrs_gx3.c.
Referenced by aspirin2_subsystem_event(), handle_ins_msg(), imu_apogee_event(), imu_aspirin2_event(), imu_aspirin_event(), imu_aspirin_i2c_event(), imu_b2_event(), imu_bebop_event(), imu_christa_event(), imu_drotek2_event(), imu_gl1_i2c_event(), imu_hbmini_event(), imu_mpu9250_event(), imu_mpu_hmc_event(), imu_mpu_i2c_event(), imu_mpu_spi_event(), imu_navgo_event(), imu_navstik_event(), imu_nps_event(), imu_periodic(), imu_ppzuav_event(), imu_px4fmu_event(), imu_umarim_event(), and navdata_publish_imu().
void imu_scale_mag | ( | struct Imu * | _imu | ) |
Definition at line 351 of file ahrs_gx3.c.
Referenced by handle_ins_msg(), imu_aspirin2_event(), imu_aspirin_event(), imu_aspirin_i2c_event(), imu_bebop_event(), imu_drotek2_event(), imu_gl1_i2c_event(), imu_hbmini_event(), imu_krooz_event(), imu_mpu9250_event(), imu_mpu_hmc_event(), imu_navgo_event(), imu_navstik_event(), imu_nps_event(), imu_ppzuav_event(), imu_px4fmu_event(), mag_hmc58xx_module_event(), and navdata_publish_imu().
struct AhrsGX3 ahrs_gx3 |
Axis definition: X axis pointing forward, Y axis pointing to the right and Z axis pointing down.
Positive pitch : nose up Positive roll : right wing down Positive yaw : clockwise
Definition at line 47 of file ahrs_gx3.c.
Referenced by ahrs_gx3_align(), ahrs_gx3_init(), gx3_packet_parse(), gx3_packet_read_message(), imu_impl_init(), ImuEvent(), and ReadGX3Buffer().