Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fw_tecs: Support tighter altitude tracking during low-height flight #23519

Merged
merged 13 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions msg/TecsStatus.msg
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ uint64 timestamp # time since system start (microseconds)

float32 altitude_sp # Altitude setpoint AMSL [m]
float32 altitude_reference # Altitude setpoint reference AMSL [m]
float32 altitude_time_constant # Time constant of the altitude tracker [s]
float32 height_rate_reference # Height rate setpoint reference [m/s]
float32 height_rate_direct # Direct height rate setpoint from velocity reference generator [m/s]
float32 height_rate_setpoint # Height rate setpoint [m/s]
Expand Down
8 changes: 8 additions & 0 deletions src/lib/tecs/TECS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,14 @@ class TECS
float get_pitch_setpoint() {return _control.getPitchSetpoint();}
float get_throttle_setpoint() {return _control.getThrottleSetpoint();}

/**
* Returns the altitude tracking time constant
*/
float get_altitude_error_time_constant() const
{
return 1.0f / math::max(_control_param.altitude_error_gain, 0.01f);
}

uint64_t timestamp() { return _update_timestamp; }
float get_underspeed_ratio() { return _control.getRatioUndersped(); }

Expand Down
Loading
Loading