mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-24 15:40:31 +08:00
FW Position control: move LAUN_ALL_ON param to FW Positon Control main params
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -1530,7 +1530,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
|
||||
|
||||
} else {
|
||||
/* Perform launch detection */
|
||||
if (!_skipping_takeoff_detection && _launchDetector.launchDetectionEnabled() &&
|
||||
if (!_skipping_takeoff_detection && _param_laun_all_on.get() &&
|
||||
_launchDetector.getLaunchDetected() < launch_detection_status_s::STATE_FLYING) {
|
||||
|
||||
if (_control_mode.flag_armed) {
|
||||
@@ -1546,7 +1546,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
|
||||
}
|
||||
|
||||
if (!_launch_detected && _launchDetector.getLaunchDetected() > launch_detection_status_s::STATE_WAITING_FOR_LAUNCH
|
||||
&& _launchDetector.launchDetectionEnabled()) {
|
||||
&& _param_laun_all_on.get()) {
|
||||
_launch_detected = true;
|
||||
_launch_global_position = global_position;
|
||||
_takeoff_ground_alt = _current_altitude;
|
||||
@@ -1561,7 +1561,7 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
|
||||
|
||||
/* Set control values depending on the detection state */
|
||||
if (_launchDetector.getLaunchDetected() > launch_detection_status_s::STATE_WAITING_FOR_LAUNCH
|
||||
&& _launchDetector.launchDetectionEnabled()) {
|
||||
&& _param_laun_all_on.get()) {
|
||||
/* Launch has been detected, hence we have to control the plane. */
|
||||
|
||||
if (_param_fw_use_npfg.get()) {
|
||||
|
||||
@@ -874,7 +874,8 @@ private:
|
||||
|
||||
(ParamFloat<px4::params::FW_TKO_AIRSPD>) _param_fw_tko_airspd,
|
||||
|
||||
(ParamFloat<px4::params::RWTO_PSP>) _param_rwto_psp
|
||||
(ParamFloat<px4::params::RWTO_PSP>) _param_rwto_psp,
|
||||
(ParamBool<px4::params::LAUN_ALL_ON>) _param_laun_all_on
|
||||
)
|
||||
|
||||
};
|
||||
|
||||
@@ -1118,3 +1118,11 @@ PARAM_DEFINE_INT32(FW_LND_ABORT, 3);
|
||||
* @group FW TECS
|
||||
*/
|
||||
PARAM_DEFINE_FLOAT(FW_WIND_ARSP_SC, 0.f);
|
||||
|
||||
/**
|
||||
* Launch detection
|
||||
*
|
||||
* @boolean
|
||||
* @group FW Launch detection
|
||||
*/
|
||||
PARAM_DEFINE_INT32(LAUN_ALL_ON, 0);
|
||||
|
||||
@@ -74,11 +74,6 @@ public:
|
||||
*/
|
||||
uint getLaunchDetected() const;
|
||||
|
||||
/**
|
||||
* @return Launch detection is enabled
|
||||
*/
|
||||
bool launchDetectionEnabled() { return _param_laun_all_on.get(); }
|
||||
|
||||
void forceSetFlyState() { _state = launch_detection_status_s::STATE_FLYING; }
|
||||
|
||||
private:
|
||||
@@ -100,7 +95,6 @@ private:
|
||||
uint _state{launch_detection_status_s::STATE_WAITING_FOR_LAUNCH};
|
||||
|
||||
DEFINE_PARAMETERS(
|
||||
(ParamBool<px4::params::LAUN_ALL_ON>) _param_laun_all_on,
|
||||
(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
|
||||
|
||||
@@ -40,18 +40,10 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* Catapult launch detection parameters, accessible via MAVLink
|
||||
* Catapult launch detection parameters
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* Launch detection
|
||||
*
|
||||
* @boolean
|
||||
* @group FW Launch detection
|
||||
*/
|
||||
PARAM_DEFINE_INT32(LAUN_ALL_ON, 0);
|
||||
|
||||
/**
|
||||
* Catapult accelerometer threshold.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user