From b62c386e4a576bb5341a53546cc900c938a86563 Mon Sep 17 00:00:00 2001 From: Rafael Araujo Lehmkuhl Date: Tue, 26 Dec 2023 22:00:10 -0300 Subject: [PATCH] joystick-pipeline: Create default Boat profile --- src/assets/joystick-profiles.ts | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/assets/joystick-profiles.ts b/src/assets/joystick-profiles.ts index 45070e5ee..5f1dbcf5c 100644 --- a/src/assets/joystick-profiles.ts +++ b/src/assets/joystick-profiles.ts @@ -66,6 +66,57 @@ export const cockpitStandardToProtocols: JoystickProtocolActionsMapping[] = [ }, }, }, + { + name: 'Boat functions mapping', + axesCorrespondencies: { + [JoystickAxis.A0]: { action: mavlinkManualControlAxes.axis_y, min: -1000, max: +1000 }, + [JoystickAxis.A1]: { action: mavlinkManualControlAxes.axis_x, min: +1000, max: -1000 }, + [JoystickAxis.A2]: { action: mavlinkManualControlAxes.axis_r, min: -1000, max: +1000 }, + [JoystickAxis.A3]: { action: mavlinkManualControlAxes.axis_z, min: +1000, max: -1000 }, + }, + buttonsCorrespondencies: { + [CockpitModifierKeyOption.regular]: { + [JoystickButton.B0]: { action: modifierKeyActions.shift }, + [JoystickButton.B1]: { action: otherAvailableActions.no_function }, + [JoystickButton.B2]: { action: otherAvailableActions.no_function }, + [JoystickButton.B3]: { action: otherAvailableActions.no_function }, + [JoystickButton.B4]: { action: availableCockpitActions.go_to_previous_view }, + [JoystickButton.B5]: { action: availableCockpitActions.go_to_next_view }, + [JoystickButton.B6]: { action: otherAvailableActions.no_function }, + [JoystickButton.B7]: { action: otherAvailableActions.no_function }, + [JoystickButton.B8]: { action: availableCockpitActions.mavlink_disarm }, + [JoystickButton.B9]: { action: availableCockpitActions.mavlink_arm }, + [JoystickButton.B10]: { action: otherAvailableActions.no_function }, + [JoystickButton.B11]: { action: otherAvailableActions.no_function }, + [JoystickButton.B12]: { action: otherAvailableActions.no_function }, + [JoystickButton.B13]: { action: otherAvailableActions.no_function }, + [JoystickButton.B14]: { action: otherAvailableActions.no_function }, + [JoystickButton.B15]: { action: otherAvailableActions.no_function }, + [JoystickButton.B16]: { action: availableCockpitActions.toggle_bottom_bar }, + [JoystickButton.B17]: { action: otherAvailableActions.no_function }, + }, + [CockpitModifierKeyOption.shift]: { + [JoystickButton.B0]: { action: otherAvailableActions.no_function }, + [JoystickButton.B1]: { action: otherAvailableActions.no_function }, + [JoystickButton.B2]: { action: otherAvailableActions.no_function }, + [JoystickButton.B3]: { action: otherAvailableActions.no_function }, + [JoystickButton.B4]: { action: otherAvailableActions.no_function }, + [JoystickButton.B5]: { action: otherAvailableActions.no_function }, + [JoystickButton.B6]: { action: otherAvailableActions.no_function }, + [JoystickButton.B7]: { action: otherAvailableActions.no_function }, + [JoystickButton.B8]: { action: otherAvailableActions.no_function }, + [JoystickButton.B9]: { action: otherAvailableActions.no_function }, + [JoystickButton.B10]: { action: otherAvailableActions.no_function }, + [JoystickButton.B11]: { action: otherAvailableActions.no_function }, + [JoystickButton.B12]: { action: otherAvailableActions.no_function }, + [JoystickButton.B13]: { action: otherAvailableActions.no_function }, + [JoystickButton.B14]: { action: otherAvailableActions.no_function }, + [JoystickButton.B15]: { action: otherAvailableActions.no_function }, + [JoystickButton.B16]: { action: otherAvailableActions.no_function }, + [JoystickButton.B17]: { action: otherAvailableActions.no_function }, + }, + }, + }, ] /**