Revision ea068cf1 src/server/mouth_motion_generator.cpp
| src/server/mouth_motion_generator.cpp | ||
|---|---|---|
| 53 | 53 |
//! \param int lower joint id |
| 54 | 54 |
void MouthMotionGenerator::update_mouth_target(int upper_id, int lower_id) {
|
| 55 | 55 |
// fetch min/max for joints |
| 56 |
float min_upper = joint_interface->get_joint_min(upper_id); |
|
| 57 |
float max_lower = joint_interface->get_joint_max(lower_id); |
|
| 56 |
float min_upper = joint_interface_->get_joint_min(upper_id);
|
|
| 57 |
float max_lower = joint_interface_->get_joint_max(lower_id);
|
|
| 58 | 58 |
float min_opening = MOUTH_MIN_OPENING; |
| 59 | 59 |
|
| 60 | 60 |
// fetch position & opening for joint, parameter is only used to |
| 61 | 61 |
// determine LEFT/CENTER/RIGHT. upper/lower plays no role here |
| 62 |
float position = mouthstate_to_position(requested_mouth_target, upper_id); |
|
| 63 |
float opening = min_opening + mouthstate_to_opening(requested_mouth_target, upper_id); |
|
| 62 |
float position = mouthstate_to_position(requested_mouth_target_, upper_id);
|
|
| 63 |
float opening = min_opening + mouthstate_to_opening(requested_mouth_target_, upper_id);
|
|
| 64 | 64 |
|
| 65 | 65 |
// check opening larger than minimum |
| 66 | 66 |
if (opening < min_opening) {
|
| ... | ... | |
| 90 | 90 |
} |
| 91 | 91 |
|
| 92 | 92 |
// tell the joint about the new values |
| 93 |
joint_interface->set_target(upper_id, unsafe_target_upper, 0.0); |
|
| 94 |
joint_interface->set_target(lower_id, unsafe_target_lower, 0.0); |
|
| 93 |
joint_interface_->set_target(upper_id, unsafe_target_upper, 0.0);
|
|
| 94 |
joint_interface_->set_target(lower_id, unsafe_target_lower, 0.0);
|
|
| 95 | 95 |
} |
| 96 | 96 |
|
| 97 | 97 |
|
| ... | ... | |
| 135 | 135 |
void MouthMotionGenerator::publish_targets() {
|
| 136 | 136 |
// publish values if there is an active gaze input within the last timerange |
| 137 | 137 |
if (mouth_target_input_active()) {
|
| 138 |
joint_interface->publish_target(JointInterface::ID_LIP_LEFT_UPPER); |
|
| 139 |
joint_interface->publish_target(JointInterface::ID_LIP_LEFT_LOWER); |
|
| 140 |
joint_interface->publish_target(JointInterface::ID_LIP_CENTER_UPPER); |
|
| 141 |
joint_interface->publish_target(JointInterface::ID_LIP_CENTER_LOWER); |
|
| 142 |
joint_interface->publish_target(JointInterface::ID_LIP_RIGHT_UPPER); |
|
| 143 |
joint_interface->publish_target(JointInterface::ID_LIP_RIGHT_LOWER); |
|
| 138 |
joint_interface_->publish_target(JointInterface::ID_LIP_LEFT_UPPER);
|
|
| 139 |
joint_interface_->publish_target(JointInterface::ID_LIP_LEFT_LOWER);
|
|
| 140 |
joint_interface_->publish_target(JointInterface::ID_LIP_CENTER_UPPER);
|
|
| 141 |
joint_interface_->publish_target(JointInterface::ID_LIP_CENTER_LOWER);
|
|
| 142 |
joint_interface_->publish_target(JointInterface::ID_LIP_RIGHT_UPPER);
|
|
| 143 |
joint_interface_->publish_target(JointInterface::ID_LIP_RIGHT_LOWER);
|
|
| 144 | 144 |
} |
| 145 | 145 |
} |
| 146 | 146 |
|
Also available in: Unified diff