mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 07:00:34 +08:00
ManualControl: remove unused variables and renaming
This commit is contained in:
@@ -269,20 +269,20 @@ void ManualControl::processStickArming(const manual_control_input_s &input)
|
||||
{
|
||||
// Arm gesture
|
||||
const bool right_stick_centered = (fabsf(input.x) < 0.1f) && (fabsf(input.y) < 0.1f);
|
||||
const bool stick_lower_right = (input.z < 0.1f) && (input.r > 0.9f);
|
||||
const bool left_stick_lower_right = (input.z < 0.1f) && (input.r > 0.9f);
|
||||
|
||||
const bool previous_stick_arm_hysteresis = _stick_arm_hysteresis.get_state();
|
||||
_stick_arm_hysteresis.set_state_and_update(stick_lower_right && right_stick_centered, input.timestamp);
|
||||
_stick_arm_hysteresis.set_state_and_update(left_stick_lower_right && right_stick_centered, input.timestamp);
|
||||
|
||||
if (!previous_stick_arm_hysteresis && _stick_arm_hysteresis.get_state()) {
|
||||
sendActionRequest(action_request_s::ACTION_ARM, action_request_s::SOURCE_RC_STICK_GESTURE);
|
||||
}
|
||||
|
||||
// Disarm gesture
|
||||
const bool stick_lower_left = (input.z < 0.1f) && (input.r < -0.9f);
|
||||
const bool left_stick_lower_left = (input.z < 0.1f) && (input.r < -0.9f);
|
||||
|
||||
const bool previous_stick_disarm_hysteresis = _stick_disarm_hysteresis.get_state();
|
||||
_stick_disarm_hysteresis.set_state_and_update(stick_lower_left && right_stick_centered, input.timestamp);
|
||||
_stick_disarm_hysteresis.set_state_and_update(left_stick_lower_left && right_stick_centered, input.timestamp);
|
||||
|
||||
if (!previous_stick_disarm_hysteresis && _stick_disarm_hysteresis.get_state()) {
|
||||
sendActionRequest(action_request_s::ACTION_DISARM, action_request_s::SOURCE_RC_STICK_GESTURE);
|
||||
|
||||
Reference in New Issue
Block a user