Only use roll/pitch not centered for RC override, and increase override threshold

This commit is contained in:
Julian Kent
2020-08-03 15:15:09 +02:00
committed by Daniel Agar
parent cbbde2e4a2
commit 7958586f35
2 changed files with 5 additions and 8 deletions
+3 -6
View File
@@ -1884,12 +1884,9 @@ Commander::run()
if ((override_auto_mode || override_offboard_mode) && is_rotary_wing
&& !in_low_battery_failsafe && !_geofence_warning_action_on) {
// transition to previous state if sticks are touched
if ((_last_manual_control_setpoint.timestamp != _manual_control_setpoint.timestamp) &&
((fabsf(_manual_control_setpoint.x - _last_manual_control_setpoint.x) > _min_stick_change) ||
(fabsf(_manual_control_setpoint.y - _last_manual_control_setpoint.y) > _min_stick_change) ||
(fabsf(_manual_control_setpoint.z - _last_manual_control_setpoint.z) > _min_stick_change) ||
(fabsf(_manual_control_setpoint.r - _last_manual_control_setpoint.r) > _min_stick_change))) {
if (hrt_elapsed_time(&_manual_control_setpoint.timestamp) < 1_s && // don't use uninitialized or old messages
((fabsf(_manual_control_setpoint.x) > _min_stick_change) ||
(fabsf(_manual_control_setpoint.y) > _min_stick_change))) {
// revert to position control in any case
main_state_transition(status, commander_state_s::MAIN_STATE_POSCTL, status_flags, &_internal_state);
mavlink_log_info(&mavlink_log_pub, "Pilot took over control using sticks");
+2 -2
View File
@@ -194,11 +194,11 @@ PARAM_DEFINE_FLOAT(COM_RC_LOSS_T, 0.5f);
* @group Commander
* @unit %
* @min 5
* @max 40
* @max 80
* @decimal 0
* @increment 0.05
*/
PARAM_DEFINE_FLOAT(COM_RC_STICK_OV, 12.0f);
PARAM_DEFINE_FLOAT(COM_RC_STICK_OV, 50.0f);
/**
* Home set horizontal threshold