Skip to content

feat: add gamepad control#6

Open
zzzyishi wants to merge 5 commits into
verl-project:mainfrom
zzzyishi:feat/gamepad
Open

feat: add gamepad control#6
zzzyishi wants to merge 5 commits into
verl-project:mainfrom
zzzyishi:feat/gamepad

Conversation

@zzzyishi

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR adds complete gamepad teleoperation support to the VLA project. The implementation covers frontend browser‑based gamepad input collection, WebSocket communication, a backend device abstraction layer, a strategy mapping layer, and seamless integration with the existing training/inference pipeline.

Key Features

  • Full gamepad support: Supports standard gamepads, automatic detection of connection/disconnection, and low‑latency input acquisition.
  • 6‑DoF control:
    • Position: Left joystick controls X/Y axes; right joystick Y‑axis controls Z.
    • Rotation: Right joystick X‑axis controls Yaw; D‑Pad controls Roll and Pitch.
    • Gripper: X button toggles gripper open/close.
  • Intervention mode: RT button activates intervention (hold‑to‑engage). When pressed, gamepad commands override model outputs.

Button Mapping

Button / Axis Function
Left Stick Up / Down +x / -x
Left Stick Left / Right +y / -y
Right Stick Up / Down +z / -z
Right Stick Left / Right +Yaw / -Yaw
D‑Pad Up / Down +Pitch / -Pitch
D‑Pad Left / Right +Roll / -Roll
X Button Gripper toggle
RT Button Intervention (hold)

Configuration

In rob_sac_env.yaml:

gamepad:
  pos_sensitivity: 0.5
  rot_sensitivity: 1.0
  intervention_button: RT
  gripper_button: X
  button_threshold: 0.5
  left_stick_x_axis: axis_0
  left_stick_y_axis: axis_1
  right_stick_y_axis: axis_3
  right_stick_x_axis: axis_2
  dpad_up_button: DUp
  dpad_down_button: DDown
  dpad_left_button: DLeft
  dpad_right_button: DRight

In teleop/config.py:

class GamepadTeleopConfig:
    pos_sensitivity: float = 0.5
    rot_sensitivity: float = 1.0
    intervention_button: str = "RT"
    gripper_button: str = "X"
    button_threshold: float = 0.5
    max_events: int = 256
    left_stick_x_axis: str = "axis_0"
    left_stick_y_axis: str = "axis_1"
    right_stick_y_axis: str = "axis_3"
    right_stick_x_axis: str = "axis_2"
    dpad_up_button: str = "DUp"
    dpad_down_button: str = "DDown"
    dpad_left_button: str = "DLeft"
    dpad_right_button: str = "DRight"

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces gamepad teleoperation support, adding a new GamepadDevice, a frontend JS handler, and a LiberoGamepadStrategy to map gamepad inputs to robot actions. The review feedback highlights several critical issues, including a reversed direction bug on the Left Stick Y-axis, state collisions and WebSocket flooding when multiple gamepads are connected, potential AttributeError crashes due to missing payload keys, misleading key binding descriptions, and an anti-pattern of swallowing exceptions during event draining.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/verl_vla/teleop/strategies/gamepad_libero.py Outdated
Comment thread src/verl_vla/teleop/obs_server/html/gamepad_device.js
Comment thread src/verl_vla/teleop/devices/gamepad.py Outdated
Comment thread src/verl_vla/teleop/devices/gamepad.py Outdated
Comment thread src/verl_vla/teleop/strategies/gamepad_libero.py Outdated
zzzyishi and others added 4 commits June 22, 2026 18:43
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant