Skip to content

feat(joystick): better support for circular joysticks#164

Merged
finger563 merged 1 commit intomainfrom
feature/joystick-refactor
Mar 1, 2024
Merged

feat(joystick): better support for circular joysticks#164
finger563 merged 1 commit intomainfrom
feature/joystick-refactor

Conversation

@finger563
Copy link
Copy Markdown
Contributor

Description

  • Refactored joystick so that the difference between RECTANGULAR and CIRCULAR joysticks is clearer and more completely applied
  • Fixed not clamping output to be within the unit circle if the joystick is CIRCULAR
  • Updated RangeMapper component to support individually setting the deadband value (around the input center)
  • Update joystick to set x/y range mapper deadbands to 0 if configured as a CIRCULAR joystick so that only the center_deadzone_radius is applied
  • rebuild docs

Motivation and Context

The circularization of the deadzone for the joystick was an incomplete implementation. This fixes that by ensuring the output is circular (clamped to be within the unit circle) and ensures that the center deadzone is consistent and easy to set (just a single deadzone radius value that fully overrides the individual range mapper deadzone values). Breaking updates to the API to bettery convey meaning and intent.

How has this been tested?

Building the joystick example.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Refactored joystick so that the difference between RECTANGULAR and CIRCULAR joysticks is clearer and more completely applied
* Fixed not clamping output to be within the unit circle if the joystick is CIRCULAR
* Updated RangeMapper component to support individually setting the deadband value (around the input center)
* Update joystick to set x/y range mapper deadbands to 0 if configured as a CIRCULAR joystick so that only the center_deadzone_radius is applied
* rebuild docs
@finger563 finger563 self-assigned this Mar 1, 2024
@finger563 finger563 added enhancement New feature or request math joystick labels Mar 1, 2024
@finger563 finger563 merged commit 505c5d9 into main Mar 1, 2024
@finger563 finger563 deleted the feature/joystick-refactor branch March 1, 2024 23:00
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 1, 2024

✅Static analysis result - no issues found! ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request joystick math

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant