Revision 4bd3e852 server/include/RSB/AnimationCallbackWrapper.h

View differences:

server/include/RSB/AnimationCallbackWrapper.h
31 31
#include "Animation.h"
32 32

  
33 33
//callback handler incoming animation requests:
34
class AnimationCallbackWrapper : public CallbackWrapper<rst::robot::Animation>{
34
class AnimationCallbackWrapper : public CallbackWrapper<rst::animation::HeadAnimation>{
35 35
    public:
36 36
       AnimationCallbackWrapper(Middleware *mw) : CallbackWrapper(mw){}
37 37

  
38
       void call(const std::string& method_name, boost::shared_ptr<rst::robot::Animation> input){
38
       void call(const std::string& method_name, boost::shared_ptr<rst::animation::HeadAnimation> input){
39 39
           printf("> incomint animation (method = %s)\n",method_name.c_str());
40 40

  
41 41
           //fetch animation passed by rsb:
42
           rst::robot::Animation *rst_ani = input.get();
42
           rst::animation::HeadAnimation *rst_ani = input.get();
43 43
           boost::shared_ptr<Animation> ani(new Animation());
44 44

  
45
           switch ((int) rst_ani->target()){
46
               case(rst_ani->IDLE):         ani->target = Animation::IDLE; break;
47
               case(rst_ani->HEAD_NOD):     ani->target = Animation::HEAD_NOD; break;
48
               case(rst_ani->HEAD_SHAKE):   ani->target = Animation::HEAD_SHAKE; break;
49
               case(rst_ani->EYEBLINK_L):   ani->target = Animation::EYEBLINK_L; break;
50
               case(rst_ani->EYEBLINK_R):   ani->target = Animation::EYEBLINK_R; break;
51
               case(rst_ani->EYEBLINK_BOTH):ani->target = Animation::EYEBLINK_BOTH; break;
52
               case(rst_ani->EYEBROWS_RAISE):ani->target = Animation::EYEBROWS_RAISE;break;
53
               case(rst_ani->EYEBROWS_LOWER):ani->target = Animation::EYEBROWS_LOWER;break;
45
           switch ((int) rst_ani->animation()){
46
               case(rst_ani->IDLE):             ani->target = Animation::IDLE; break;
47
               case(rst_ani->HEAD_NOD):         ani->target = Animation::HEAD_NOD; break;
48
               case(rst_ani->HEAD_SHAKE):       ani->target = Animation::HEAD_SHAKE; break;
49
               case(rst_ani->EYEBLINK_LEFT):    ani->target = Animation::EYEBLINK_L; break;
50
               case(rst_ani->EYEBLINK_RIGHT):   ani->target = Animation::EYEBLINK_R; break;
51
               case(rst_ani->EYEBLINK_BOTH):    ani->target = Animation::EYEBLINK_BOTH; break;
52
               case(rst_ani->EYEBROWS_RAISE):   ani->target = Animation::EYEBROWS_RAISE;break;
53
               case(rst_ani->EYEBROWS_LOWER):   ani->target = Animation::EYEBROWS_LOWER;break;
54
               case(rst_ani->ENGAGEMENT_LEFT):  ani->target = Animation::ENGAGEMENT_LEFT;break;
55
               case(rst_ani->ENGAGEMENT_RIGHT): ani->target = Animation::ENGAGEMENT_RIGHT;break;
54 56
               default:
55 57
                   ani->target = Animation::IDLE;
56
                   printf("> unhandled animatin target %d\n",(int)rst_ani->target());
58
                   printf("> unhandled animatin target %d\n",(int)rst_ani->animation());
57 59
                   throw std::runtime_error("AnimationCallback: invalid animation id");
58 60
                   return;
59 61
           }
60 62
           ani->repetitions   = rst_ani->repetitions();
61 63
           ani->duration_each = rst_ani->duration_each();
62
           ani->scale         = rst_ani->scale();
64
           ani->scale         = rst_ani->emphasis_scale();
63 65

  
64 66
           printf("> new Animation: %s\n", ani->as_string().c_str());
65 67

  

Also available in: Unified diff