diff options
author | Keith Packard <keithp@keithp.com> | 2014-06-10 09:52:15 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-06-10 09:54:42 -0700 |
commit | 9d7f4fb6af0fee843191766858e39a481aeda347 (patch) | |
tree | b43e723b76af2195240c85c7bace0cd926479203 /src/kernel/ao_tracker.h | |
parent | c5a7889a8da3da64deb0f118656784e0ee3fd511 (diff) |
altos: Simplify tracker logic, removing boost detect
This removes the ao_flight_state value from the tracker code and makes
it simply log position information when the device has moved within
the last 10 log intervals. This also changes the configuration
parameters to define what 'motionless' means, and what interval to
configure the GPS receiver for, log data and send telemetry.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel/ao_tracker.h')
-rw-r--r-- | src/kernel/ao_tracker.h | 27 |
1 files changed, 4 insertions, 23 deletions
diff --git a/src/kernel/ao_tracker.h b/src/kernel/ao_tracker.h index 63bdaf2f..a0fd2f49 100644 --- a/src/kernel/ao_tracker.h +++ b/src/kernel/ao_tracker.h @@ -18,31 +18,12 @@ #ifndef _AO_TRACKER_H_ #define _AO_TRACKER_H_ -#define AO_CONFIG_DEFAULT_TRACKER_START_HORIZ 1000 -#define AO_CONFIG_DEFAULT_TRACKER_START_VERT 100 +/* Any motion more than this will result in a log entry */ -/* Speeds for the various modes, 2m/s seems reasonable for 'not moving' */ -#define AO_TRACKER_NOT_MOVING 200 +#define AO_TRACKER_MOTION_DEFAULT 10 +#define AO_TRACKER_INTERVAL_DEFAULT 1 -extern int32_t ao_tracker_start_latitude; -extern int32_t ao_tracker_start_longitude; -extern int16_t ao_tracker_start_altitude; - -#define AO_TRACKER_RING 4 - -struct ao_tracker_data { - uint16_t tick; - uint8_t new; - uint8_t state; - struct ao_telemetry_location gps_data; - struct ao_telemetry_satellite gps_tracking_data; -}; - -extern struct ao_tracker_data ao_tracker_data[AO_TRACKER_RING]; -extern uint8_t ao_tracker_head; - -#define ao_tracker_ring_next(n) (((n) + 1) & (AO_TRACKER_RING-1)) -#define ao_tracker_ring_prev(n) (((n) - 1) & (AO_TRACKER_RING-1)) +#define AO_TRACKER_MOTION_COUNT 10 void ao_tracker_init(void); |