precland: add a method to check if precland is activated

This commit is contained in:
Dusan Zivkovic
2019-10-24 15:41:42 +02:00
committed by Julian Oes
parent ad4d4287fa
commit ed9e504695
2 changed files with 13 additions and 0 deletions
+8
View File
@@ -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()
{
+5
View File
@@ -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,