30 using namespace HapticsGroup;
58 for (
size_t i = 0; i < jointNames->getSize(); i++)
65 NameControlModeMap controlModes;
69 if (jointNames->getSize() ==
jointAngles->getSize())
71 for (
int j = 0; j < jointNames->getSize(); j++)
73 jointNamesAndAngles[jointNames->getVariant(j)->getString()] =
jointAngles->getVariant(j)->getFloat();
74 jointNamesAndTorques[jointNames->getVariant(j)->getString()] = dataFields.
getVariant(j)->getFloat() * 1.1;
75 controlModes[jointNames->getVariant(j)->getString()] = eTorqueControl;
77 currentJointNames.
addVariant(jointNames->getVariant(j)->getString());
82 throw LocalException(
"stateCheckObjectInHand: List lengths do not match!");
89 ARMARX_LOG << eINFO <<
"Installing timeoutGrasp condition";
90 float timeOutCheckObjectInHand = getInput<float>(
"timeoOutCheckObjectInHand");
92 setLocal(
"TempJointAngles", currentJointAngles);
93 setLocal(
"TempJointNames", currentJointNames);
106 float threshhold = 0.0;
108 for (
size_t i = 0; i < jointNames->getSize(); i++)
113 float meanSquaredJointAnglesDiff = 0.0;
115 for (
int j = 0; j < jointNames->getSize(); j++)
117 float jointAngleDiff;
118 meanSquaredJointAnglesDiff += jointAngleDiff * jointAngleDiff;
121 meanSquaredJointAnglesDiff =
sqrt(meanSquaredJointAnglesDiff);
123 if (meanSquaredJointAnglesDiff < threshhold)
147 return "CheckObjectInHand";