Commit Graph

42020 Commits

Author SHA1 Message Date
Samuel Tabor 4a39a43c10 AP_Soaring: Add log documentation. 2020-04-08 09:11:54 +10:00
Samuel Tabor b9daae062c AP_Soaring: Use enum class rather than typedef enum for states and hide details of these. 2020-04-08 09:11:54 +10:00
Samuel Tabor d7ce3ff72e AP_Soaring: Don't check throttle status on entry to loiter, because it is automatically set on first pass in update_soaring. 2020-04-08 09:11:54 +10:00
Samuel Tabor 3228cc3309 AP_TECS: Update descriptions of pitch feed-forward parameters. 2020-04-08 09:11:54 +10:00
Samuel Tabor 36a90cf443 Plane: Remove unused isHeadingLinedUp function, and rename functions to avoid confusion. 2020-04-08 09:11:54 +10:00
Samuel Tabor 0df6d74d77 AP_Soaring: Update autotest to use delay_sim_time not wait_seconds. 2020-04-08 09:11:54 +10:00
Samuel Tabor 6e75890bd9 AP_Soaring: Add a low pass of target position from EKF before using it. 2020-04-08 09:11:54 +10:00
Samuel Tabor f23efdd13b AP_Soaring: Make vario time constant public. 2020-04-08 09:11:54 +10:00
Samuel Tabor 7168a65155 Autotest: Simplify soaring.py. 2020-04-08 09:11:54 +10:00
Samuel Tabor d04c6cb02e TECS: Don't override the speedweight to 0 if synthetic airspeed is in use. 2020-04-08 09:11:54 +10:00
Samuel Tabor 170b599469 Plane: Required changes for conditional soaring compilation (fmuv2). 2020-04-08 09:11:54 +10:00
Samuel Tabor 56649fa8eb AP_Soaring: Fix too-long status message. 2020-04-08 09:11:54 +10:00
Samuel Tabor d54c7f1b7a AP_Soaring: Fix bug when no soaring activation RC channel set. 2020-04-08 09:11:54 +10:00
Samuel Tabor fbd0df81a7 AP_Soaring: Report changes in active status. 2020-04-08 09:11:54 +10:00
Samuel Tabor e1f7122566 AP_Soaring: Improve tracking of enabled/disabled status. 2020-04-08 09:11:54 +10:00
Samuel Tabor 5ac801b2ac AP_Soaring: Use 64 bit variable for time to avoid overflow. 2020-04-08 09:11:54 +10:00
Samuel Tabor 528dcc3f6b Autotest: Add test for soaring. 2020-04-08 09:11:54 +10:00
Samuel Tabor e7418637ee Plane: In FBWB make target alt track current if soaring is enabled and suppressing throttle. 2020-04-08 09:11:54 +10:00
Samuel Tabor ed7e359f4d Plane: Make target altitude track current altitude when gliding. 2020-04-08 09:11:54 +10:00
Samuel Tabor 2260fda4ec AP_Soaring: Detect changes in active parameter/switch position. 2020-04-08 09:11:54 +10:00
Samuel Tabor fdf7eae01c AP_Soaring: Adjust initial EKF values and limit R to 40.0m. 2020-04-08 09:11:54 +10:00
Samuel Tabor ff1725b549 AP_Soaring: Make enable channel 3 position. PWM above 1400us allows most soaring features, but above 1700us is required before any automatic switch to LOITER mode. 2020-04-08 09:11:54 +10:00
Samuel Tabor 1160c59a89 AP_Soaring: Remove dsp bias and log this. 2020-04-08 09:11:54 +10:00
Samuel Tabor c28c573da1 AP_Soaring: Also log acceleration. 2020-04-08 09:11:54 +10:00
Samuel Tabor 7555f5abf8 AP_Soaring: Fix incorrect trig function and log the expected sink. 2020-04-08 09:11:54 +10:00
Samuel Tabor 17f1fa9600 AP_Soaring: Fix use of double precision sqrt. 2020-04-08 09:11:54 +10:00
Samuel Tabor 7d3ff28974 AP_Soaring: Correct bug with reversed arguments. 2020-04-08 09:11:54 +10:00
Samuel Tabor 16b7de4029 AP_Soaring: Cleanup variometer. 2020-04-08 09:11:54 +10:00
Samuel Tabor 62a34e0f8d AP_Soaring: Calculate filter time constant based on airspeed and loiter radius, using 3x circline rate. 2020-04-08 09:11:54 +10:00
Samuel Tabor 2b40182b34 AP_Soaring: Reduce drift feed-forward by ratio of climb rate to thermal core strength. This is consistent with assumption that each packet of air, rising at core strength, is convected with the ambient wind speed. 2020-04-08 09:11:54 +10:00
Samuel Tabor 15cef55e97 SITL: Make thermal drift relative to 100m alt to avoid so much change with wind speed and direction." 2020-04-08 09:11:54 +10:00
Samuel Tabor 8072f6b858 AP_Soaring: Make the trigger VSPEED take account of thermalling sink. 2020-04-08 09:11:54 +10:00
Samuel Tabor 650b464831 AP_Soaring: Move drift check to separate function and check drift with reference to mission segment, allowing drift in right direction. LOITER target, not current position, is now used. 2020-04-08 09:11:54 +10:00
Samuel Tabor 45cb663d73 AP_Math: Add template for Vector2f::projected. 2020-04-08 09:11:54 +10:00
Samuel Tabor fab74f8927 AP_Soaring: Calculate expected thermalling sink live and avoid divide by zero by limiting airspeed to that corresponding to CL max (generously assumed 1.5 for glider). 2020-04-08 09:11:54 +10:00
Samuel Tabor 5963164a22 Plane: Soaring, make zero SOAR_MAX_RADIUS always RTL, and -1 never. 2020-04-08 09:11:54 +10:00
Samuel Tabor 75f772b269 AP_Soaring: Add SOAR_MAX_RADIUS parameter, that defines when a RTL will be used when exiting LOITER. 2020-04-08 09:11:54 +10:00
Samuel Tabor 298088268a Plane: Soaring, don't wait for heading if too low, and add timeout otherwise. 2020-04-08 09:11:54 +10:00
Samuel Tabor 684ee11fc3 AP_TECS: Add flags to indicate gliding flight, and use these with AP_Soaring. 2020-04-08 09:11:54 +10:00
Samuel Tabor dc8c062fbe AP_TECS: Correct an error in the SEBdot FF term. 2020-04-08 09:11:54 +10:00
Samuel Tabor 247738518e AP_TECS: Add a feed-forward term from adjusted demanded airspeed to nav pitch. 2020-04-08 09:11:54 +10:00
Samuel Tabor a27c99fab9 AP_TECS: Return the adjusted demanded airspeed. The aspd_error mavlink message now shows the rate-limited airspeed. 2020-04-08 09:11:54 +10:00
Samuel Tabor ae27f96361 SITL: Make soaring thermals slanted. 2020-04-08 09:11:54 +10:00
Samuel Tabor a18d6e925d AP_Soaring: Improved default sim parameters. 2020-04-08 09:11:54 +10:00
Samuel Tabor 013628bd1d Plane: Soaring - better reporting of exit due to drift. 2020-04-08 09:11:54 +10:00
Samuel Tabor e1b2360781 AP_Soaring: Add a maximum allowable drift distance when thermalling. 2020-04-08 09:11:54 +10:00
Samuel Tabor 96bc0e1e03 Plane: Soaring: Reset loiter.sum_cd when good to continue thermalling, so that exit heading acceptance criteria does not grow. 2020-04-08 09:11:54 +10:00
Samuel Tabor e7736fb5e7 AP_Soaring: Line up on current, not next, nav command. 2020-04-08 09:11:54 +10:00
Samuel Tabor 936d4232c9 AP_Soaring: Add a 60s first order filter on climb rate. If this becomes negative exit thermalling. 2020-04-08 09:11:54 +10:00
Samuel Tabor a56b1dadb9 Plane: fix bug with headingLinedUp when loiter.sum_cd was negative. 2020-04-08 09:11:54 +10:00