[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot]
2025-03-31 16:10:00 +00:00
committed by Michel Aractingi
parent 3a2308d86f
commit 88d26ae976
5 changed files with 35 additions and 26 deletions

View File

@@ -311,7 +311,7 @@ class GamepadController(InputController):
except pygame.error:
logging.error("Error reading gamepad. Is it still connected?")
return 0.0, 0.0, 0.0
def get_gripper_action(self):
"""
Get gripper action using L3/R3 buttons.
@@ -319,12 +319,12 @@ class GamepadController(InputController):
Press right stick (R3) to close the gripper.
"""
import pygame
try:
# Check if buttons are pressed
l3_pressed = self.joystick.get_button(9)
r3_pressed = self.joystick.get_button(10)
# Determine action based on button presses
if r3_pressed:
return 1.0 # Close gripper
@@ -332,9 +332,9 @@ class GamepadController(InputController):
return -1.0 # Open gripper
else:
return 0.0 # No change
except pygame.error:
logging.error(f"Error reading gamepad. Is it still connected?")
logging.error("Error reading gamepad. Is it still connected?")
return 0.0