weathervane: use a single parameter to enable

- in auto mode we always run weather vane
- in manual model we just use it in position control mode

Signed-off-by: Roman <bapstroman@gmail.com>
This commit is contained in:
Roman
2018-09-19 08:27:07 +02:00
committed by Lorenz Meier
parent ee5007e886
commit ad88ef14e1
3 changed files with 7 additions and 19 deletions
+2 -5
View File
@@ -58,9 +58,7 @@ public:
bool is_active() {return _is_active;}
bool manual_enabled() { return _wv_manual_enabled.get(); }
bool auto_enabled() { return _wv_auto_enabled.get(); }
bool weathervane_enabled() { return _wv_enabled.get(); }
void update(const matrix::Quatf &q_sp_prev, float yaw);
@@ -75,8 +73,7 @@ private:
bool _is_active = true;
DEFINE_PARAMETERS(
(ParamBool<px4::params::WV_MAN_EN>) _wv_manual_enabled,
(ParamBool<px4::params::WV_AUTO_EN>) _wv_auto_enabled,
(ParamBool<px4::params::WV_EN>) _wv_enabled,
(ParamFloat<px4::params::WV_ROLL_MIN>) _wv_min_roll,
(ParamFloat<px4::params::WV_GAIN>) _wv_gain,
(ParamFloat<px4::params::WV_YRATE_MAX>) _wv_max_yaw_rate
+2 -10
View File
@@ -40,20 +40,12 @@
*/
/**
* Enable weathervane for manual position control mode.
* Enable weathervane.
*
* @boolean
* @group Multicopter Position Control
*/
PARAM_DEFINE_INT32(WV_MAN_EN, 0);
/**
* Enable weathervane for auto.
*
* @boolean
* @group Multicopter Position Control
*/
PARAM_DEFINE_INT32(WV_AUTO_EN, 0);
PARAM_DEFINE_INT32(WV_EN, 0);
/**
* Weather-vane roll angle to yawrate.