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

This allows user to set the surface positions for the aeroterminate #15458

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions ArduPlane/afs_plane.cpp
Expand Up @@ -30,9 +30,9 @@ void AP_AdvancedFailsafe_Plane::terminate_vehicle(void)
// aerodynamic termination is the default approach to termination
SRV_Channels::set_output_scaled(SRV_Channel::k_flap_auto, 100);
SRV_Channels::set_output_scaled(SRV_Channel::k_flap, 100);
SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, SERVO_MAX);
SRV_Channels::set_output_scaled(SRV_Channel::k_rudder, SERVO_MAX);
SRV_Channels::set_output_scaled(SRV_Channel::k_elevator, SERVO_MAX);
SRV_Channels::set_output_scaled(SRV_Channel::k_aileron, SERVO_MAX * _terminate_pos_ail/100.0);
SRV_Channels::set_output_scaled(SRV_Channel::k_rudder, SERVO_MAX * _terminate_pos_rud/100.0);
SRV_Channels::set_output_scaled(SRV_Channel::k_elevator, SERVO_MAX * _terminate_pos_ele/100.0);
if (plane.have_reverse_thrust()) {
// configured for reverse thrust, use TRIM
SRV_Channels::set_output_limit(SRV_Channel::k_throttle, SRV_Channel::Limit::TRIM);
Expand Down
24 changes: 24 additions & 0 deletions libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.cpp
Expand Up @@ -158,6 +158,30 @@ const AP_Param::GroupInfo AP_AdvancedFailsafe::var_info[] = {
// @Units: km
AP_GROUPINFO("MAX_RANGE", 20, AP_AdvancedFailsafe, _max_range_km, 0),

// @Param: TERM_POS_AIL
// @DisplayName: Terminate Aileron Position
// @Description: This is the position the aileron will go to during an aerotermination. 0 means neutral deflection, default is 100.
// @User: Advanced
// @Units: %
// @Range: -100 100
AP_GROUPINFO("TERM_POS_AIL", 21, AP_AdvancedFailsafe, _terminate_pos_ail, 100),

// @Param: TERM_POS_RUD
// @DisplayName: Terminate Rudder Position
// @Description: This is the position the rudder will go to during an aerotermination. 0 means neutral deflection, default is 100.
// @User: Advanced
// @Units: %
// @Range: -100 100
AP_GROUPINFO("TERM_POS_RUD", 22, AP_AdvancedFailsafe, _terminate_pos_rud, 100),

// @Param: TERM_POS_ELE
// @DisplayName: Terminate Elevator Position
// @Description: This is the position the elevator will go to during an aerotermination. 0 means neutral deflection, default is 100.
// @User: Advanced
// @Units: %
// @Range: -100 100
AP_GROUPINFO("TERM_POS_ELE", 23, AP_AdvancedFailsafe, _terminate_pos_ele, 100),

AP_GROUPEND
};

Expand Down
3 changes: 3 additions & 0 deletions libraries/AP_AdvancedFailsafe/AP_AdvancedFailsafe.h
Expand Up @@ -131,6 +131,9 @@ class AP_AdvancedFailsafe
AP_Int8 _rc_term_manual_only;
AP_Int8 _enable_dual_loss;
AP_Int16 _max_range_km;
AP_Int8 _terminate_pos_ail;
AP_Int8 _terminate_pos_rud;
AP_Int8 _terminate_pos_ele;

bool _heartbeat_pin_value;

Expand Down