Skip to content

Commit

Permalink
AP_AHRS: support set_origin and get_origin for EKF 10
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed May 8, 2017
1 parent 47b79eb commit b6568b1
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions libraries/AP_AHRS/AP_AHRS_NavEKF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,14 @@ bool AP_AHRS_NavEKF::set_origin(const Location &loc)
case EKF_TYPE3:
return ret3;

#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
case EKF_TYPE_SITL: {
struct SITL::sitl_fdm &fdm = _sitl->state;
fdm.home = loc;
return true;
}
#endif

default:
return false;
}
Expand Down Expand Up @@ -1411,8 +1419,9 @@ bool AP_AHRS_NavEKF::get_origin(Location &ret) const

#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
case EKF_TYPE_SITL:
ret = get_home();
return ret.lat != 0 || ret.lng != 0;
const struct SITL::sitl_fdm &fdm = _sitl->state;
ret = fdm.home;
return true;
#endif
}
}
Expand Down

0 comments on commit b6568b1

Please sign in to comment.