AP_NavEKF: use compass->last_update_usec()

This commit is contained in:
Andrew Tridgell 2015-03-14 12:31:39 +11:00
parent 1962706a33
commit de3f461a55
2 changed files with 4 additions and 4 deletions

View File

@ -4043,9 +4043,9 @@ void NavEKF::readHgtData()
// check for new magnetometer data and update store measurements if available
void NavEKF::readMagData()
{
if (use_compass() && _ahrs->get_compass()->last_update != lastMagUpdate) {
if (use_compass() && _ahrs->get_compass()->last_update_usec() != lastMagUpdate) {
// store time of last measurement update
lastMagUpdate = _ahrs->get_compass()->last_update;
lastMagUpdate = _ahrs->get_compass()->last_update_usec();
// read compass data and scale to improve numerical conditioning
magData = _ahrs->get_compass()->get_field() * 0.001f;

View File

@ -626,9 +626,9 @@ void SmallEKF::readMagData()
{
if (_ahrs.get_compass() &&
_ahrs.get_compass()->use_for_yaw() &&
_ahrs.get_compass()->last_update != lastMagUpdate) {
_ahrs.get_compass()->last_update_usec() != lastMagUpdate) {
// store time of last measurement update
lastMagUpdate = _ahrs.get_compass()->last_update;
lastMagUpdate = _ahrs.get_compass()->last_update_usec();
// read compass data and scale to improve numerical conditioning
magData = _ahrs.get_compass()->get_field() * 0.001f;