update: fixed shake animation
The shake animation figures have been fixed. However, the petting emotion working with touch remains an issue. The Lottie JSON for the emotion is unable not parsable for some reason and my next step is to fix that for tomorrow's meeting.
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "drivers/display_driver.h"
|
||||
#include "emotion-engine/blink/blink_emotion.h"
|
||||
#include "emotion-engine/shake/shake_emotion.h"
|
||||
#include "emotion-engine/shy/shy_emotion.h"
|
||||
#include "esp_log.h"
|
||||
|
||||
static const char *TAG = "emotion_manager";
|
||||
@@ -40,6 +41,12 @@ bool emotionManagerInit(void) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Initialize shy emotion
|
||||
if (!shyEmotionInit()) {
|
||||
ESP_LOGE(TAG, "Failed to initialize shy emotion");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Future: Initialize other emotions here
|
||||
// surprisedEmotionInit();
|
||||
// sadEmotionInit();
|
||||
@@ -101,6 +108,13 @@ void emotionManagerSetEmotion(EmotionType emotion) {
|
||||
ESP_LOGI(TAG, "Emotion %d not yet implemented", emotion);
|
||||
break;
|
||||
|
||||
case EMOTION_SHY:
|
||||
// Stop any other animations and play shy
|
||||
shakeEmotionStop();
|
||||
blinkEmotionPause();
|
||||
shyEmotionPlay();
|
||||
break;
|
||||
|
||||
default:
|
||||
ESP_LOGW(TAG, "Unknown emotion type: %d", emotion);
|
||||
break;
|
||||
@@ -117,6 +131,7 @@ void emotionManagerStop(void) {
|
||||
ESP_LOGI(TAG, "Stopping emotion manager");
|
||||
|
||||
blinkEmotionStop();
|
||||
shyEmotionStop();
|
||||
// Future: Stop other emotions
|
||||
|
||||
initialized = false;
|
||||
|
||||
@@ -32,6 +32,7 @@ typedef enum {
|
||||
EMOTION_SURPRISED, // Surprised expression
|
||||
EMOTION_SAD, // Sad expression
|
||||
EMOTION_ANGRY, // Angry expression
|
||||
EMOTION_SHY, // Shy expression
|
||||
EMOTION_COUNT
|
||||
} EmotionType;
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
140
main/emotion-engine/shy/shy_emotion.c
Normal file
140
main/emotion-engine/shy/shy_emotion.c
Normal file
File diff suppressed because one or more lines are too long
60
main/emotion-engine/shy/shy_emotion.h
Normal file
60
main/emotion-engine/shy/shy_emotion.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @file shy_emotion.h
|
||||
* @brief Shy emotion animation controller
|
||||
*
|
||||
* Manages the shy Lottie animation that plays when the device
|
||||
* responds to touch with a shy expression.
|
||||
*/
|
||||
|
||||
#ifndef SHY_EMOTION_H
|
||||
#define SHY_EMOTION_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Initialize the shy emotion module
|
||||
*
|
||||
* @return true on success, false on failure
|
||||
*/
|
||||
bool shyEmotionInit(void);
|
||||
|
||||
/**
|
||||
* @brief Start playing the shy animation
|
||||
*
|
||||
* Animation will play once (not looping) and transition back to idle
|
||||
* when complete.
|
||||
*/
|
||||
void shyEmotionPlay(void);
|
||||
|
||||
/**
|
||||
* @brief Update the shy emotion state
|
||||
*
|
||||
* Must be called periodically to check if the shy animation has completed.
|
||||
*
|
||||
* @return true if animation is complete and ready for idle, false if still
|
||||
* playing
|
||||
*/
|
||||
bool shyEmotionUpdate(void);
|
||||
|
||||
/**
|
||||
* @brief Stop the shy animation immediately (for cleanup)
|
||||
*/
|
||||
void shyEmotionStop(void);
|
||||
|
||||
/**
|
||||
* @brief Check if shy animation is currently playing
|
||||
*
|
||||
* @return true if playing, false otherwise
|
||||
*/
|
||||
bool shyEmotionIsPlaying(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // SHY_EMOTION_H
|
||||
Reference in New Issue
Block a user