ManualControl: remove unused variables and renaming

This commit is contained in:
Matthias Grob
2021-10-22 11:02:25 +02:00
parent e73e6a490d
commit af54ac7cdb
4 changed files with 7 additions and 13 deletions
+4 -4
View File
@@ -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);