Replay: restore exact timestamp in HIL

This commit is contained in:
Andrew Tridgell 2016-05-04 17:11:19 +10:00
parent 88a1ebaf0e
commit 295c65277d
1 changed files with 5 additions and 1 deletions

View File

@ -281,8 +281,12 @@ void LR_MsgHandler_MAG_Base::update_from_msg_compass(uint8_t compass_offset, uin
require_field(msg, "Mag", mag); require_field(msg, "Mag", mag);
Vector3f mag_offset; Vector3f mag_offset;
require_field(msg, "Ofs", mag_offset); require_field(msg, "Ofs", mag_offset);
uint32_t last_update_usec;
if (!field_value(msg, "S", last_update_usec)) {
last_update_usec = AP_HAL::micros();
}
compass.setHIL(compass_offset, mag - mag_offset); compass.setHIL(compass_offset, mag - mag_offset, last_update_usec);
// compass_offset is which compass we are setting info for; // compass_offset is which compass we are setting info for;
// mag_offset is a vector indicating the compass' calibration... // mag_offset is a vector indicating the compass' calibration...
compass.set_offsets(compass_offset, mag_offset); compass.set_offsets(compass_offset, mag_offset);