Skip to content

Unify gamepad input across local-window and WebRTC - #483

Open
wlewNV wants to merge 3 commits into
mainfrom
dev/wlew/unified-gamepad-input
Open

Unify gamepad input across local-window and WebRTC#483
wlewNV wants to merge 3 commits into
mainfrom
dev/wlew/unified-gamepad-input

Conversation

@wlewNV

@wlewNV wlewNV commented Aug 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add a validated gamepad_state input and canonical GamepadToDriverCommand converter.
  • Route native SDL and browser gamepads through the same canonical input path.
  • Preserve analog steering, throttle, and brake in OmniDreams.
  • Remove the local-window gamepad override while retaining keyboard fallback.

Validation

  • 155 affected CPU tests passed.
  • Browser JavaScript syntax validation passed.
  • Full CPU suite was blocked by host process/thread exhaustion.

Route native and browser gamepad state through the canonical driver command path so OmniDreams preserves analog control without transport-specific overrides.
@copy-pr-bot

copy-pr-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@wlewNV
wlewNV marked this pull request as ready for review August 18, 2026 18:59
@greptile-apps

greptile-apps Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR introduces a canonical, validated gamepad state and routes local SDL and browser WebRTC controls through a shared driving converter.

  • Preserves piecewise analog steering, throttle, and brake timelines alongside keyboard fallback.
  • Advertises and validates browser gamepad support through the WebRTC control path.
  • Updates OmniDreams to consume canonical driver segments and integrate analog camera motion.

Confidence Score: 5/5

The PR appears safe to merge because the two previously reported control-path failures are resolved and no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
flashdreams/flashdreams/runtime/gamepad.py Adds validated gamepad state handling and a stateful keyboard/gamepad converter that preserves complete segment timelines, including active input before a neutral final state.
flashdreams/flashdreams/demo/local_input.py Routes SDL gamepad snapshots and disconnects through the canonical event pipeline while retaining keyboard fallback.
flashdreams/flashdreams/serving/webrtc/services.py Validates browser gamepad messages, records normalized events, and integrates their activation behavior with realtime input.
flashdreams/flashdreams/serving/webrtc/manager.py Advertises gamepad capability from the prepared converter stack and rejects gamepad messages for unsupported applications.
flashdreams/flashdreams/serving/webrtc/web/request_session.js Polls browser gamepads, normalizes analog controls, and sends changed or forced neutral states when gamepad support is enabled.
integrations/omnidreams/omnidreams/demo/providers.py Canonicalizes realtime controls into complete analog driver segments and forwards truthful metadata to OmniDreams.
integrations/omnidreams/omnidreams/demo/controls.py Integrates canonical analog controls while ensuring brake-only input does not produce backward camera displacement.

Sequence Diagram

sequenceDiagram
    participant Device as SDL / Browser gamepad
    participant Source as Local or WebRTC input source
    participant Converter as DrivingInputConverter
    participant Provider as OmniDreams provider
    participant Integrator as CameraPoseIntegrator
    Device->>Source: gamepad_state snapshot
    Source->>Converter: timestamped validated event
    Converter->>Converter: merge gamepad and keyboard timelines
    Converter-->>Provider: canonical driver command + segments
    Provider->>Integrator: analog control segments
    Integrator-->>Provider: camera poses
Loading

Reviews (2): Last reviewed commit: "Fix gamepad arbitration and capability g..." | Re-trigger Greptile

Comment thread flashdreams/flashdreams/runtime/gamepad.py Outdated
Comment thread integrations/omnidreams/omnidreams/demo/controls.py Outdated
Preserve mixed keyboard/gamepad timelines, prevent unsupported WebRTC activation, and keep brake and deadzone semantics consistent across transports.
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