mirror of
https://github.com/huggingface/lerobot.git
synced 2026-05-31 19:01:28 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
committed by
Michel Aractingi
parent
3a2308d86f
commit
88d26ae976
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user