Keith Packard [Tue, 28 Jun 2011 08:03:00 +0000 (01:03 -0700)]
altosui: Support raw telemetry from TeleDongle
Use raw telemetry frames when TeleDongle supports them, this involves
parsing the hex dump of the packet instead of having teledongle take
the packet apart. Only the legacy format is working at this point; the
altos bits for the new split telemetry frames is not written yet.
Keith Packard [Fri, 3 Jun 2011 06:16:30 +0000 (23:16 -0700)]
altosui: Handle old TeleDongle receiving kalman telemetry packets
The telemetry packets now send the kalman height/speed/accel values
instead of the ad-hoc values. If received by an old TeleDongle box,
the speed value will be of the form 0x8000abcd, which will be printed
as a 32-bit value by TeleDongle. We only want the abcd part, which is
the speed * 16. Detect this automatically and compute the correct
values for all three.
Keith Packard [Tue, 19 Apr 2011 20:20:19 +0000 (13:20 -0700)]
altos: Solidify BT connections
Use delays while sending commands to BT module.
Don't use BT for stdio until the module is initialized.
Add \r to name setting command
Don't require 'connected' signal for command input.
Keith Packard [Tue, 19 Apr 2011 15:43:40 +0000 (08:43 -0700)]
altosui: Use persistent list of bluetooth devices for device dialogs
Store a list of known bluetooth devices as preferences. Always include
those in device dialogs with an option to go browse for more devices
in both the device dialog and the Configure AltosUI dialog.
Keith Packard [Thu, 14 Apr 2011 16:38:48 +0000 (09:38 -0700)]
altos: Write a few pre-launch samples for Tm/Tn devices
Record pre-launch samples in a small ring and flush that to flash when
launch is detected. This provides a complete record of the flight,
rather than simply starting after launch detect.
Keith Packard [Sun, 10 Apr 2011 05:53:12 +0000 (22:53 -0700)]
altos/altosui: Log averaged baro sensor data in Tm/Tn
Instead of logging the best height guess from the kalman filter, log
barometer data. The logged data consists of the average value betwen
log points to reduce noise.
Keith Packard [Fri, 8 Apr 2011 05:00:38 +0000 (22:00 -0700)]
altos: Use PIO(6) on BTM to monitor BT connection. Fix BTM init.
PIo(6) appears to be an active-low indication of the Bluetooth
connection status. Hook this up using an interrupt to track the
link state instead of using in-band status messages.
Keith Packard [Fri, 1 Apr 2011 03:55:18 +0000 (20:55 -0700)]
altos: Make ao_flight_test show true height but report saturated height
To simulate a saturated baro sensor, clip baro data at a specified
altitude. Continue to report the 'true' altitude in the output so that
the resulting graphs are useful.
Keith Packard [Tue, 29 Mar 2011 17:08:46 +0000 (10:08 -0700)]
altos: ao_sample_preflight was exiting preflight mode immediately
Need to stay in pre-flight mode until we've gotten enough sensor data
to calibrate things appropriately. The conversion from a unified
ao_flight.c file was just broken here.
Keith Packard [Tue, 29 Mar 2011 16:39:27 +0000 (09:39 -0700)]
altosui: Don't display 0000-00-00 for missing flight log dates
With Tm/Tn not having GPS to get the current date, it's no longer
unusual to have no date for a flight log, so don't show the 0000-00-00
piece in that case.
Keith Packard [Tue, 29 Mar 2011 16:37:11 +0000 (09:37 -0700)]
altosui: Make deployment testing handle Connecting... dialog
Supporting the Connecting... dialog requires moving all serial
communication to a separate thread. This was done by creating a worker
thread and command queue to communicate between the UI and the serial line.
Keith Packard [Tue, 29 Mar 2011 06:35:05 +0000 (23:35 -0700)]
altosui: Clean up packet link connecting dialog
Make sure the dialog is destroyed after use (otherwise, it hangs
around on the screen sometimes).
Switch timeout before showing dialog to 500ms -- that brings the
dialog up less often when unnecessary.
Use 'timeout_started' boolean to indicate whether the I/O thread has
queued the dialog for display and whether it needs to queue a call to
close it down.
Keith Packard [Tue, 29 Mar 2011 00:54:44 +0000 (17:54 -0700)]
altos: Split up flight code into separate flight/sample/kalman bits
The flight code mashed together data processing, filtering and actual
flight managament into one giant pile. Split things up so that we
have:
ao_sample.c: Sensor data processing. Reads the ring, handles calibration
ao_kalman.c: Filter the data to track the accel/speed/height values
ao_flight.c: Flight state management, specific to rocketry.
The plan is to re-use ao_sample.c and ao_kalman.c for hardware not
specifically designed for rocketry, like TeleNano.
Keith Packard [Sun, 27 Mar 2011 07:48:07 +0000 (00:48 -0700)]
altosui: Handle serial calls from swing thread
Calls from the swing thread cannot be canceled as there's no way to
put up the cancel dialog. In this case, simply use the 5 second
timeout and fail if no communication occurs within that amount of time.
Keith Packard [Sun, 27 Mar 2011 07:46:19 +0000 (00:46 -0700)]
altosui: Tell serial device which frame to use for timeout dialogs
For the timeout dialog to appear, a frame must be configured for it to
appear near. This patch sends the frame from the eeprom download
functions to the serial code. That path doesn't yet work as the eeprom
download is still trying to talk to the serial device from the swing
event thread, which prevents the cancel dialog from working.
Keith Packard [Sun, 27 Mar 2011 07:13:38 +0000 (00:13 -0700)]
altosui: Allow radio channel to be configured over the radio link
TeleMini/TeleNano can't be configured via USB, so we need to allow
the radio channel to be set over the radio link.
This change carefully sets the new radio channel, disables the remote
link and then sets the teledongle channel to the new value and brings
the link back up.
Keith Packard [Sun, 27 Mar 2011 07:12:01 +0000 (00:12 -0700)]
altosui: Off-by-one error in telemetry format configuration UI
The telemetry format menu uses 0 for full and 1 for tiny, but the
telemetry configuration uses 1 for full and 2 for tiny. One direction
(config to UI) was right, the other (UI to config) was wrong.
Keith Packard [Sun, 27 Mar 2011 06:38:54 +0000 (23:38 -0700)]
altos: full logging must flush pending data before checking state
Flight state must be checked only after any pending data have been
written to the log as the 'current' flight state is only valid when
the pending data values have been processed. This ensures that the
'boost' state is not marked until the full ring of data is
written. This ensures that the data processing code can find the
barometer values from before boost to get an idea of the ground
pressure value.
Keith Packard [Sun, 27 Mar 2011 06:15:36 +0000 (23:15 -0700)]
altos: Variable log rate in full logging code too
With the fixed ADC rate used to get better data during flight, the
logging code now needs to vary the data storage rate so that descent
data is recorded at 10 samples/second while ascent data is recorded at
1 sample per second. Having the logging code do this itself eliminates
any interaction with the flight code.
Keith Packard [Sat, 26 Mar 2011 07:01:22 +0000 (00:01 -0700)]
altosui: Allow TM config connection to be canceled.
This leaves the config UI connection attempt running and pops up a
dialog box when it takes 'too long' in the remote case so that users
with Tm or Tn devices can bring up the UI, and then boot the Tm/Tn
without needing to time things carefully.
Keith Packard [Sat, 26 Mar 2011 05:01:18 +0000 (22:01 -0700)]
altosui: Remove extra AltosEepromBlock layer
This was interposed between the download layer and the eeprom layer to
hold a eeprom block full of flight log records. The addition of the tiny
log format required reworking the code to hold chunks full of eeprom
data without regard to their content, so this content-specific layer
didn't seem useful anymore.
Keith Packard [Sat, 26 Mar 2011 04:34:31 +0000 (21:34 -0700)]
altosui: Add support for downloading TeleMini/TeleNano flight logs
Splits the eeprom downloading code into eeprom block downloading and
separate eeprom data parsing so that the new data logging format can
share the data downloading code.
Keith Packard [Wed, 23 Mar 2011 23:08:43 +0000 (08:08 +0900)]
altosui: Add telemetry format menu and preferences
Switches the TeleDongle between full and tiny telemetry packet
formats, saving the last used format for each teledongle in the
application preferences.
Keith Packard [Wed, 23 Mar 2011 01:33:38 +0000 (10:33 +0900)]
altos: Ignore alt error for fast->coast. Allow larger error for baro apogee.
With the fixed kalman filter, transitions across mach don't cause
bumps in the merged filter.
And, with working kalman bits, the signal for broken baro detection is
stronger and so we can allow for baro apogee detection in cases where
noise occurs close to apogee.
Bump the kalman filter to trust the baro less so that the model tracks
across mach.