Revision fdb6f148 src/server/gaze_motion_generator.cpp
src/server/gaze_motion_generator.cpp | ||
---|---|---|
74 | 74 |
} |
75 | 75 |
|
76 | 76 |
//check for eye getting close to ocolomotor range |
77 |
float eye_pos_l = joint_interface->get_ts_position(JointInterface::ID_EYES_LEFT_LR).get_newest_value(); |
|
78 |
float eye_pos_r = joint_interface->get_ts_position(JointInterface::ID_EYES_RIGHT_LR).get_newest_value(); |
|
79 |
float eye_pos_ud = joint_interface->get_ts_position(JointInterface::ID_EYES_BOTH_UD).get_newest_value(); |
|
77 |
//float eye_pos_l = joint_interface->get_ts_position(JointInterface::ID_EYES_LEFT_LR).get_newest_value(); |
|
78 |
//float eye_pos_r = joint_interface->get_ts_position(JointInterface::ID_EYES_RIGHT_LR).get_newest_value(); |
|
79 |
//float eye_pos_ud = joint_interface->get_ts_position(JointInterface::ID_EYES_BOTH_UD).get_newest_value(); |
|
80 |
//actually it makes more sense to trigger the neck saccade based on the target getting out of the OMR |
|
81 |
float eye_target_l = joint_interface->get_target_position(JointInterface::ID_EYES_LEFT_LR); |
|
82 |
float eye_target_r = joint_interface->get_target_position(JointInterface::ID_EYES_RIGHT_LR); |
|
83 |
float eye_target_ud = joint_interface->get_target_position(JointInterface::ID_EYES_BOTH_UD); |
|
80 | 84 |
|
81 | 85 |
//min/max bounds: |
82 | 86 |
float left_min = OMR_LIMIT_TRIGGERS_NECK_SACCADE * joint_interface->get_joint_min(JointInterface::ID_EYES_LEFT_LR); |
... | ... | |
87 | 91 |
float ud_max = OMR_LIMIT_TRIGGERS_NECK_SACCADE * joint_interface->get_joint_max(JointInterface::ID_EYES_BOTH_UD); |
88 | 92 |
|
89 | 93 |
if ( |
90 |
(eye_pos_l < left_min) || (eye_pos_l > left_max) ||
|
|
91 |
(eye_pos_r < right_min) || (eye_pos_r > right_max) ||
|
|
92 |
(eye_pos_ud < ud_min) || (eye_pos_ud > ud_max)){
|
|
94 |
(eye_target_l < left_min) || (eye_target_l > left_max) ||
|
|
95 |
(eye_target_r < right_min) || (eye_target_r > right_max) ||
|
|
96 |
(eye_target_ud < ud_min) || (eye_target_ud > ud_max)){
|
|
93 | 97 |
//the eyeball gets close to OMR, activate a neck compensation motion: |
94 | 98 |
neck_saccade_omr = true; |
95 | 99 |
}else{ |
Also available in: Unified diff