Feature/simulator haptic feedback#7322
Conversation
There was a problem hiding this comment.
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!
- 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
158d877 to
1543e8e
Compare
|
@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. |
|
Cleaned up. I removed unused includes (QSoundEffect, QPropertyAnimation), Qt::Multimedia from CMakeLists, haptic.wav from resources and sounds folder. |
|
Better but still need to remove the unused sounds/haptic.wav file |
|
Is there any problems left? |
|
Re-requested review. All requested changes have been addressed .so references removed, haptic.wav deleted, unused includes cleaned up. Ready for final review. |
Summary
Implements haptic feedback for the EdgeTX Companion Simulator as required by Developer Contest 7.
Changes
simuGetHaptic()WASM export insimulib.cppto expose haptic state to the hosthapticQueue::event()in SIMU mode to set haptic state variableWasmSimulatorInterfaceevery 50mshapticChanged()signal when haptic fireshapticChanged()inSimulatorMainWindowwith:Tested on
Related
Developer Contest 7: https://edgetx.org/dc7_simuhaptic/