Skip to content

Commit

Permalink
fix problem
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaellehmkuhl committed Dec 5, 2023
1 parent e4debcb commit a00989e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/libs/joystick/protocols/mavlink-manual-control.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,10 @@ export class MavlinkManualControlManager {
const shiftActionValue = this.vehicleButtonParameterTable.find((e) => e.title === MAVLinkButtonFunction.shift)
if (regularShiftFunction === undefined) {
// Map shift to R0
console.log('currentRegularButtonParameters', currentRegularButtonParameters)
currentRegularButtonParameters.forEach((v) => console.log(`${v.button} ::: ${v.actionId}`))
const r0Function = currentRegularButtonParameters.find((v) => v.button === MAVLinkManualControlButton.R0)
console.log('r0Function', r0Function)
this.vehicle.setParameter({ id: r0Function!.button, value: shiftActionValue!.value })
this.vehicle.setParameter({ id: MAVLinkManualControlButton.R0, value: shiftActionValue!.value })

// Map shift to S0
const s0Function = currentShiftButtonParameters.find((v) => v.button === MAVLinkManualControlButton.S0)
this.vehicle.setParameter({ id: s0Function!.button, value: shiftActionValue!.value })
this.vehicle.setParameter({ id: MAVLinkManualControlButton.S0, value: shiftActionValue!.value })
} else {
const sFunction = regularShiftFunction.button.replace('FUNCTION', 'SFUNCTION')
this.vehicle.setParameter({ id: sFunction, value: shiftActionValue!.value })
Expand Down

0 comments on commit a00989e

Please sign in to comment.