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