humotion / src / server / eyebrow_motion_generator.cpp @ d3aa8ab3
History | View | Annotate | Download (1.156 KB)
1 |
#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 |
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 |
} |
28 |
|
29 |
//! publish targets to motor boards:
|
30 |
void EyebrowMotionGenerator::publish_targets(){
|
31 |
//publish values if there is an active gaze input within the last timerange
|
32 |
if (gaze_target_input_active()){
|
33 |
joint_interface->publish_target(JointInterface::ID_EYES_LEFT_BROW); |
34 |
joint_interface->publish_target(JointInterface::ID_EYES_RIGHT_BROW); |
35 |
} |
36 |
} |