Skip to content

Add PS5 DualSense controller support on Windows - #26

Merged
yassinsolim merged 9 commits into
mainfrom
feature/ps5-controller-support
Oct 17, 2026
Merged

yassinsolim merged 9 commits into
mainfrom
feature/ps5-controller-support

Conversation

@ovilikaris-dotcom

Copy link
Copy Markdown
Collaborator

Summary

Adds PS5 DualSense controller support on Windows through an SDL/Pygame bridge.

The bridge translates the DualSense controls into the existing teleop layout:

  • Options → Start/Menu
  • Circle → B
  • Triangle → Y
  • Cross → A
  • L2/R2 → LT/RT
  • Sticks and D-pad retain the same actions

The bridge requires neutral controls when connecting or reconnecting and sends a disconnected state when controller input is lost.

Validation

  • Full Docker test run before the compatibility correction: 324 tests, 0 errors, 0 failures, 0 skipped.
  • Final controller and lint tests after the correction: 9 passed.
  • Windows Python 3.13.7 with Pygame 2.6.1.
  • PS5 DualSense detected over Bluetooth as DualSense Wireless Controller.
  • All buttons, sticks, triggers, D-pad and joint groups: PASS.
  • Options enable/disable: PASS.
  • Cross return-to-zero: PASS.
  • Controller disconnect safely disabled teleoperation: PASS.
  • Bluetooth reconnect remained disabled until Options was pressed again: PASS.

Dependency

Depends on #24. Retarget this PR to main after #24 merges.

@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: f9e513f9-18d7-4323-9d0c-4e0d7b57a766
📥 Commits

Reviewing files that changed from the base of the PR and between 24ac04c and 2a413e9.

📒 Files selected for processing: 5
  • BuildInstructions.md
  • README.md
  • waybionic_teleop/setup.py
  • waybionic_teleop/test/test_sdl_bridge.py
  • waybionic_teleop/waybionic_teleop/sdl_bridge.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

yassinsolim
yassinsolim previously approved these changes Oct 3, 2026

@yassinsolim yassinsolim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Karis, this is a clean addition. The bridge sends the same packets as the XInput bridge, and requiring released controls on every connect and reconnect is a good safety touch.

What I checked:

  • The waybionic_teleop tests pass in the ROS image (67, including flake8 and pep257).
  • With the real Pygame 2.6.1, every CONTROLLER_AXIS_* and CONTROLLER_BUTTON_* constant and every controller call the bridge uses exists, and the bridge starts without a controller and stops cleanly on Ctrl+C.
  • It merges cleanly with #22 and with #27 (Cartesian teleop). On a DualSense, L1 is the axis lock and the D-pad tilts in the Cartesian group, so nothing else is needed.

Please add the Python version note (inline) before this merges, since the install step fails on Python 3.14.

Small follow-ups, not blocking:

  • joy_udp_receiver still says "run xinput_bridge on the host" when no packets arrive. It could name both bridges.
  • package.xml still describes the package as Xbox-only, while setup.py was updated.
  • The bridge prints nothing while it can't find a controller (inline).

Comment thread BuildInstructions.md Resolved
@yassinsolim
yassinsolim changed the base branch from feature/xbox-teleop to main October 11, 2026 02:27
@yassinsolim
yassinsolim dismissed their stale review October 11, 2026 02:27

The base branch was changed.

@yassinsolim

Copy link
Copy Markdown
Member

Karis, I merged main into this branch so it can go to main now that the stack has landed. Nothing was rewritten, so pull before you push again.

  • Main now sends rumble back to whichever Windows bridge sent the last controller packet, so the DualSense bridge reads those packets and rumbles the controller, using the same check as the Xbox bridge. Two new tests cover it.
  • BuildInstructions now says scripts\windows-demo.cmd opens the Xbox bridge, so close that window before starting the DualSense bridge.

The base is now main, and the full suite passes (1035 tests). There's no DualSense here, so please check each row of the controls table and rumble at a limit over USB and Bluetooth.

Opt into SDL extended Bluetooth reports before controller initialization and report rejected rumble requests. Document the DirectInput tradeoff and cover the flag and failure path in tests.

Refs #26
@ovilikaris-dotcom

Copy link
Copy Markdown
Collaborator Author

Tested the DualSense with the ground station over USB and Bluetooth. Controls worked, and the controller rumbled at a limit on both connections; Bluetooth used --bluetooth-rumble. The full local Compose run passed 1,036 tests, and PR CI is green. L1 axis lock was not visually confirmed. I also saw one “Host paused” safety stop while the controller stayed connected; I’ll investigate if it recurs.

@yassinsolim yassinsolim left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, Karis, and thanks for testing over both USB and Bluetooth. --bluetooth-rumble works well as an opt-in:

  • the hint is set before pygame starts SDL;
  • rumble() reports whether SDL accepted the request;
  • the bridge says once how to turn on Bluetooth rumble when SDL refuses it.

The tests cover both modes, and CI is green.

About the "Host paused" stop: it comes from the simulated drive node, not the controller. The node stops the arm when its own control loop stalls for longer than the drive heartbeat. That can happen when Docker or RViz briefly starves the container of CPU, so it can happen with any controller. If you see it again, note what else was running on the computer at the time.

…r-support

# Conflicts:
#	BuildInstructions.md
#	waybionic_bringup/CMakeLists.txt
#	waybionic_bringup/launch/ground_station.launch.py
#	waybionic_teleop/setup.py
@yassinsolim
yassinsolim merged commit 6575a85 into main Oct 17, 2026
6 of 7 checks passed
@yassinsolim

Copy link
Copy Markdown
Member

Karis, #22 and this PR both changed ground_station.launch.py, waybionic_bringup/CMakeLists.txt, BuildInstructions.md and setup.py, so I merged main into this branch: #22's launch checks and diagnostics argument are kept, with your controller wording. The full suite passed with it, so it's merged now.

@yassinsolim
yassinsolim deleted the feature/ps5-controller-support branch November 14, 2026 12:07
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.

2 participants