Skip to content

Commit

Permalink
SITL: expose home location
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed May 8, 2017
1 parent 57c0551 commit 47b79eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libraries/SITL/SIM_Aircraft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,10 @@ void Aircraft::fill_fdm(struct sitl_fdm &fdm)
smooth_sensors();
}
fdm.timestamp_us = time_now_us;
if (fdm.home.lat == 0 && fdm.home.lng == 0) {
// initialise home
fdm.home = home;
}
fdm.latitude = location.lat * 1.0e-7;
fdm.longitude = location.lng * 1.0e-7;
fdm.altitude = location.alt * 1.0e-2;
Expand Down
1 change: 1 addition & 0 deletions libraries/SITL/SITL.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ namespace SITL {
struct sitl_fdm {
// this is the structure passed between FDM models and the main SITL code
uint64_t timestamp_us;
Location home;
double latitude, longitude; // degrees
double altitude; // MSL
double heading; // degrees
Expand Down

0 comments on commit 47b79eb

Please sign in to comment.