feat(firmware): add configurable idle head motion#48
Open
rebelthor wants to merge 1 commit into
Open
Conversation
Adds an on-device "Idle Behavior" screen under Setup -> AI.Agent that exposes three controls for the randomized head motion in AI Agent STANDBY: - Enable toggle - Frequency preset (Sparse / Normal / Frequent), maps to interval ranges - Intensity preset (Calm / Normal / Lively), scales motion travel Defaults preserve current behavior. When disabled, IdleMotionModifier is not added, so head petting and other motions stay fully responsive. Persisted in NVS via the existing XiaozhiConfig_t / Settings wrapper. UI mirrors XiaozhiPowerSavingWorker. Side change in StackChanAvatarDisplay::SetStatus and the sleepy emotion handler: IdleMotionModifier and IdleExpressionModifier were previously added and removed together under a single id check. Decoupled into independent checks so the motion modifier can be omitted while keeping the expression idling.
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.
Summary
New "Idle Behavior" screen under Setup → AI.Agent: enable toggle,
frequency preset (Sparse / Normal / Frequent), intensity preset
(Calm / Normal / Lively). Defaults preserve current behavior.
Refs #47.
Validation
Tested on CoreS3 against firmware-dev
f8bbb90+ this commit(ESP-IDF v5.5.4). All three frequency and intensity presets produce
the expected cadence and motion-travel shifts. Disable path verified:
head stays still in
STANDBY. Head petting (HeadPetModifier)remains responsive across all settings — intensity scales travel
only, not speed, so long idle motions never starve the motion
subsystem.
Side change
IdleMotionModifierandIdleExpressionModifieradd/remove pairs inStackChanAvatarDisplay::SetStatusand thesleepyemotion handlerwere coupled under a single id check on the motion modifier. That
worked because both were always added together. With the new
disable path, motion may be absent while expression is present, so
the original gate would leak the expression modifier on STANDBY exit.
Split into independent checks in three locations (one start site,
two stop sites) so each modifier is added and removed on its own.
Behavior unchanged when both are present.