diff --git a/app/ergoCubEmotions/conf/config.ini b/app/ergoCubEmotions/conf/config.ini index 92edb3f1..dbdc8ba1 100644 --- a/app/ergoCubEmotions/conf/config.ini +++ b/app/ergoCubEmotions/conf/config.ini @@ -1,6 +1,7 @@ [general] -num_expressions 4 -num_transitions 12 +num_expressions 5 +num_transitions 20 +fullscreen true #[expression_0] #name neutral @@ -42,6 +43,11 @@ name shy type video file expressions/videos/shy.mp4 +[expression_4] +name angry +type video +file expressions/videos/angry.mp4 + [transition_0] source neutral destination happy @@ -102,4 +108,42 @@ source shy destination happy file expressions/videos/shy-happy.mp4 +[transition_12] +source happy +destination angry +file expressions/videos/happy-angry.mp4 + +[transition_13] +source angry +destination happy +file expressions/videos/angry-happy.mp4 + +[transition_14] +source angry +destination neutral +file expressions/videos/angry-neutral.mp4 + +[transition_15] +source angry +destination alert +file expressions/videos/angry-alert.mp4 + +[transition_16] +source angry +destination shy +file expressions/videos/angry-shy.mp4 + +[transition_17] +source neutral +destination angry +file expressions/videos/neutral-angry.mp4 + +[transition_18] +source alert +destination angry +file expressions/videos/alert-angry.mp4 +[transition_19] +source shy +destination angry +file expressions/videos/shy-angry.mp4 diff --git a/src/modules/ergoCubEmotions/ergoCubEmotions.cpp b/src/modules/ergoCubEmotions/ergoCubEmotions.cpp index 850a7286..edaa213e 100644 --- a/src/modules/ergoCubEmotions/ergoCubEmotions.cpp +++ b/src/modules/ergoCubEmotions/ergoCubEmotions.cpp @@ -31,6 +31,7 @@ bool ErgoCubEmotions::configure(ResourceFinder& rf) Bottle &bGroup = rf.findGroup("general"); nExpressions = bGroup.find("num_expressions").asInt32(); nTransitions = bGroup.find("num_transitions").asInt32(); + fullscreen = bGroup.find("fullscreen").asBool(); for(int i = 0; i < nExpressions; i++) { @@ -105,8 +106,13 @@ bool ErgoCubEmotions::configure(ResourceFinder& rf) isTransition = true; command = "neutral"; - namedWindow("emotion", WND_PROP_FULLSCREEN); - setWindowProperty("emotion", WND_PROP_FULLSCREEN, WINDOW_FULLSCREEN); + if(fullscreen){ + namedWindow("emotion", WND_PROP_FULLSCREEN); + setWindowProperty("emotion", WND_PROP_FULLSCREEN, WINDOW_FULLSCREEN); + } + else{ + namedWindow("emotion", WINDOW_NORMAL); + } cmdPort.open("/ergoCubEmotions/rpc"); attach(cmdPort); diff --git a/src/modules/ergoCubEmotions/ergoCubEmotions.h b/src/modules/ergoCubEmotions/ergoCubEmotions.h index 4e70f6a6..ec0a46a8 100644 --- a/src/modules/ergoCubEmotions/ergoCubEmotions.h +++ b/src/modules/ergoCubEmotions/ergoCubEmotions.h @@ -23,34 +23,36 @@ #include #include -class ErgoCubEmotions : public yarp::os::RFModule, public ergoCubEmotions_IDL { - public: - ErgoCubEmotions(); - ~ErgoCubEmotions(); - - bool attach(yarp::os::RpcServer& source); - bool configure(yarp::os::ResourceFinder& config); - bool close(); - bool updateModule(); - double getPeriod(); - - bool setEmotion(const std::string& command); - std::vector availableEmotions(); - void showTransition(const std::string ¤t, const std::string &desired); - - yarp::os::RpcServer cmdPort; - int nExpressions; - int nTransitions; - bool isTransition; - std::unordered_map> imgMap; - std::map, std::string> transitionMap; - std::string command; - std::string currentCommand; - std::vector avlEmotions; - cv::Mat img; - std::mutex mutex; - std::vector videoCaptures; - std::vector videoFileNames; +class ErgoCubEmotions : public yarp::os::RFModule, public ergoCubEmotions_IDL +{ +public: + ErgoCubEmotions(); + ~ErgoCubEmotions(); + + bool attach(yarp::os::RpcServer &source); + bool configure(yarp::os::ResourceFinder &config); + bool close(); + bool updateModule(); + double getPeriod(); + + bool setEmotion(const std::string &command); + std::vector availableEmotions(); + void showTransition(const std::string ¤t, const std::string &desired); + + yarp::os::RpcServer cmdPort; + int nExpressions; + int nTransitions; + bool isTransition; + bool fullscreen; + std::unordered_map> imgMap; + std::map, std::string> transitionMap; + std::string command; + std::string currentCommand; + std::vector avlEmotions; + cv::Mat img; + std::mutex mutex; + std::vector videoCaptures; + std::vector videoFileNames; }; #endif diff --git a/src/modules/ergoCubEmotions/expressions/videos/alert-angry.mp4 b/src/modules/ergoCubEmotions/expressions/videos/alert-angry.mp4 new file mode 100644 index 00000000..f8eb25b0 Binary files /dev/null and b/src/modules/ergoCubEmotions/expressions/videos/alert-angry.mp4 differ diff --git a/src/modules/ergoCubEmotions/expressions/videos/angry-alert.mp4 b/src/modules/ergoCubEmotions/expressions/videos/angry-alert.mp4 new file mode 100644 index 00000000..3c2b2108 Binary files /dev/null and b/src/modules/ergoCubEmotions/expressions/videos/angry-alert.mp4 differ diff --git a/src/modules/ergoCubEmotions/expressions/videos/angry-happy.mp4 b/src/modules/ergoCubEmotions/expressions/videos/angry-happy.mp4 new file mode 100644 index 00000000..73e9740b Binary files /dev/null and b/src/modules/ergoCubEmotions/expressions/videos/angry-happy.mp4 differ diff --git a/src/modules/ergoCubEmotions/expressions/videos/angry-neutral.mp4 b/src/modules/ergoCubEmotions/expressions/videos/angry-neutral.mp4 new file mode 100644 index 00000000..312ee850 Binary files /dev/null and b/src/modules/ergoCubEmotions/expressions/videos/angry-neutral.mp4 differ diff --git a/src/modules/ergoCubEmotions/expressions/videos/angry-shy.mp4 b/src/modules/ergoCubEmotions/expressions/videos/angry-shy.mp4 new file mode 100644 index 00000000..c8c2d5f3 Binary files /dev/null and b/src/modules/ergoCubEmotions/expressions/videos/angry-shy.mp4 differ diff --git a/src/modules/ergoCubEmotions/expressions/videos/angry.mp4 b/src/modules/ergoCubEmotions/expressions/videos/angry.mp4 new file mode 100644 index 00000000..3bc1580a Binary files /dev/null and b/src/modules/ergoCubEmotions/expressions/videos/angry.mp4 differ diff --git a/src/modules/ergoCubEmotions/expressions/videos/happy-angry.mp4 b/src/modules/ergoCubEmotions/expressions/videos/happy-angry.mp4 new file mode 100644 index 00000000..732f8eae Binary files /dev/null and b/src/modules/ergoCubEmotions/expressions/videos/happy-angry.mp4 differ diff --git a/src/modules/ergoCubEmotions/expressions/videos/neutral-angry.mp4 b/src/modules/ergoCubEmotions/expressions/videos/neutral-angry.mp4 new file mode 100644 index 00000000..8840f9e2 Binary files /dev/null and b/src/modules/ergoCubEmotions/expressions/videos/neutral-angry.mp4 differ diff --git a/src/modules/ergoCubEmotions/expressions/videos/shy-angry.mp4 b/src/modules/ergoCubEmotions/expressions/videos/shy-angry.mp4 new file mode 100644 index 00000000..826cd26b Binary files /dev/null and b/src/modules/ergoCubEmotions/expressions/videos/shy-angry.mp4 differ