Revision f7954788 src/server/eye_motion_generator.cpp

View differences:

src/server/eye_motion_generator.cpp
82 82
//! calculate joint targets
83 83
void EyeMotionGenerator::calculate_targets() {
84 84
    // use the target values for a faster response
85
    float neck_pan_now  = joint_interface_->get_target_position(JointInterface::ID_NECK_PAN);
86
    float neck_tilt_now = joint_interface_->get_target_position(JointInterface::ID_NECK_TILT);
85
    float neck_pan_now  = 0.0;
86
    float neck_tilt_now = 0.0;
87

  
88
    if (use_neck_target_instead_of_position_eye) {
89
        // position calc based on target
90
        neck_pan_now = joint_interface_->get_target_position(JointInterface::ID_NECK_PAN);
91
        neck_tilt_now = joint_interface_->get_target_position(JointInterface::ID_NECK_TILT);
92
    } else {
93
        // position calc based on real position
94
        neck_pan_now =
95
                joint_interface_->get_ts_position(JointInterface::ID_NECK_PAN).get_newest_value();
96
        neck_tilt_now =
97
                joint_interface_->get_ts_position(JointInterface::ID_NECK_TILT).get_newest_value();
98
    }
87 99

  
88 100
    // calculate target angles for the eyes
89 101
    // right eye is dominant -> direct output
......
99 111
    // tilt
100 112
    float eye_tilt_target = requested_gaze_state_.tilt - (neck_tilt_now);
101 113

  
102
    if (0) {
103
        eye_pan_r_target = 0.0;
104
        eye_pan_l_target = 0.0;
105
        eye_tilt_target  = 0.0;
106
    }
107

  
108 114
    // check and take care of limits
109 115
    eye_pan_l_target = limit_target(JointInterface::ID_EYES_LEFT_LR, eye_pan_l_target);
110 116
    eye_pan_r_target = limit_target(JointInterface::ID_EYES_RIGHT_LR, eye_pan_r_target);

Also available in: Unified diff