diff --git a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp index 2952bdfb5b..0e16424ca7 100644 --- a/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp +++ b/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp @@ -1591,15 +1591,11 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo const float max_takeoff_throttle = (_launch_detection_state != LAUNCHDETECTION_RES_DETECTED_ENABLEMOTORS) ? _param_fw_thr_idle.get() : _param_fw_thr_max.get(); - // select maximum pitch: the launchdetector may impose another limit for the pitch - // depending on the state of the launch - const float takeoff_pitch_max_deg = _launchDetector.getPitchMax(_param_fw_p_lim_max.get()); - tecs_update_pitch_throttle(control_interval, altitude_setpoint_amsl, target_airspeed, radians(_param_fw_p_lim_min.get()), - radians(takeoff_pitch_max_deg), + radians(_param_fw_p_lim_max.get()), _param_fw_thr_min.get(), max_takeoff_throttle, false, diff --git a/src/modules/fw_pos_control_l1/launchdetection/CatapultLaunchMethod.cpp b/src/modules/fw_pos_control_l1/launchdetection/CatapultLaunchMethod.cpp index 28f2fde9ec..4c058032c3 100644 --- a/src/modules/fw_pos_control_l1/launchdetection/CatapultLaunchMethod.cpp +++ b/src/modules/fw_pos_control_l1/launchdetection/CatapultLaunchMethod.cpp @@ -109,15 +109,4 @@ 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 _param_laun_cat_pmax.get(); - } -} - } // namespace launchdetection diff --git a/src/modules/fw_pos_control_l1/launchdetection/CatapultLaunchMethod.h b/src/modules/fw_pos_control_l1/launchdetection/CatapultLaunchMethod.h index 4458b0f9b8..a4b2abe831 100644 --- a/src/modules/fw_pos_control_l1/launchdetection/CatapultLaunchMethod.h +++ b/src/modules/fw_pos_control_l1/launchdetection/CatapultLaunchMethod.h @@ -58,7 +58,6 @@ public: void update(const float dt, float accel_x) override; LaunchDetectionResult getLaunchDetected() const override; void reset() override; - float getPitchMax(float pitchMaxDefault) override; private: float _integrator{0.0f}; @@ -69,10 +68,7 @@ private: DEFINE_PARAMETERS( (ParamFloat) _param_laun_cat_a, (ParamFloat) _param_laun_cat_t, - (ParamFloat) _param_laun_cat_mdel, - (ParamFloat) _param_laun_cat_pmax /**< Upper pitch limit before throttle is turned on. - Can be used to make sure that the AC does not climb - too much while attached to a bungee */ + (ParamFloat) _param_laun_cat_mdel ) }; diff --git a/src/modules/fw_pos_control_l1/launchdetection/LaunchDetector.cpp b/src/modules/fw_pos_control_l1/launchdetection/LaunchDetector.cpp index c54fc9cf4c..e016dd4d7f 100644 --- a/src/modules/fw_pos_control_l1/launchdetection/LaunchDetector.cpp +++ b/src/modules/fw_pos_control_l1/launchdetection/LaunchDetector.cpp @@ -98,25 +98,4 @@ LaunchDetectionResult LaunchDetector::getLaunchDetected() return LAUNCHDETECTION_RES_NONE; } -float LaunchDetector::getPitchMax(float pitchMaxDefault) -{ - if (!launchDetectionEnabled()) { - return pitchMaxDefault; - } - - /* if a lauchdetectionmethod is active or only one exists return the pitch limit from this method, - * otherwise use the default limit */ - if (_activeLaunchDetectionMethodIndex < 0) { - if (sizeof(_launchMethods) / sizeof(LaunchMethod *) > 1) { - return pitchMaxDefault; - - } else { - return _launchMethods[0]->getPitchMax(pitchMaxDefault); - } - - } else { - return _launchMethods[_activeLaunchDetectionMethodIndex]->getPitchMax(pitchMaxDefault); - } -} - } // namespace launchdetection diff --git a/src/modules/fw_pos_control_l1/launchdetection/LaunchDetector.h b/src/modules/fw_pos_control_l1/launchdetection/LaunchDetector.h index c96ccdec89..145ac893f9 100644 --- a/src/modules/fw_pos_control_l1/launchdetection/LaunchDetector.h +++ b/src/modules/fw_pos_control_l1/launchdetection/LaunchDetector.h @@ -62,9 +62,6 @@ public: LaunchDetectionResult getLaunchDetected(); bool launchDetectionEnabled() { return _param_laun_all_on.get(); } - /* Returns a maximum pitch in deg. Different launch methods may impose upper pitch limits during launch */ - float getPitchMax(float pitchMaxDefault); - private: /* holds an index to the launchMethod in the array _launchMethods * which detected a Launch. If no launchMethod has detected a launch yet the diff --git a/src/modules/fw_pos_control_l1/launchdetection/LaunchMethod.h b/src/modules/fw_pos_control_l1/launchdetection/LaunchMethod.h index ec0a7dee75..43d9535486 100644 --- a/src/modules/fw_pos_control_l1/launchdetection/LaunchMethod.h +++ b/src/modules/fw_pos_control_l1/launchdetection/LaunchMethod.h @@ -63,9 +63,6 @@ public: virtual LaunchDetectionResult getLaunchDetected() const = 0; virtual void reset() = 0; - /* Returns a upper pitch limit if required, otherwise returns pitchMaxDefault */ - virtual float getPitchMax(float pitchMaxDefault) = 0; - }; } // namespace launchdetection diff --git a/src/modules/fw_pos_control_l1/launchdetection/launchdetection_params.c b/src/modules/fw_pos_control_l1/launchdetection/launchdetection_params.c index 1575cd09b2..bc19f20bf8 100644 --- a/src/modules/fw_pos_control_l1/launchdetection/launchdetection_params.c +++ b/src/modules/fw_pos_control_l1/launchdetection/launchdetection_params.c @@ -93,18 +93,3 @@ PARAM_DEFINE_FLOAT(LAUN_CAT_T, 0.05f); * @group FW Launch detection */ PARAM_DEFINE_FLOAT(LAUN_CAT_MDEL, 0.0f); - -/** - * Maximum pitch before the throttle is powered up (during motor delay phase) - * - * This is an extra limit for the maximum pitch which is imposed in the phase before the throttle turns on. - * This allows to limit the maximum pitch angle during a bungee launch (make the launch less steep). - * - * @unit deg - * @min 0.0 - * @max 45.0 - * @decimal 1 - * @increment 0.5 - * @group FW Launch detection - */ -PARAM_DEFINE_FLOAT(LAUN_CAT_PMAX, 30.0f);