SITL: fix when speedup is specified as a startup parameter

This commit is contained in:
Tatsuya Yamaguchi 2020-08-26 21:38:44 +09:00 committed by Andrew Tridgell
parent 1f3c24d436
commit 829cd29d7c

View File

@ -432,6 +432,11 @@ void Aircraft::fill_fdm(struct sitl_fdm &fdm)
fdm.quaternion.from_rotation_matrix(m);
}
}
// in the first call here, if a speedup option is specified, overwrite it
if (is_equal(last_speedup, -1.0f) && !is_equal(get_speedup(), 1.0f)) {
sitl->speedup = get_speedup();
}
if (!is_equal(last_speedup, float(sitl->speedup)) && sitl->speedup > 0) {
set_speedup(sitl->speedup);