fw pos ctrl: rework manual takeoff aid

- takeoff situational knowledge removed from all other modes except manual (or actual takeoff mode)
- manual takeoff is marked complete if at a controllable airspeed
- minimum pitch bounds TECS until manual takeoff complete
- remove individual roll constraints during manual takeoff (ground proximity constraints coming in subsequent commit)
This commit is contained in:
Thomas Stastny
2022-07-18 10:49:27 -04:00
committed by Daniel Agar
parent 73010cc69b
commit 5241f016f7
2 changed files with 48 additions and 89 deletions
@@ -145,6 +145,9 @@ static constexpr float MAX_WEIGHT_RATIO = 2.0f;
// air density of standard athmosphere at 5000m above mean sea level [kg/m^3]
static constexpr float AIR_DENSITY_STANDARD_ATMOS_5000_AMSL = 0.7363f;
// [rad] minimum pitch while airspeed has not yet reached a controllable value in manual position controlled takeoff modes
static constexpr float MIN_PITCH_DURING_MANUAL_TAKEOFF = 0.0f;
class FixedwingPositionControl final : public ModuleBase<FixedwingPositionControl>, public ModuleParams,
public px4::WorkItem
{
@@ -265,6 +268,9 @@ private:
// [us] time at which the plane went in the air
hrt_abstime _time_went_in_air{0};
// indicates whether we have completed a manual takeoff in a position control mode
bool _completed_manual_takeoff{false};
// Takeoff launch detection and runway
LaunchDetector _launchDetector;
LaunchDetectionResult _launch_detection_state{LAUNCHDETECTION_RES_NONE};
@@ -409,9 +415,11 @@ private:
float getManualHeightRateSetpoint();
/**
* @brief Check if we are in a takeoff situation
* @brief Updates a state indicating whether a manual takeoff has been completed.
*
* Criteria include passing an airspeed threshold and not being in a landed state. VTOL airframes always pass.
*/
bool in_takeoff_situation();
void updateManualTakeoffStatus();
/**
* @brief Update desired altitude base on user pitch stick input