mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
mtecs: do not calculate derivative in first iteration
This commit is contained in:
parent
7716a1816d
commit
db925db460
@ -861,6 +861,7 @@ FixedwingPositionControl::control_position(const math::Vector<2> ¤t_positi
|
||||
/* reset integrators */
|
||||
if (_mTecs.getEnabled()) {
|
||||
_mTecs.resetIntegrators();
|
||||
_mTecs.resetDerivatives(_airspeed.true_airspeed_m_s);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -261,6 +261,12 @@ void mTecs::resetIntegrators()
|
||||
_firstIterationAfterReset = true;
|
||||
}
|
||||
|
||||
void mTecs::resetDerivatives(float airspeed)
|
||||
{
|
||||
_airspeedDerivative.setU(airspeed);
|
||||
}
|
||||
|
||||
|
||||
void mTecs::updateTimeMeasurement()
|
||||
{
|
||||
if (!_dtCalculated) {
|
||||
|
||||
@ -139,6 +139,10 @@ public:
|
||||
*/
|
||||
void resetIntegrators();
|
||||
|
||||
/*
|
||||
* Reset all derivative calculations
|
||||
*/
|
||||
void resetDerivatives(float airspeed);
|
||||
|
||||
/* Accessors */
|
||||
bool getEnabled() {return _mTecsEnabled.get() > 0;}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user