mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 11:59:17 +08:00
Launch Detector: remove LAUN_CAT_PMAX
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -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) ?
|
const float max_takeoff_throttle = (_launch_detection_state != LAUNCHDETECTION_RES_DETECTED_ENABLEMOTORS) ?
|
||||||
_param_fw_thr_idle.get() : _param_fw_thr_max.get();
|
_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,
|
tecs_update_pitch_throttle(control_interval,
|
||||||
altitude_setpoint_amsl,
|
altitude_setpoint_amsl,
|
||||||
target_airspeed,
|
target_airspeed,
|
||||||
radians(_param_fw_p_lim_min.get()),
|
radians(_param_fw_p_lim_min.get()),
|
||||||
radians(takeoff_pitch_max_deg),
|
radians(_param_fw_p_lim_max.get()),
|
||||||
_param_fw_thr_min.get(),
|
_param_fw_thr_min.get(),
|
||||||
max_takeoff_throttle,
|
max_takeoff_throttle,
|
||||||
false,
|
false,
|
||||||
|
|||||||
@@ -109,15 +109,4 @@ void CatapultLaunchMethod::reset()
|
|||||||
state = LAUNCHDETECTION_RES_NONE;
|
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
|
} // namespace launchdetection
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ public:
|
|||||||
void update(const float dt, float accel_x) override;
|
void update(const float dt, float accel_x) override;
|
||||||
LaunchDetectionResult getLaunchDetected() const override;
|
LaunchDetectionResult getLaunchDetected() const override;
|
||||||
void reset() override;
|
void reset() override;
|
||||||
float getPitchMax(float pitchMaxDefault) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float _integrator{0.0f};
|
float _integrator{0.0f};
|
||||||
@@ -69,10 +68,7 @@ private:
|
|||||||
DEFINE_PARAMETERS(
|
DEFINE_PARAMETERS(
|
||||||
(ParamFloat<px4::params::LAUN_CAT_A>) _param_laun_cat_a,
|
(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_T>) _param_laun_cat_t,
|
||||||
(ParamFloat<px4::params::LAUN_CAT_MDEL>) _param_laun_cat_mdel,
|
(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 */
|
|
||||||
)
|
)
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -98,25 +98,4 @@ LaunchDetectionResult LaunchDetector::getLaunchDetected()
|
|||||||
return LAUNCHDETECTION_RES_NONE;
|
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
|
} // namespace launchdetection
|
||||||
|
|||||||
@@ -62,9 +62,6 @@ public:
|
|||||||
LaunchDetectionResult getLaunchDetected();
|
LaunchDetectionResult getLaunchDetected();
|
||||||
bool launchDetectionEnabled() { return _param_laun_all_on.get(); }
|
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:
|
private:
|
||||||
/* holds an index to the launchMethod in the array _launchMethods
|
/* holds an index to the launchMethod in the array _launchMethods
|
||||||
* which detected a Launch. If no launchMethod has detected a launch yet the
|
* which detected a Launch. If no launchMethod has detected a launch yet the
|
||||||
|
|||||||
@@ -63,9 +63,6 @@ public:
|
|||||||
virtual LaunchDetectionResult getLaunchDetected() const = 0;
|
virtual LaunchDetectionResult getLaunchDetected() const = 0;
|
||||||
virtual void reset() = 0;
|
virtual void reset() = 0;
|
||||||
|
|
||||||
/* Returns a upper pitch limit if required, otherwise returns pitchMaxDefault */
|
|
||||||
virtual float getPitchMax(float pitchMaxDefault) = 0;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace launchdetection
|
} // namespace launchdetection
|
||||||
|
|||||||
@@ -93,18 +93,3 @@ PARAM_DEFINE_FLOAT(LAUN_CAT_T, 0.05f);
|
|||||||
* @group FW Launch detection
|
* @group FW Launch detection
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_FLOAT(LAUN_CAT_MDEL, 0.0f);
|
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);
|
|
||||||
|
|||||||
Reference in New Issue
Block a user