diff options
author | sjwilks <sjwilks@gmail.com> | 2014-09-11 09:49:14 +0200 |
---|---|---|
committer | sjwilks <sjwilks@gmail.com> | 2014-09-11 09:49:14 +0200 |
commit | 852b36661d5f03d76c8217444554122c3cadfba0 (patch) | |
tree | 3814de9a3f7bd92c68f38975184f86139accef29 /src/lib/launchdetection/CatapultLaunchMethod.cpp | |
parent | e4f3fd88f0623659e6759b9b076be15e4e2f5703 (diff) | |
parent | 26e6d7e12e5036b0e3008b0543d7771d3e527a39 (diff) | |
download | px4-firmware-852b36661d5f03d76c8217444554122c3cadfba0.tar.gz px4-firmware-852b36661d5f03d76c8217444554122c3cadfba0.tar.bz2 px4-firmware-852b36661d5f03d76c8217444554122c3cadfba0.zip |
Merge pull request #1356 from PX4/launchpitchlimit_master
FW: additional upper pitch limit during launch
Diffstat (limited to 'src/lib/launchdetection/CatapultLaunchMethod.cpp')
-rw-r--r-- | src/lib/launchdetection/CatapultLaunchMethod.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lib/launchdetection/CatapultLaunchMethod.cpp b/src/lib/launchdetection/CatapultLaunchMethod.cpp index 65ae461db..2ea1c414b 100644 --- a/src/lib/launchdetection/CatapultLaunchMethod.cpp +++ b/src/lib/launchdetection/CatapultLaunchMethod.cpp @@ -52,7 +52,8 @@ CatapultLaunchMethod::CatapultLaunchMethod(SuperBlock *parent) : state(LAUNCHDETECTION_RES_NONE), thresholdAccel(this, "A"), thresholdTime(this, "T"), - motorDelay(this, "MDEL") + motorDelay(this, "MDEL"), + pitchMaxPreThrottle(this, "PMAX") { } @@ -118,4 +119,14 @@ void CatapultLaunchMethod::reset() state = LAUNCHDETECTION_RES_NONE; } +float CatapultLaunchMethod::getPitchMax(float pitchMaxDefault) { + /* If motor is turned on do not impose the extra limit on maximum pitch */ + if (state == LAUNCHDETECTION_RES_DETECTED_ENABLEMOTORS) { + return pitchMaxDefault; + } else { + return pitchMaxPreThrottle.get(); + } + +} + } |