Launch Detector: remove LAUN_CAT_PMAX

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
Silvan Fuhrer 2022-11-03 17:30:47 +01:00
parent 5161165d85
commit b05878690d
7 changed files with 2 additions and 63 deletions

View File

@ -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,

View File

@ -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

View File

@ -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<px4::params::LAUN_CAT_A>) _param_laun_cat_a,
(ParamFloat<px4::params::LAUN_CAT_T>) _param_laun_cat_t,
(ParamFloat<px4::params::LAUN_CAT_MDEL>) _param_laun_cat_mdel,
(ParamFloat<px4::params::LAUN_CAT_PMAX>) _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<px4::params::LAUN_CAT_MDEL>) _param_laun_cat_mdel
)
};

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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);