Statistics
| Branch: | Tag: | Revision:

humotion / src / server / eyebrow_motion_generator.cpp @ 18e9b892

History | View | Annotate | Download (1.156 KB)

1 8c6c1163 Simon Schulz
#include "server/eyebrow_motion_generator.h"
2
#include "server/server.h"
3
4
using namespace std;
5
using namespace humotion;
6
using namespace humotion::server;
7
8
//! constructor
9
EyebrowMotionGenerator::EyebrowMotionGenerator(JointInterface *j) : MotionGenerator(j){
10
}
11
12
13
//! destructor
14
EyebrowMotionGenerator::~EyebrowMotionGenerator(){
15
16
}
17
18
//! calculate joint targets
19
void EyebrowMotionGenerator::calculate_targets(){
20
    //printf("> humotion: calculating eyebrow targets\n");
21
    float eyebrow_left_target = requested_gaze_state.eyebrow_left;
22
    float eyebrow_right_target = requested_gaze_state.eyebrow_right;
23
24
    //store targets:
25 35b3ca25 Simon Schulz
    joint_interface->set_target(JointInterface::ID_EYES_LEFT_BROW, eyebrow_left_target, 0.0);
26
    joint_interface->set_target(JointInterface::ID_EYES_RIGHT_BROW, eyebrow_right_target, 0.0);
27 8c6c1163 Simon Schulz
}
28
29
//! publish targets to motor boards:
30
void EyebrowMotionGenerator::publish_targets(){
31 7ed40bef Simon Schulz
    //publish values if there is an active gaze input within the last timerange
32
    if (gaze_target_input_active()){
33 35b3ca25 Simon Schulz
        joint_interface->publish_target(JointInterface::ID_EYES_LEFT_BROW);
34
        joint_interface->publish_target(JointInterface::ID_EYES_RIGHT_BROW);
35 7ed40bef Simon Schulz
    }
36 8c6c1163 Simon Schulz
}