Skip to content

Feature/simulator haptic feedback#7322

Open
Kudzzo wants to merge 5 commits into
EdgeTX:mainfrom
Kudzzo:feature/simulator-haptic-feedback
Open

Feature/simulator haptic feedback#7322
Kudzzo wants to merge 5 commits into
EdgeTX:mainfrom
Kudzzo:feature/simulator-haptic-feedback

Conversation

@Kudzzo
Copy link
Copy Markdown

@Kudzzo Kudzzo commented Apr 25, 2026

Summary

Implements haptic feedback for the EdgeTX Companion Simulator as required by Developer Contest 7.

Changes

  • Added simuGetHaptic() WASM export in simulib.cpp to expose haptic state to the host
  • Overrode hapticQueue::event() in SIMU mode to set haptic state variable
  • Added haptic polling in WasmSimulatorInterface every 50ms
  • Emit hapticChanged() signal when haptic fires
  • Handle hapticChanged() in SimulatorMainWindow with:
    • Visual feedback: window jitter (for when sound is unavailable)
    • Audible feedback: system beep (substitute for physical vibration)
  • Enabled HAPTIC for Pocket radio in simulator build

Tested on

  • Linux
  • Pocket radio simulator

Related

Developer Contest 7: https://edgetx.org/dc7_simuhaptic/

Copy link
Copy Markdown
Member

@pfeerick pfeerick left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visual: window jitter to indicate vibration

This is quite effective. I don't know if it was a switch state issue or implementation issue, but I had haptic on a SF, which was OFF by default, and got a shake when starting the simulator. Might be worth double checking.

Audible: system beep as substitute for haptic motor sounds

Worked fine for me on Windows 11 with TX15 simulator. I think @elecpower may have had issues with not being able to hear it, but that could have been a dev environment issue

After some cleanup (i.e. re-introduction of .so in several places), rebasing and final checks, looks quite promising!

Comment thread companion/src/simulation/simulatorinterface.cpp Outdated
@pfeerick pfeerick added the needs: rebase A git rebase on top of the latest destination branch version is required label May 8, 2026
Kudzzo added 3 commits May 8, 2026 17:09
- Add simuGetHaptic() WASM export to simulib.cpp to expose haptic state
- Override hapticQueue::event() in SIMU mode to set haptic state variable
- Poll haptic state in WasmSimulatorInterface every 50ms
- Emit hapticChanged() signal when haptic fires
- Handle hapticChanged() in SimulatorMainWindow with visual (window jitter)
  and audible (system beep) feedback as substitutes for physical vibration
- Enable HAPTIC for Pocket radio in simulator build
- Add simuGetHaptic() WASM export to simulib.cpp to expose haptic state
- Override hapticQueue::event() in SIMU mode to set haptic state variable
- Poll haptic state in WasmSimulatorInterface every 50ms
- Emit hapticChanged() signal when haptic fires
- Handle hapticChanged() in SimulatorMainWindow with visual (window jitter)
  and audible (system beep) feedback as substitutes for physical vibration
- Enable HAPTIC for Pocket radio in simulator build
@Kudzzo Kudzzo force-pushed the feature/simulator-haptic-feedback branch from 158d877 to 1543e8e Compare May 8, 2026 21:10
@elecpower
Copy link
Copy Markdown
Collaborator

@Kudzzo could you please remove all the changes that are not being used. They are #includes, CMakeLists.txt, qrc and haptic.wav not used.

By the way I can hear the beep now.

@Kudzzo
Copy link
Copy Markdown
Author

Kudzzo commented May 10, 2026

Cleaned up. I removed unused includes (QSoundEffect, QPropertyAnimation), Qt::Multimedia from CMakeLists, haptic.wav from resources and sounds folder.

@elecpower
Copy link
Copy Markdown
Collaborator

Better but still need to remove the unused sounds/haptic.wav file

@pfeerick pfeerick removed the needs: rebase A git rebase on top of the latest destination branch version is required label May 11, 2026
@Kudzzo
Copy link
Copy Markdown
Author

Kudzzo commented May 12, 2026

Is there any problems left?

@Kudzzo
Copy link
Copy Markdown
Author

Kudzzo commented May 20, 2026

Re-requested review. All requested changes have been addressed .so references removed, haptic.wav deleted, unused includes cleaned up. Ready for final review.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants