Skip to content

keyboard support#3738

Open
GrayHoang wants to merge 2 commits into
UBC-Thunderbots:masterfrom
GrayHoang:wasdqe-control
Open

keyboard support#3738
GrayHoang wants to merge 2 commits into
UBC-Thunderbots:masterfrom
GrayHoang:wasdqe-control

Conversation

@GrayHoang
Copy link
Copy Markdown
Contributor

@GrayHoang GrayHoang commented May 23, 2026

Description

Vibe coding the whole thing, time to find out if it works

" Adds keyboard control as an alternative robot input method. Introduces a ControllerBase ABC that both HandheldController and the new KeyboardController implement, enabling the widget to treat them polymorphically.
▎ KeyboardController uses a Qt application-level event filter to track held keys, mapping WASD/QE to movement/rotation axes and X/C to kick/chip. A "Use Keyboard" button is added to the diagnostics widget alongside the existing
▎ "Detect Controller" button."

~ Vibe wrote the description.

Testing Done

Resolved Issues

Length Justification and Key Files to Review

Review Checklist

It is the reviewers responsibility to also make sure every item here has been covered

  • Function & Class comments: All function definitions (usually in the .h file) should have a javadoc style comment at the start of them. For examples, see the functions defined in thunderbots/software/geom. Similarly, all classes should have an associated Javadoc comment explaining the purpose of the class.
  • Remove all commented out code
  • Remove extra print statements: for example, those just used for testing
  • Resolve all TODO's: All TODO (or similar) statements should either be completed or associated with a github issue

name = "handheld_controller_widget",
srcs = ["handheld_controller_widget.py"],
deps = [
"keyboard_controller",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

semi colon

neg_key, pos_key = key_pair
if neg_key is not None and neg_key in self._held_keys:
return -1.0
if pos_key is not None and pos_key in self._held_keys:
Copy link
Copy Markdown
Contributor

@StarrryNight StarrryNight May 24, 2026

Choose a reason for hiding this comment

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

Add time-based speed ramping for movement. Or else robot will either move in full speed or zero speed.

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