21 const std::string CMoveMasterModel::keypoint[
NO_KEYPOINTS] = {
"PalmCenter",
"IndexTip",
"MiddleTip",
"ThumbTip"};
22 const std::string CMoveMasterModel::jointname[
NO_JOINTS] = {
"Body",
"Shoulder",
"Elbow",
"Wrist_pan",
"Wrist_rotate",
23 "Palm",
"Index_0",
"Index_1",
"Middle_0",
"Middle_1",
"Ring_0",
"Ring_1",
24 "Pinky_0",
"Pinky_1",
"Thumb_0",
"Thumb_1",
25 "Actuator_Thumb_1",
"Actuator_Thumb_2",
"Actuator_Index_1",
"Actuator_Index_2",
26 "Actuator_Middle_1",
"Actuator_Middle_2",
"Actuator_Ring_1",
"Actuator_Ring_2",
27 "Actuator_Pinky_1",
"Actuator_Pinky_2"
56 printf(
"already initialized\n");
72 printf(
"Keypoint node %s not found in path!\n", keypoint[i].c_str());
81 printf(
"joint node %s not found in path!\n", jointname[i].c_str());
89 hand_pos =
static_cast<SoTranslation*
>(temp_path->getNodeFromTail(0));
91 hand_rot =
static_cast<SoTransform*
>(temp_path->getNodeFromTail(0));
94 m_pObjCylPos =
static_cast<SoTranslation*
>(temp_path->getNodeFromTail(0));
96 m_pObjCylRot =
static_cast<SoTransform*
>(temp_path->getNodeFromTail(0));
101 m_pTestSpherePos =
static_cast<SoTranslation*
>(temp_path->getNodeFromTail(0));
110 printf(
"call init first\n");
124 printf(
"Illegal joint: %d\n", nJoint);
130 printf(
"Could not set joint angle for node %s!\n", jointname[nJoint].c_str());
142 printf(
"Illegal keypoint: %d\n", nKeyPoint);
150 iposition[nKeyPoint].getValue(x, y, z);
159 printf(
"Could not retrieve position of keypath %s!\n", keypoint[nKeyPoint].c_str());
177 Math3d::SetRotationMat(tempmat, alpha, beta, gamma);
178 Math3d::GetAxisAndAngle(tempmat, axis,
angle);
179 if (Math3d::Length(axis) == 0)
184 vec.setValue(axis.x, axis.y, axis.z);
204 temp.setValue(pos.x, pos.y, pos.z);
205 hand_pos->translation.setValue(temp);
213 temp.setValue(pos.x, pos.y, pos.z);
223 Math3d::SetRotationMat(tempmat, alpha, beta, gamma);
224 Math3d::GetAxisAndAngle(tempmat, axis,
angle);
225 if (Math3d::Length(axis) == 0)
230 vec.setValue(axis.x, axis.y, axis.z);
253 temp.setValue(pos.x, pos.y, pos.z);