Simulator: Compensate scale error, not just message drops. This makes the whole simulation a lot more stable

This commit is contained in:
Lorenz Meier
2017-08-01 19:50:35 +02:00
parent 94684899a5
commit afb40a761d
2 changed files with 40 additions and 2 deletions
+4
View File
@@ -247,6 +247,7 @@ private:
_dist_pub(nullptr),
_battery_pub(nullptr),
_initialized(false),
_realtime_factor(1.0),
_system_type(0)
#ifndef __PX4_QURT
,
@@ -328,6 +329,9 @@ private:
orb_advert_t _battery_pub;
bool _initialized;
double _realtime_factor; ///< How fast the simulation runs in comparison to real system time
hrt_abstime _last_sim_timestamp;
hrt_abstime _last_sitl_timestamp;
// Lib used to do the battery calculations.
Battery _battery;