Browse Source

Tracker: vehicle state made global

master
Randy Mackay 11 years ago
parent
commit
0d1fefc23d
  1. 13
      AntennaTracker/AntennaTracker.pde
  2. 13
      AntennaTracker/tracking.pde

13
AntennaTracker/AntennaTracker.pde

@ -222,6 +222,19 @@ static struct Location current_loc; @@ -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

13
AntennaTracker/tracking.pde

@ -1,18 +1,5 @@ @@ -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

Loading…
Cancel
Save