mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 09:40:35 +08:00
precland: add a method to check if precland is activated
This commit is contained in:
committed by
Julian Oes
parent
ad4d4287fa
commit
ed9e504695
@@ -101,6 +101,8 @@ PrecLand::on_activation()
|
||||
_last_slewrate_time = 0;
|
||||
|
||||
switch_to_state_start();
|
||||
|
||||
_is_activated = true;
|
||||
}
|
||||
|
||||
void
|
||||
@@ -158,6 +160,12 @@ PrecLand::on_active()
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
PrecLand::on_inactivation()
|
||||
{
|
||||
_is_activated = false;
|
||||
}
|
||||
|
||||
void
|
||||
PrecLand::updateParams()
|
||||
{
|
||||
|
||||
@@ -72,11 +72,14 @@ public:
|
||||
|
||||
void on_activation() override;
|
||||
void on_active() override;
|
||||
void on_inactivation() override;
|
||||
|
||||
void set_mode(PrecLandMode mode) { _mode = mode; };
|
||||
|
||||
PrecLandMode get_mode() { return _mode; };
|
||||
|
||||
bool is_activated() { return _is_activated; };
|
||||
|
||||
private:
|
||||
|
||||
void updateParams() override;
|
||||
@@ -125,6 +128,8 @@ private:
|
||||
|
||||
PrecLandMode _mode{PrecLandMode::Opportunistic};
|
||||
|
||||
bool _is_activated {false}; /**< indicates if precland is activated */
|
||||
|
||||
DEFINE_PARAMETERS(
|
||||
(ParamFloat<px4::params::PLD_BTOUT>) _param_pld_btout,
|
||||
(ParamFloat<px4::params::PLD_HACC_RAD>) _param_pld_hacc_rad,
|
||||
|
||||
Reference in New Issue
Block a user