diff --git a/AntennaTracker/AntennaTracker.pde b/AntennaTracker/AntennaTracker.pde index 84f9fb542a..ea9a5de33e 100644 --- a/AntennaTracker/AntennaTracker.pde +++ b/AntennaTracker/AntennaTracker.pde @@ -222,6 +222,19 @@ static struct Location current_loc; // There are multiple states defined such as MANUAL, FBW-A, AUTO static enum ControlMode control_mode = INITIALISING; +//////////////////////////////////////////////////////////////////////////////// +// Vehicle state +//////////////////////////////////////////////////////////////////////////////// +static struct { + bool location_valid; // true if we have a valid location for the vehicle + Location location; // lat, long in degrees * 10^7; alt in meters * 100 + Location location_estimate; // lat, long in degrees * 10^7; alt in meters * 100 + uint32_t last_update_us; // last position update in micxroseconds + uint32_t last_update_ms; // last position update in milliseconds + float heading; // last known direction vehicle is moving + float ground_speed; // vehicle's last known ground speed in m/s +} vehicle; + /* scheduler table - all regular tasks apart from the fast_loop() should be listed here, along with how often they should be called diff --git a/AntennaTracker/tracking.pde b/AntennaTracker/tracking.pde index 4187aba8c9..e4028d6f99 100644 --- a/AntennaTracker/tracking.pde +++ b/AntennaTracker/tracking.pde @@ -1,18 +1,5 @@ /// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*- -/** - state of the vehicle we are tracking - */ -static struct { - bool location_valid; // true if we have a valid location for the vehicle - Location location; // lat, long in degrees * 10^7; alt in meters * 100 - Location location_estimate; // lat, long in degrees * 10^7; alt in meters * 100 - uint32_t last_update_us; // last position update in micxroseconds - uint32_t last_update_ms; // last position update in milliseconds - float heading; // last known direction vehicle is moving - float ground_speed; // vehicle's last known ground speed in m/s -} vehicle; - /** update_vehicle_position_estimate - updates estimate of vehicle positions should be called at 50hz