fix(example): J-key voice command ack protocol to stop stale repeats - #4
Open
cavonlee wants to merge 1 commit into
Open
fix(example): J-key voice command ack protocol to stop stale repeats#4cavonlee wants to merge 1 commit into
cavonlee wants to merge 1 commit into
Conversation
- Edge-triggered voice commands: only execute on new command (None/'' -> command), so repeated identical commands (e.g. consecutive "forward") trigger again - Ack protocol with App: device returns J:1 on receipt, executes the action, then returns J:0 when done so the App clears the pending command - Fixes: voice command repeating the last recognition result forever - Bump version to 0.0.4, add CHANGELOG and README notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Client reported that
sc.get("J")keeps returning the last voice recognition result forever (see PiCar-X / PiDog app control demos). Root cause on the demo side: thespeakvariable is assigned once and never reset, so the car keeps executing the last voice command.Fix
Rework the J-key voice handling in
examples/picarx_control.py:Noneto a command, so repeated identical commands (e.g. consecutive "forward") trigger again.J: 1(ack, action in progress)J: 0(action done) → App clears the pending commandThis stops the stale repeat and makes repeated voice commands work.
Testing
picarx_control.pyon the Pi, connect the SunFounder Controller AppSTT read changed(value 1 and 0) +STT value clearVersion bumped to 0.0.4 (0.0.3 is claimed by the open debug-logging PR #3).