mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 19:47:50 +08:00
[ins] ins_int: properly reset vff state on realign and initial ltp fix
This commit is contained in:
@@ -302,13 +302,12 @@ static void baro_cb(uint8_t __attribute__((unused)) sender_id, float pressure)
|
|||||||
#if USE_GPS
|
#if USE_GPS
|
||||||
void ins_int_update_gps(struct GpsState *gps_s)
|
void ins_int_update_gps(struct GpsState *gps_s)
|
||||||
{
|
{
|
||||||
if (gps_s->fix == GPS_FIX_3D) {
|
if (gps_s->fix != GPS_FIX_3D) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ins_int.ltp_initialized) {
|
if (!ins_int.ltp_initialized) {
|
||||||
ltp_def_from_ecef_i(&ins_int.ltp_def, &gps_s->ecef_pos);
|
ins_reset_local_origin();
|
||||||
ins_int.ltp_def.lla.alt = gps_s->lla_pos.alt;
|
|
||||||
ins_int.ltp_def.hmsl = gps_s->hmsl;
|
|
||||||
ins_int.ltp_initialized = TRUE;
|
|
||||||
stateSetLocalOrigin_i(&ins_int.ltp_def);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct NedCoor_i gps_pos_cm_ned;
|
struct NedCoor_i gps_pos_cm_ned;
|
||||||
@@ -369,7 +368,6 @@ void ins_int_update_gps(struct GpsState *gps_s)
|
|||||||
#endif /* USE_HFF */
|
#endif /* USE_HFF */
|
||||||
|
|
||||||
ins_ned_to_state();
|
ins_ned_to_state();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
void ins_int_update_gps(struct GpsState *gps_s __attribute__((unused))) {}
|
void ins_int_update_gps(struct GpsState *gps_s __attribute__((unused))) {}
|
||||||
|
|||||||
@@ -254,6 +254,5 @@ void vff_update_vz_conf(float vz_meas, float conf)
|
|||||||
|
|
||||||
void vff_realign(float z_meas)
|
void vff_realign(float z_meas)
|
||||||
{
|
{
|
||||||
vff.z = z_meas;
|
vff_init(z_meas, 0., 0.);
|
||||||
vff.zdot = 0;
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user