Revision fdb6f148
examples/meka/src/mekajointinterface.cpp | ||
---|---|---|
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
void MekaJointInterface::store_dummy_data(int id, double timestamp){ |
67 |
JointInterface::store_incoming_position(id, 0.0, timestamp); |
|
67 |
JointInterface::store_incoming_position(joint_target[ID_NECK_PAN]id, 0.0, timestamp);
|
|
68 | 68 |
JointInterface::store_incoming_speed(id, 0.0, timestamp); |
69 | 69 |
} |
70 | 70 |
|
src/server/controller.cpp | ||
---|---|---|
136 | 136 |
} |
137 | 137 |
|
138 | 138 |
GazeState target_gaze; |
139 |
new_gaze_target.dump(); |
|
139 |
//new_gaze_target.dump();
|
|
140 | 140 |
|
141 | 141 |
//relative or absolute gaze update? |
142 | 142 |
if (new_gaze_target.gaze_type == GazeState::GAZETYPE_RELATIVE){ |
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{ |
src/server/neck_motion_generator.cpp | ||
---|---|---|
133 | 133 |
requested_neck_state = requested_gaze_state; |
134 | 134 |
} |
135 | 135 |
|
136 |
|
|
137 |
requested_neck_state.dump(); |
|
136 | 138 |
//get targets: this is the sum of stored neck target and up-to-date offset: |
137 | 139 |
float neck_pan_target = requested_neck_state.pan + requested_gaze_state.pan_offset; |
138 | 140 |
float neck_tilt_target = requested_neck_state.tilt + requested_gaze_state.tilt_offset; |
Also available in: Unified diff