Repository navigation
Add PS5 DualSense controller support on Windows - #26
ovilikaris-dotcom wants to merge 16 commits into
Conversation
Replace the placeholder with the five-joint arm exported from full-arm-smaller.SLDASM. The tools in scripts/cad regenerate the URDF and meshes after CAD changes. demo_mode:=true sweeps each joint in turn and reports a pass/fail row per joint on /diagnostics. Supersedes #7.
Drive the five joints with an Xbox controller through placeholder MKS SERVO42D/57D CAN drives, simulated until the real drives are connected. On Windows, a Python-only XInput bridge sends the controller state to the new wslg-teleop Compose service over UDP. The RViz camera now follows the tool so the end of the arm stays in view.
# Conflicts: # waybionic_bringup/launch/ground_station.launch.py
# Conflicts: # waybionic_bringup/CMakeLists.txt
demo_mode:=True or 1 started joint_state_publisher_gui next to the demo, because the launch compared the raw text with 'true'. And/Not substitutions parse booleans the same way IfCondition does. The joint demo test now uses True and fails without this change. joint_demo rejects a speed_deg_s of zero or less at startup instead of never finishing a move, and receives use_sim_time like the other nodes. The CAD script's help now says which export --check-moves compares.
# Conflicts: # waybionic_bringup/launch/ground_station.launch.py
follow_camera:=false stopped the camera follower, so RViz lost the view_focus frame it orbits. The follower now always runs and holds its default focus when follow is false, and a launch test checks the frame. teleop and joy_source use And/Or/Equals substitutions, so teleop:=True works like IfCondition; the teleop test now uses True. The new nodes receive use_sim_time, and the UDP receiver reads at most 100 packets per poll so a flood cannot starve its other callbacks.
|
Warning Review limit reachedYou'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 59 minutes. View limit details
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. Comment |
yassinsolim
left a comment
There was a problem hiding this comment.
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_teleoptests pass in the ROS image (67, including flake8 and pep257). - With the real Pygame 2.6.1, every
CONTROLLER_AXIS_*andCONTROLLER_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_receiverstill says "run xinput_bridge on the host" when no packets arrive. It could name both bridges.package.xmlstill describes the package as Xbox-only, whilesetup.pywas updated.- The bridge prints nothing while it can't find a controller (inline).
| PowerShell window, install Pygame once and start the SDL bridge: | ||
|
|
||
| ```powershell | ||
| python -m pip install pygame==2.6.1 |
There was a problem hiding this comment.
Pygame 2.6.1 is still the latest release, and its Windows wheels stop at Python 3.13. On Python 3.14, pip tries to build it from source, which fails without the SDL development files. Please say "Python 3.13 or older" here. pygame-ce has newer wheels, but its _sdl2.controller module differs, so it isn't a drop-in replacement.
| message = f'Controller connected: {name}' | ||
| break | ||
| if self.controller is None: | ||
| return *NEUTRAL, False, message |
There was a problem hiding this comment.
When no controller is found, message is still None, so after the first line the console says nothing. The XInput bridge prints "No controller detected; connect an Xbox controller". A similar line here would tell people the bridge is running but can't see the controller, for example when it's paired over Bluetooth but not connected.
|
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.
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. |
Summary
Adds PS5 DualSense controller support on Windows through an SDL/Pygame bridge.
The bridge translates the DualSense controls into the existing teleop layout:
The bridge requires neutral controls when connecting or reconnecting and sends a disconnected state when controller input is lost.
Validation
DualSense Wireless Controller.Dependency
Depends on #24. Retarget this PR to
mainafter #24 merges.