Files
iroBotAMOLED_Test/main/emotion-engine/emotion_manager.h
Neil Arora 22bd5a6f70 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.
2026-01-27 00:30:12 +05:30

88 lines
2.2 KiB
C

/**
* @file emotion_manager.h
* @brief Central emotion coordination system
*
* This module manages all emotion-related animations and coordinates
* transitions between emotional states. It provides a unified interface
* for triggering emotions from various sources (shake, touch, etc.).
*/
#ifndef EMOTION_MANAGER_H
#define EMOTION_MANAGER_H
#include <stdbool.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
// ----------------------------------------------------------------------------
// Type Definitions
// ----------------------------------------------------------------------------
/**
* @brief Supported emotion types
*/
typedef enum {
EMOTION_IDLE = 0, // Default idle state with blink
EMOTION_BLINK, // Single blink animation
EMOTION_SHAKING, // Currently being shaken
EMOTION_SHAKE_STOPPING, // Transition from shaking to idle
EMOTION_SURPRISED, // Surprised expression
EMOTION_SAD, // Sad expression
EMOTION_ANGRY, // Angry expression
EMOTION_SHY, // Shy expression
EMOTION_COUNT
} EmotionType;
// ----------------------------------------------------------------------------
// Public API
// ----------------------------------------------------------------------------
/**
* @brief Initialize the emotion engine
*
* Sets up all emotion animations and prepares the system.
* Must be called after display driver initialization.
*
* @return true on success, false on failure
*/
bool emotionManagerInit(void);
/**
* @brief Start the emotion engine with default state
*
* Begins the idle animation with natural blinking.
* Call this after splash screen is complete.
*/
void emotionManagerStart(void);
/**
* @brief Trigger a specific emotion
*
* Plays the specified emotion animation. The system will
* automatically return to idle state after the animation completes.
*
* @param emotion The emotion to trigger
*/
void emotionManagerSetEmotion(EmotionType emotion);
/**
* @brief Get the currently active emotion
*
* @return The current emotion type
*/
EmotionType emotionManagerGetCurrent(void);
/**
* @brief Stop all emotions and cleanup
*/
void emotionManagerStop(void);
#ifdef __cplusplus
}
#endif
#endif // EMOTION_MANAGER_H