diff options
author | Thomas Gubler <thomasgubler@student.ethz.ch> | 2013-10-31 14:22:32 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@student.ethz.ch> | 2013-10-31 14:22:32 +0100 |
commit | c275f785414121c567523db00def3f76349a218f (patch) | |
tree | 8425a2f902d9bbe5bb0a194a031216bb907170fa /src/lib | |
parent | cf862bf810f9c6e86f0b756b71e57796d523bdae (diff) | |
parent | c0100b5e17b87b1c721a115bdbe535ab606bd58e (diff) | |
download | px4-firmware-c275f785414121c567523db00def3f76349a218f.tar.gz px4-firmware-c275f785414121c567523db00def3f76349a218f.tar.bz2 px4-firmware-c275f785414121c567523db00def3f76349a218f.zip |
Merge branch 'tecs_experimental_prate' into fw_staging_ouputlimit_master_heightrate
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/external_lgpl/tecs/tecs.cpp | 2 | ||||
-rw-r--r-- | src/lib/external_lgpl/tecs/tecs.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/lib/external_lgpl/tecs/tecs.cpp b/src/lib/external_lgpl/tecs/tecs.cpp index 5cbc19dbb..a94a06dda 100644 --- a/src/lib/external_lgpl/tecs/tecs.cpp +++ b/src/lib/external_lgpl/tecs/tecs.cpp @@ -231,7 +231,7 @@ void TECS::_update_height_demand(float demand, float state) _hgt_dem_adj = demand;//0.025f * demand + 0.975f * _hgt_dem_adj_last; _hgt_dem_adj_last = _hgt_dem_adj; - _hgt_rate_dem = (_hgt_dem_adj-state)*0.1f; //xxx: parameter + _hgt_rate_dem = (_hgt_dem_adj-state)*_heightrate_p; // Limit height rate of change if (_hgt_rate_dem > _maxClimbRate) { _hgt_rate_dem = _maxClimbRate; diff --git a/src/lib/external_lgpl/tecs/tecs.h b/src/lib/external_lgpl/tecs/tecs.h index 224f35366..d07bd00dd 100644 --- a/src/lib/external_lgpl/tecs/tecs.h +++ b/src/lib/external_lgpl/tecs/tecs.h @@ -178,6 +178,10 @@ public: _indicated_airspeed_max = airspeed; } + void set_heightrate_p(float heightrate_p) { + _heightrate_p = heightrate_p; + } + private: // Last time update_50Hz was called uint64_t _update_50hz_last_usec; @@ -201,6 +205,7 @@ private: float _vertAccLim; float _rollComp; float _spdWeight; + float _heightrate_p; // throttle demand in the range from 0.0 to 1.0 float _throttle_dem; |