Skip to content

Allow importing joystick mappings from BlueOS extensions#1962

Open
rafaellehmkuhl wants to merge 12 commits intobluerobotics:masterfrom
rafaellehmkuhl:allow-importing-joystick-maps
Open

Allow importing joystick mappings from BlueOS extensions#1962
rafaellehmkuhl wants to merge 12 commits intobluerobotics:masterfrom
rafaellehmkuhl:allow-importing-joystick-maps

Conversation

@rafaellehmkuhl
Copy link
Member

@rafaellehmkuhl rafaellehmkuhl commented Jul 2, 2025

Opening in draft as there were some suggestions in the RadCam meeting that I'm going to change before opening it for review:

  • From joao: it would be nice to have joystick suggestions by source
  • From joao: show somewhere the suggestions that were already accepted
  • From wilson: add an "accept all suggestions" button (per source)

Fix #1859

@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch 2 times, most recently from 2294465 to e54312b Compare July 11, 2025 02:21
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch 2 times, most recently from 783a53d to 13b6142 Compare July 28, 2025 13:18
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch 2 times, most recently from 4572a3b to fc5755d Compare August 12, 2025 20:22
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch from fc5755d to cf41b60 Compare August 22, 2025 16:41
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch 2 times, most recently from 8fbdf5c to 1e83f8d Compare September 5, 2025 08:26
@rafaellehmkuhl
Copy link
Member Author

As noticed by @joaoantoniocardoso: we are missing a protocol field in the suggestions. Without it, we are registering based solely on IDs, which could (could?) cause conflicts between different protocols.

@joaoantoniocardoso
Copy link
Member

Hi @rafaellehmkuhl, when I was implementing the API on my extension, I noticed that this implementation is using camelCase convention for the fields, which differs from the external widgets (see ExternalWidgetSetupInfo), and it is using kebab-case for the enum variants, which also differs from the external widgets (see WidgetType or MiniWidgetType).

It would be good if we could agree to stick to a convention for the entire cockpit_extras API.

@joaoantoniocardoso
Copy link
Member

I added the joystick mapping using the current API to the Radcam Manager (current master), and it showed on Cockpit (only when it's running on BlueOS, and not locally, because of some CORS thing).

However, the mapped actions seem to be conflicting with already existing ones, somehow creating this oscillatory behavior when I click them (see it on the graphs):

mapped_buttons_are_fighting_each_other.mp4

@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch 2 times, most recently from 10fa754 to 817c625 Compare November 3, 2025 23:09
@rafaellehmkuhl
Copy link
Member Author

Hi @rafaellehmkuhl, when I was implementing the API on my extension, I noticed that this implementation is using camelCase convention for the fields, which differs from the external widgets (see ExternalWidgetSetupInfo), and it is using kebab-case for the enum variants, which also differs from the external widgets (see WidgetType or MiniWidgetType).

It would be good if we could agree to stick to a convention for the entire cockpit_extras API.

Fixed the usage of camelCase in the API. It is all in snake_case now.

The enums will have to stay as they are for historical purposes, otherwise we would break already-stablished APIs.

@joaoantoniocardoso
Copy link
Member

Hi @rafaellehmkuhl, when I was implementing the API on my extension, I noticed that this implementation is using camelCase convention for the fields, which differs from the external widgets (see ExternalWidgetSetupInfo), and it is using kebab-case for the enum variants, which also differs from the external widgets (see WidgetType or MiniWidgetType).
It would be good if we could agree to stick to a convention for the entire cockpit_extras API.

Fixed the usage of camelCase in the API. It is all in snake_case now.

The enums will have to stay as they are for historical purposes, otherwise we would break already-stablished APIs.

Okay, but you could also make a parser that normalizes the old format to a new format, keeping backward compatibility while updating to this new uniform style.

@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch from 817c625 to 5c90d3c Compare November 5, 2025 14:04
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch from 5c90d3c to be5d574 Compare November 14, 2025 21:01
@rafaellehmkuhl rafaellehmkuhl marked this pull request as ready for review November 14, 2025 21:01
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch from be5d574 to c4a0434 Compare November 14, 2025 21:04
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch 3 times, most recently from ddad784 to cae6adb Compare November 15, 2025 04:06
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch 2 times, most recently from 8c89c4c to 66db6ff Compare February 3, 2026 21:00
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch 2 times, most recently from 1ce42fc to a457626 Compare February 13, 2026 19:41
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch 2 times, most recently from 2683aa5 to 5bf4702 Compare February 18, 2026 21:11
@rafaellehmkuhl
Copy link
Member Author

@joaoantoniocardoso I've finished the implementations from our last talk. Ready for review now.

@ArturoManzoli could you review it from the UI side?

- Allow importing joystick mapping suggestions
- Segregate types to dedicated file
- Add schema validation
- Standardize payload keys to camelCase
@rafaellehmkuhl rafaellehmkuhl force-pushed the allow-importing-joystick-maps branch from 5bf4702 to 901c911 Compare February 18, 2026 21:15
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.

Allow BlueOS extensions to offer mapping for specific joystick buttons

2 participants

Comments