AP_GPS: allow Replay to set last sample time

This commit is contained in:
Andrew Tridgell 2016-05-05 16:04:18 +10:00
parent 2f4f38b85f
commit 5ddb872b79
2 changed files with 6 additions and 2 deletions

View File

@ -492,7 +492,7 @@ AP_GPS::setHIL(uint8_t instance, GPS_Status _status, uint64_t time_epoch_ms,
}
// set accuracy for HIL
void AP_GPS::setHIL_Accuracy(uint8_t instance, float vdop, float hacc, float vacc, float sacc, bool _have_vertical_velocity)
void AP_GPS::setHIL_Accuracy(uint8_t instance, float vdop, float hacc, float vacc, float sacc, bool _have_vertical_velocity, uint32_t sample_ms)
{
GPS_State &istate = state[instance];
istate.vdop = vdop * 100;
@ -503,6 +503,10 @@ void AP_GPS::setHIL_Accuracy(uint8_t instance, float vdop, float hacc, float vac
istate.have_vertical_accuracy = true;
istate.have_speed_accuracy = true;
istate.have_vertical_velocity |= _have_vertical_velocity;
if (sample_ms != 0) {
timing[instance].last_message_time_ms = sample_ms;
timing[instance].last_fix_time_ms = sample_ms;
}
}
/**

View File

@ -314,7 +314,7 @@ public:
uint16_t hdop);
// set accuracy for HIL
void setHIL_Accuracy(uint8_t instance, float vdop, float hacc, float vacc, float sacc, bool _have_vertical_velocity);
void setHIL_Accuracy(uint8_t instance, float vdop, float hacc, float vacc, float sacc, bool _have_vertical_velocity, uint32_t sample_ms);
static const struct AP_Param::GroupInfo var_info[];