Skip to content

Keyboard support for robot diagnostics mode in Thunderscope - #3738

Merged
GrayHoang merged 17 commits into
UBC-Thunderbots:masterfrom
GrayHoang:wasdqe-control
Aug 30, 2026
Merged

Keyboard support for robot diagnostics mode in Thunderscope#3738
GrayHoang merged 17 commits into
UBC-Thunderbots:masterfrom
GrayHoang:wasdqe-control

Conversation

@GrayHoang

@GrayHoang GrayHoang commented May 23, 2026

Copy link
Copy Markdown
Contributor

Description

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

Ran thunderscope diagnostics (on MacOS at least) and it works, can control robot with keyboard. TODO still requires testing for if controller support still works.

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

Comment thread src/software/thunderscope/robot_diagnostics/BUILD Outdated
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:

@StarrryNight StarrryNight May 24, 2026

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.

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

@GrayHoang

Copy link
Copy Markdown
Contributor Author

This is blocked by motor firmware #3734

@williamckha
williamckha marked this pull request as draft June 5, 2026 05:19
@nycrat

nycrat commented Jun 22, 2026

Copy link
Copy Markdown
Member

@GrayHoang ready to be reviewed now?

@GrayHoang

Copy link
Copy Markdown
Contributor Author

This was a whole month ago? Only review if we need it, it's kinda a mess

@nycrat

nycrat commented Jun 22, 2026

Copy link
Copy Markdown
Member

This was a whole month ago? Only review if we need it, it's kinda a mess

I think its pretty useful for testing robot movement, especially being able to test exactly forward/back/sideways. Maybe clean up the code if we want it or just close the pr 🤷

@GrayHoang
GrayHoang marked this pull request as ready for review June 30, 2026 03:05
@nycrat
nycrat self-requested a review as a code owner August 15, 2026 18:27
@nycrat nycrat changed the title keyboard support Keyboard support for robot diagnostics mode in Thunderscope Aug 19, 2026

@nycrat nycrat 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.

@GrayHoang it would be good to get this PR ready to merge. It is really important to have this for easier testing without needing to bring a controller, and for diagnostics mode MacOS support. There are only a few minor issues left.

Comment thread src/software/thunderscope/robot_diagnostics/controller_base.py Outdated
Comment thread src/software/thunderscope/robot_diagnostics/keyboard_controller.py
@GrayHoang
GrayHoang merged commit 9f7db9b into UBC-Thunderbots:master Aug 30, 2026
8 checks passed
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.

4 participants