Skip to content

feat(firmware): add configurable idle head motion#48

Open
rebelthor wants to merge 1 commit into
m5stack:mainfrom
rebelthor:feat/idle-motion-config
Open

feat(firmware): add configurable idle head motion#48
rebelthor wants to merge 1 commit into
m5stack:mainfrom
rebelthor:feat/idle-motion-config

Conversation

@rebelthor
Copy link
Copy Markdown

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

IdleMotionModifier and IdleExpressionModifier add/remove pairs in
StackChanAvatarDisplay::SetStatus and the sleepy emotion handler
were 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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant