1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-19 06:15:16 +03:00
Commit graph

152 commits

Author SHA1 Message Date
Bruce Luckcuck
d890c3afcc Fix undefined reference to mag when USE_MAG isn't defined
The `mag` variable is defined as an `extern` in compass.h but the implementation in compass.c is bounded by `#ifdef USE_MAG`. So if `USE_MAG` is not debined then the `mag` variable is an undefined reference.

In imu.c the `imuMahonyAHRSupdate()` function was being passed the elements of `mag` unconditionally like `mag.magADC[X]` so in the case that `USE_MAG` wasn't defined these were invalid null references. Luckily the logic in `imuMahonyAHRSupdate()` was properly bounded so that it never tried to access these variables. But in the case of a debug build the linker is unable to build a reference to these variables since they're never defined.
2019-12-14 19:53:23 -05:00
Bruce Luckcuck
f35dd086ac Fix small angle check when ACC is disabled or not defined
Fixes related to #9185
2019-11-20 00:20:20 -05:00
Bruce Luckcuck
b3b3b6a7d6 Fix small angle check reversed logic 2019-11-18 10:49:50 -05:00
mikeller
cc8b8d3bf6 Improved detection of upright / 'SMALL_ANGLE' state. 2019-11-18 14:09:06 +13:00
mikeller
e0a6f1ab14 Improved fixed wing detection. 2019-11-17 14:05:07 +13:00
mikeller
794ab1c65b Fix leftover debug code from #7529. 2019-02-08 09:51:48 +13:00
mikeller
b5908f5bab Applied 'USE_ACC' consistently. 2019-02-08 09:51:48 +13:00
jflyper
cc0e689bb5 Add USE_ACC conditionals 2019-02-04 20:37:43 +09:00
Tony Cabello
25a499cc9a Mag heading optionally ignored while GPS Rescue is running
If flyaway condition is met and a mag is in use, mag is disabled and countdown is reset
Minor cleanup
2019-01-11 06:26:01 +01:00
mikeller
468d8a3af5 Added 'small_angle' indicator to OSD flip arrow. 2018-12-20 01:20:49 +13:00
mikeller
a03f30efa0 Converted 'SKIP_' defines to 'USE_'. 2018-10-25 00:38:05 +13:00
Bruce Luckcuck
0074f05573 Remove unused IMU parameters 2018-09-24 16:14:03 -04:00
mikeller
6394cc275d Fixed problems with accelerometer. 2018-08-20 15:54:29 +12:00
leocb
34b0707cb6 change divisions by acc_1G to multiply by the reciprocal value 2018-08-09 14:41:05 -03:00
Michael Keller
e2cf7fc238
Merge pull request #6233 from leocb/add-gforce-osd
Added G-Force to the OSD
2018-07-17 18:28:58 +12:00
Bruce Luckcuck
5cd886017d Fix throttle angle correction when smoothing throttle; reduce processing overhead
Change the logic to not modify rcCommand directly and instead apply the additional throttle directly in the mixer.

Also move the logic to the attitude task instead of having it calculate in the PID loop. The logic relies on an angle that's only updated in the attitude task so there was no point in running the calculation every PID loop.
2018-06-28 15:56:01 -04:00
leocb
e2eca1b762 Added G-Force to the OSD 2018-06-27 13:56:26 -03:00
Curtis Bangert
8950eb1f68 Moved updateGPSRescueState to imuUpdateAttitude. gps_rescue.c tidy. 2018-06-14 02:21:12 -04:00
Michael Keller
4ead807edd
Revert "Moved updateGPSRescueState to imuUpdateAttitude. gps_rescue.c tidy." 2018-06-14 13:25:52 +12:00
Curtis Bangert
953e2ad0e9 Moved updateGPSRescueState to imuUpdateAttitude. gps_rescue.c tidy. 2018-06-13 11:36:49 -04:00
Diego Basch
c46be03047 added gps for altitude estimation, remove most unused code, rename altitude.c to position.c, add hdop to nmea 2018-05-04 08:45:26 -07:00
blckmn
a9f74cd6df Removed excess trailing spaces before new lines on licenses. 2018-04-25 20:58:00 +10:00
s0up
feba4c329d set courseoverground to unused on simulator build 2018-04-23 17:21:32 -07:00
s0up
ff247c3817 fix missing blocks 2018-04-23 15:02:26 -07:00
s0up
4e3a21d2b3 imu changes to allow for GPS rescue mode & fix home error 2018-04-23 14:56:05 -07:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
etracer65
abe5b61ff8 IMU attitude estimate accelerated convergence after disarming (#5425)
After disarming and allowing the gyros to settle with no motion, temporarily increase the dcmKpGain to rapidly converge on the correct attitude as indicated by the accelerometer (if present).

Addresses the case of the attitude estimate becoming significantly incorrect after a crash due to high gyro rates.  While the estimate will eventually converge, it does so quite slowly.  The pilot may re-arm before the estimate has corrected leading to instant flips in self-leveling modes.  By speeding up the convergence when disarmed we help reduce this risk.
2018-03-15 20:17:19 +13:00
etracer65
f674b01bc8 Change ACC health check to use averaged rather than only the last (#5413)
The function imuIsAccelerometerHealthy() was only using the last ACC sample to determine if the sensor was returning "healthy" data.  This then controlled whether the IMU attitude calculation considered ACC data at all.  There were two problems with this:

1. A single sample from the ACC can be very noisy and exceed the check threshold resulting in a false negative on the health of the sensor.
2. The attitude calculations exclusively used the averaged ACC samples so there was an inconsistency in checking only the last sample to determine if the data was useful.

This change should lead to fewer occurences of the ACC sensor data being ignored in the attitude estimation which should in turn improve the overall estimate.
2018-03-15 02:19:13 +13:00
etracer65
18b857de65 Correct nested if else for USE_MAG and USE_GPS (#5414)
If USE_MAG was undefined but USE_GPS was defined, then the "else if" would incorrectly apply to a condition above making the USE_GPS section unlikely to execute.
2018-03-08 09:48:22 +13:00
Martin Budden
d7ccd2488c Avoid compass calculation in IMU when USE_MAG not defined 2018-02-01 10:48:05 +00:00
Martin Budden
3116ef4008 Moved compass health check into compass.c 2018-01-21 14:51:59 +00:00
George Gougoudis
3884d9383c Fix IMU mutex lock 2018-01-21 05:58:24 +02:00
Martin Budden
d90b42970c Acc fn/variable renames to align with iNav 2017-12-29 10:23:51 +00:00
jflyper
11c47c631b Port iNav's rangefinder 2017-12-20 12:54:19 +09:00
mikeller
b489d0ba9d Renamed 'parameter_group' to 'pg'. 2017-12-19 23:36:31 +13:00
Martin Budden
c0b1572175 Fix to acc gyro accumulation code 2017-11-28 16:04:00 +00:00
Martin Budden
22c672fa7d Add acc and gyro accumulators to improve attitude estimation 2017-11-28 06:26:57 +00:00
Martin Budden
d3d5b107cc
Merge pull request #4656 from martinbudden/bfa_imu_acc_alt_hold
Removed unnecessary acc calculation when no alt hold
2017-11-28 00:51:28 +00:00
Martin Budden
b6c3a9f19a Use float for imuIsAccelerometerHealthy calculation 2017-11-25 08:45:57 +00:00
Martin Budden
cfca75204f Removed unnecessary acc calculation when no alt hold 2017-11-25 08:37:25 +00:00
mikeller
a8d34dabb0 Changed defines for GYRO/ACC/MAG/BARO/GPS/SONAR/OSD/BLACKBOX/CMS to conform to the USE_ convention. 2017-11-05 10:15:24 +13:00
Adrian Miriuta
7146c40ca8 HEADFREE true 3D (second edition)...
reduced memory footprint ...
	rebased squashed cleanup
2017-09-23 07:35:30 +02:00
Steffen Windoffer
03aa31acdd remove not needed whitespaces 2017-08-24 11:33:39 +02:00
Martin Budden
a86ac89448 Whitespace tidy 2017-07-05 09:34:44 +01:00
Martin Budden
3d4f0bb137 Whitespace tidy 2017-07-05 06:36:22 +01:00
Martin Budden
564e0c94b8 Move some GPS variables into struct. Some alignment with iNav 2017-06-25 14:44:04 +01:00
Dan Nixon
3dae29611e Refactor IMU unit test 2017-06-11 11:44:52 +01:00
Martin Budden
23f158913e Moved time functions out of system.h into time.h 2017-05-26 14:03:28 +01:00
Martin Budden
0219d6adc7 Updated accgyro locking. Printf tidy 2017-04-10 14:54:25 +01:00
cs8425
efbb7520a8 some fix & should be usable
use quaternion directly & we can fly in 3D mode now

rename uartPort_t to tcpPort_t

fix race on ACC, GYRO, IMU

fix gyro scale & disable SystemLoad calculate

update README.md

remove some unused

fix scale on 3D mode
2017-04-09 10:58:01 +08:00