peabody124
a1a3b0774f
Flight/AHRS: Update code to coding conventions.
...
find ./flight/AHRS/ \! \( -name '*~' -a -prune \) -type f | xargs -I{} bash -c 'echo {}; dos2unix {}; gnuindent -npro -kr -i8 -ts8 -sob -ss -ncs -cp1 -il0 {};'
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1707 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-21 19:29:39 +00:00
zedamota
5fb45f835e
OP-21/Flight Bootloader - Bug fix, 1 more
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1696 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-20 17:09:06 +00:00
zedamota
3ba6372dc4
OP-21/Flight Bootloader - Clean up and linker files for the AHRS
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1691 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-19 18:27:53 +00:00
peabody124
0ea95fbad1
AHRS: Separate covariance prediction from state prediction to get updated state out of spi a few milliseconds sooner.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1675 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-17 18:15:00 +00:00
peabody124
92c36114f3
AHRS: No longer reinit after a comms glitch. Allow time for EKF to converge (2-3 seconds) after power up.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1674 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-17 18:14:20 +00:00
zedamota
e8d6e7c557
Flight - Centralized board specific files, BL and User FW uses the same board definitions, no need to have 2.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1663 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 19:19:38 +00:00
peabody124
832b61ab86
OP-117 AHRS: Binary streaming of the raw data within EKF. Doesn't keep up while running this but does give accurate data that went into algorithm. Once we can dynamically change sampling rate will be good.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1655 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 05:26:14 +00:00
peabody124
885c966e53
AHRS: Added a tracker for number of ADC updates the EKF misses. Also updated the Telemetry autogenerated files to accomodate the 11500 baud rate.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1652 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 02:59:00 +00:00
peabody124
ff1b303083
AHRS: Only do EKF correction with mag when new data available
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1651 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 02:58:56 +00:00
peabody124
19e80da928
AHRS: Update UAVObject with information about AHRS rate
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1650 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-16 01:54:21 +00:00
pip
cf864225fe
Added easier to find USART baudrate setting PIOS_USART_BAUDRATE.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1640 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 17:07:37 +00:00
stac
1017d0294b
ahrs: always enable -g for gdb debug symbols
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1635 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 15:45:41 +00:00
stac
7886a617dc
Revert "ahrs: No longer support -O0 since it doesn't fit"
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1634 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 15:45:39 +00:00
stac
73787f7f15
ahrs: No longer support -O0 since it doesn't fit
...
Leaving debug on allows the -g option to be enabled
so that we can have symbols in gdb even though we're
forcing the optimization flags to -Os.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1631 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:06 +00:00
stac
cdb8aa37a0
ahrs: Only read mag data when it has been updated
...
The AHRS mainloop was reading the mag data on every
loop regardless of whether new data was actually
available. Now that the MAG_DRDY signal is monitored,
we can read only at the rate (10Hz) new data is actually
produced by the sensor.
This also enables future improvements that will remove the
filtering work that is still being done on the mag data on
every iteration.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1630 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:05 +00:00
stac
55d90970ed
hmc5843: hide internal #defines and functions
...
Way too much was being exposed in the API for the
HMC5843. This commit properly hides internal
details of the driver.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1629 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:04 +00:00
stac
0e7a801e9e
hmc5843: Add support for DRDY signal from magnetometer
...
The DRDY signal from the magnetometer is connected to PB8
on the STM32. This pin is now configured as an external
interrupt and is now used to signal when new data is
available from the magnetometer.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1628 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:21:02 +00:00
stac
139da048f6
ahrs: remove unused debug code
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1620 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-15 14:20:51 +00:00
peabody124
c5fe985a45
AHRS: Gets timing working correctly to compute the EKF rate and idle time in real values
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1615 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-14 07:03:36 +00:00
peabody124
0875dc8442
AHRS: First pass refactoring the ADC code into another function. Still want to clean up a few constants make the downsampling go into a smaller circularbuffer nicely.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1614 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-14 07:03:34 +00:00
peabody124
1051d894b9
AHRS: Merged in some new code from Dschin that expliclity writes the prediction terms in the covariance matrix. Also made changes to compile with -Os. Now runs around 125 - 150 Hz depending on corrections used (this will become adjustable from GCS shortly).
...
Squashed commit of the following:
commit 897e3365ab6c762584c34238efd12dc144e72af0
Author: James Cotton <peabody124@gmail.com>
Date: Mon Sep 13 22:15:21 2010 -0500
AHRS: Getting it running nice and quickly.
commit 53d72fb849164730c89873cab81c9e09be0b112b
Author: James Cotton <peabody124@gmail.com>
Date: Mon Sep 13 15:57:46 2010 -0500
AHRS: Make more variables volatile for -Os.
commit 4fa90821b5d3d8c2ea5e67756313a8a63c0eeb8c
Author: James Cotton <peabody124@gmail.com>
Date: Mon Sep 13 15:11:31 2010 -0500
AHRS/Makefile: -O0 not added to allow me to try various space flags that don't break code.
commit 5bd17a304dc28dc271c2f3e8c6cb8ad4a830404f
Author: James Cotton <peabody124@gmail.com>
Date: Mon Sep 13 14:44:05 2010 -0500
AHRS: Make debuggign USART easy to disable
commit 5453f2a7939492769fe9e9cc822e69c107320670
Author: James Cotton <peabody124@gmail.com>
Date: Mon Sep 13 14:38:37 2010 -0500
AHRS: Explicitly expand covariance prediction. Brings computations from 160 to 90. Makes it not fit in AHRS though.
commit b6712da7eece2a464a2073d24b77be22bfa47094
Author: James Cotton <peabody124@gmail.com>
Date: Sun Sep 12 22:59:42 2010 -0500
AHRS: Make it easy to comment out the I2C/Magnetometers.
commit 8c84d0091f3d6f6bedc7a0224a4ed9cb099b022b
Author: James Cotton <peabody124@gmail.com>
Date: Thu Sep 9 00:49:50 2010 -0500
AHRS: Small change to INSGPS analysis tools
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1613 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-14 06:42:56 +00:00
pip
7da2fc2ba7
made ahrs_state 'volatile' in ahrs.c to prevent compiler optimization lockup
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1612 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-13 20:56:58 +00:00
peabody124
4a4932e5ff
AHRS/FSM: Small initialization detail to make compile with -Os
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1610 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-13 19:04:37 +00:00
peabody124
76971a807c
AHRS: Some more tweaking of the timings.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1603 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 22:18:18 +00:00
peabody124
ba34bb8c24
AHRS: Oops, didn't notice the message processing was removed from end of loop. Adding back.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1597 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 12:44:57 +00:00
peabody124
59758122e1
AHRS: Cannot process messages while idling as this makes the main loop execution time non-deterministic based on OP (i.e. could get three messages and push the time up). It would be a nice featuer since you can get a raw and EKF update in the same step, but if the AHRS_Comm loop is fast (which is should be to keep update latency low) then this will hammer the AHRS with redunant requests.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1594 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 02:54:51 +00:00
peabody124
56131476ef
AHRS: Switch to sampling at 2khz, plenty of CPU usage. However need to make EKF rate different for outdoor mode with this patch because otherwise will drop samples :-(
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1592 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-12 02:54:47 +00:00
stac
d1dc300081
ahrscomms: remove unused sync and switch_proto messages
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1582 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-11 23:06:25 +00:00
stac
80c92ba54b
ahrs: process SPI messages while idle
...
This makes the AHRS continually process SPI messages
while waiting for new samples to be ready. This has
the side effect of making the CPU utilization on the
AHRS pin at 99-100% (ie. we make use of all of our
otherwise idle time).
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1581 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-11 23:06:23 +00:00
dschin
e6fea9bb76
Changed the feedback gain matrix K to a global variable in insgps so that it may be inspected.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1577 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-10 20:46:46 +00:00
peabody124
6cdb9b0b48
AHRS: Added Matlab code to analyze the INSGPS friendly data dump format and plot the important variables. This requires "DUMP_FRIENDLY" be enabled in the file.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1560 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-08 06:15:21 +00:00
peabody124
e499f33fd5
AHRS: Improved code to stream raw data from AHRS and added a matlab function to acquire and analyze the data. The QT program to analyze it should work but QextSerial seems to have a bug and drops or inserts data
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1559 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-08 06:15:18 +00:00
peabody124
9895b403c7
Ground/SerialLogging: Improved the serial dump from AHRS to have a big random frame header and to detect it on the logging program.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1556 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-07 16:33:10 +00:00
peabody124
e06162fa3a
Flight/AHRS: Reorganized the code a little to make sure indoor used by default unless GPS updates come
...
in. Also change the velocity variance in indoor mode to lower to make it get a better attitude estimate (primarily faster convergence - probably will tweak this in the future dynamically). Finally decreased barometer variance - in scope it's actually quite reasonable, normally within +/- .5 m.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1546 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-06 07:54:19 +00:00
peabody124
404e0c2f44
OP-132 AHRS: Changes to the Indoor flight handling to only use the barometer indoors and update with a zero for velocity and high variance.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1517 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-04 02:19:04 +00:00
peabody124
a406034ed9
OP-132 Flight/AHRS: Changed the heuristics regarding GPS quality and INSGPS updates. Now if satellites < 7 or PDOP > 3.5 it does not perform GPS updates. Professor is working on some code to fix parts of the covariance matrix. If indoor updates high a 0 position and velocity and high variance.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1515 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-09-04 02:19:00 +00:00
peabody124
12657440c3
OP-132 AHRS: Added an indoor flight mode and also add an ad-hoc quality heuristic to the GPS signal to increase the measurement variance from GPS when fix quality is poor or when in indoor flight mode. In addition corrected the indentation to conform to the tab/space convention forum discussion.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1474 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-31 02:11:09 +00:00
peabody124
f202884ce8
AHRS: Numerous changes. Added CPU load monitoring for AHRS as well as some friendly debugging output options. Also added a new CalibrationMode setting to AHRS (Echo) to speed up sensor calibration. Cleaned up the 6 point calibration interface to make it more friendly, but I think Edouard will clobber it with something nice and sexy :).
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1455 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-29 06:38:30 +00:00
peabody124
8128c3bbfa
OP-118 AHRS: Added 6 point calibration routine to AHRS config widget. To use it, click "Cal Mode", then place the AHRS on each of 6 sides of a cube then click save position. Finally click compute to push the updated scale abd bias terms to the AHRS. Also fixed a bug in UAVObjectField that would not allow you to setDouble for extra fields.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1449 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-28 18:48:51 +00:00
stac
47df1faa8d
ahrs: whitespace adjustments
...
No functional changes. Whitespace/tab fixups only.
Use TRUE/FALSE instead of 1/0.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1430 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-27 02:14:58 +00:00
stac
670452307d
ahrs: remove unnecessary memset() of rx message buffer
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1429 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-27 02:14:56 +00:00
stac
0a7088c24a
ahrs: fix type on flags, remove redundant code
...
No need to have boolean flags being floats.
Some of the attitude message was being populated twice.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1428 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-27 02:14:54 +00:00
peabody124
c07e1416b7
AHRS: Serial output option for AHRS and corresponding serial logger.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1414 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-26 06:25:11 +00:00
peabody124
beac0c0ea9
AHRS: Get the signs for the simple algorithm correct
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1385 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-23 04:12:14 +00:00
peabody124
bd8fffe4d0
AHRS/Flight: Renamed AttitudeSettings to AhrsSettings to make it more intuitive. Added the ability to change the algorithm from GCS.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1383 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-23 03:39:13 +00:00
peabody124
2596f43511
OP-120 AHRS: Moved conversion of quaternion to RPY over from AHRS to OP to minimize transfer and computational load on AHRS.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1381 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-23 02:35:39 +00:00
peabody124
5662d85c4e
OP-120 AHRS: Tightened up the communication protocol so it runs more quickly. Looks ok in gdb but GCS not crashing right now (rendering error) so I can't test it properly.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1366 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-22 00:21:54 +00:00
peabody124
8897c441fa
OP-118 AHRS: Added AHRSCalibration object and messages associated with that to AHRS. Also made AHRS run calibration only when requested. We will create a GCS plugin that runs through computing the calibration settings. To compute the variances on the AHRS set the measure variances to true, wait ten seconds, then set it to false to read it back.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1363 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-21 21:46:02 +00:00
stac
b36d251bd9
ahrs: remove debug code in attitude handler
...
Debug code was previously using the q4 element
in the attitude message to encode a cycle counter
to measure performance on the AHRS. This is no
longer valid.
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1357 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-21 16:23:14 +00:00
peabody124
2031cfe4d0
OP-119 AHRS: Added error counters for the messages as well as changed an error on AHRS echo back for the HomeLocation message.
...
git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1344 ebee16cc-31ac-478f-84a7-5cbb03baadba
2010-08-20 22:52:13 +00:00