this allows simulation of slow GPS updates (for example, the 1Hz GPS problem)
@ -531,7 +531,7 @@ void SITL_State::_update_gps(double latitude, double longitude, float altitude,
Vector3f glitch_offsets = _sitl->gps_glitch;
// 5Hz, to match the real config in APM
if (hal.scheduler->millis() - gps_state.last_update < 200) {
if (hal.scheduler->millis() - gps_state.last_update < 1000/_sitl->gps_hertz) {
return;
}
@ -43,6 +43,7 @@ const AP_Param::GroupInfo SITL::var_info[] PROGMEM = {
AP_GROUPINFO("MAG_ERROR", 15, SITL, mag_error, 0),
AP_GROUPINFO("SERVO_RATE", 16, SITL, servo_rate, 0),
AP_GROUPINFO("GPS_GLITCH", 17, SITL, gps_glitch, 0),
AP_GROUPINFO("GPS_HZ", 18, SITL, gps_hertz, 5),
AP_GROUPEND
};
@ -62,6 +62,7 @@ public:
AP_Int8 gps_type; // see enum GPSType
AP_Float gps_byteloss;// byte loss as a percent
AP_Int8 gps_numsats; // number of visible satellites
AP_Int8 gps_hertz; // GPS update rate in Hz
AP_Vector3f gps_glitch; // glitch offsets in lat, lon and altitude
// wind control