mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-29 08:33:34 +08:00
remove in air vs landed knowledge from TECS
- create integral and trajectory generator reset methods - always run TECS unless in rotary-wing mode (or in transition) - constantly reset TECS integrals and trajectory generators when landed
This commit is contained in:
committed by
Daniel Agar
parent
ddeca2538c
commit
eed073887d
+18
-3
@@ -81,7 +81,6 @@ public:
|
||||
* Must be called at 50Hz or greater
|
||||
*/
|
||||
void update_vehicle_state_estimates(float equivalent_airspeed, const float speed_deriv_forward, bool altitude_lock,
|
||||
bool in_air,
|
||||
float altitude, float vz);
|
||||
|
||||
/**
|
||||
@@ -99,6 +98,23 @@ public:
|
||||
|
||||
void reset_state() { _states_initialized = false; }
|
||||
|
||||
void resetIntegrals()
|
||||
{
|
||||
_throttle_integ_state = 0.0f;
|
||||
_pitch_integ_state = 0.0f;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Resets the altitude and height rate control trajectory generators to the input altitude
|
||||
*
|
||||
* @param altitude Vehicle altitude (AMSL) [m]
|
||||
*/
|
||||
void resetTrajectoryGenerators(const float altitude)
|
||||
{
|
||||
_alt_control_traj_generator.reset(0, 0, altitude);
|
||||
_velocity_control_traj_generator.reset(0.0f, 0.0f, altitude);
|
||||
}
|
||||
|
||||
enum ECL_TECS_MODE {
|
||||
ECL_TECS_MODE_NORMAL = 0,
|
||||
ECL_TECS_MODE_UNDERSPEED,
|
||||
@@ -307,8 +323,7 @@ private:
|
||||
bool _uncommanded_descent_recovery{false}; ///< true when a continuous descent caused by an unachievable airspeed demand has been detected
|
||||
bool _climbout_mode_active{false}; ///< true when in climbout mode
|
||||
bool _airspeed_enabled{false}; ///< true when airspeed use has been enabled
|
||||
bool _states_initialized{false}; ///< true when TECS states have been iniitalized
|
||||
bool _in_air{false}; ///< true when the vehicle is flying
|
||||
bool _states_initialized{false}; ///< true when TECS states have been iniitalized
|
||||
|
||||
/**
|
||||
* Update the airspeed internal state using a second order complementary filter
|
||||
|
||||
Reference in New Issue
Block a user