mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 11:31:35 +08:00
Only use roll/pitch not centered for RC override, and increase override threshold
This commit is contained in:
@@ -1884,12 +1884,9 @@ Commander::run()
|
|||||||
if ((override_auto_mode || override_offboard_mode) && is_rotary_wing
|
if ((override_auto_mode || override_offboard_mode) && is_rotary_wing
|
||||||
&& !in_low_battery_failsafe && !_geofence_warning_action_on) {
|
&& !in_low_battery_failsafe && !_geofence_warning_action_on) {
|
||||||
// transition to previous state if sticks are touched
|
// transition to previous state if sticks are touched
|
||||||
if ((_last_manual_control_setpoint.timestamp != _manual_control_setpoint.timestamp) &&
|
if (hrt_elapsed_time(&_manual_control_setpoint.timestamp) < 1_s && // don't use uninitialized or old messages
|
||||||
((fabsf(_manual_control_setpoint.x - _last_manual_control_setpoint.x) > _min_stick_change) ||
|
((fabsf(_manual_control_setpoint.x) > _min_stick_change) ||
|
||||||
(fabsf(_manual_control_setpoint.y - _last_manual_control_setpoint.y) > _min_stick_change) ||
|
(fabsf(_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))) {
|
|
||||||
|
|
||||||
// revert to position control in any case
|
// revert to position control in any case
|
||||||
main_state_transition(status, commander_state_s::MAIN_STATE_POSCTL, status_flags, &_internal_state);
|
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");
|
mavlink_log_info(&mavlink_log_pub, "Pilot took over control using sticks");
|
||||||
|
|||||||
@@ -194,11 +194,11 @@ PARAM_DEFINE_FLOAT(COM_RC_LOSS_T, 0.5f);
|
|||||||
* @group Commander
|
* @group Commander
|
||||||
* @unit %
|
* @unit %
|
||||||
* @min 5
|
* @min 5
|
||||||
* @max 40
|
* @max 80
|
||||||
* @decimal 0
|
* @decimal 0
|
||||||
* @increment 0.05
|
* @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
|
* Home set horizontal threshold
|
||||||
|
|||||||
Reference in New Issue
Block a user