Statistics
| Branch: | Tag: | Revision:

humotion / src / server / eyebrow_motion_generator.cpp @ 4dbb1a71

History | View | Annotate | Download (1.191 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 21444915 Simon Schulz
    joint_interface->set_target_position(JointInterface::ID_EYES_LEFT_BROW, eyebrow_left_target, 0.0);
26
    joint_interface->set_target_position(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
        joint_interface->publish_target_position(JointInterface::ID_EYES_LEFT_BROW);
34
        joint_interface->publish_target_position(JointInterface::ID_EYES_RIGHT_BROW);
35
    }
36 8c6c1163 Simon Schulz
}