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

Plane: added option to enable ground mode when armed #24863

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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 ArduPlane/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1084,6 +1084,7 @@ const AP_Param::GroupInfo ParametersG2::var_info[] = {
// @Bitmask: 11: Disable suppression of fixed wing rate gains in ground mode
// @Bitmask: 12: Enable FBWB style loiter altitude control
// @Bitmask: 13: Indicate takeoff waiting for neutral rudder with flight control surfaces
// @Bitmask: 14: Enable ground mode PID suppression when armed and not flying
// @User: Advanced
AP_GROUPINFO("FLIGHT_OPTIONS", 13, ParametersG2, flight_options, 0),

Expand Down
1 change: 1 addition & 0 deletions ArduPlane/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ enum FlightOptions {
DISABLE_GROUND_PID_SUPPRESSION = (1<<11),
ENABLE_LOITER_ALT_CONTROL = (1<<12),
INDICATE_WAITING_FOR_RUDDER_NEUTRAL = (1<<13),
ENABLE_GROUND_PID_SUPPRESSION_ARMED = (1<<14),
};

enum CrowFlapOptions {
Expand Down
9 changes: 7 additions & 2 deletions ArduPlane/is_flying.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,13 @@ void Plane::update_is_flying_5Hz(void)
// tell AHRS flying state
set_likely_flying(new_is_flying);

// conservative ground mode value for rate D suppression
ground_mode = !is_flying() && !arming.is_armed_and_safety_off();
// conservative ground mode value for rate D suppression. By
// default don't do ground mode when armed. User can set
// FLIGHT_OPTIONS bit to enable when armed and not flying
ground_mode = !is_flying();
if (!plane.flight_option_enabled(FlightOptions::ENABLE_GROUND_PID_SUPPRESSION_ARMED)) {
ground_mode &= !arming.is_armed_and_safety_off();
}
}

/*
Expand Down
Loading