Added Gripper quantization wrapper and grasp penalty

removed complementary info from buffer and learner server
removed get_gripper_action function
added gripper parameters to `common/envs/configs.py`
This commit is contained in:
Michel Aractingi
2025-04-01 11:08:15 +02:00
parent 88d26ae976
commit 0cce2fe0fa
5 changed files with 66 additions and 99 deletions

View File

@@ -312,31 +312,6 @@ class GamepadController(InputController):
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.
Press left stick (L3) to open the gripper.
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
elif l3_pressed:
return -1.0 # Open gripper
else:
return 0.0 # No change
except pygame.error:
logging.error("Error reading gamepad. Is it still connected?")
return 0.0
class GamepadControllerHID(InputController):
"""Generate motion deltas from gamepad input using HIDAPI."""