35 this->handNodeName = handNodeName;
36 syncedRobot = robotStateProxy->getSynchronizedRobot();
43 ARMARX_DEBUG_S <<
"robot name of last pose: " << poseAtLastLocalization->referenceRobot->getName();
44 ARMARX_DEBUG_S <<
"robot name of internal proxy: " << robotStateProxy->getRobotName();
46 armarx::PosePtr oldHandNodePose = armarx::PosePtr::dynamicCast(poseAtLastLocalization->referenceRobot->getRobotNode(handNodeName)->getGlobalPose());
50 armarx::PosePtr newHandNodePose = armarx::PosePtr::dynamicCast(currentRobotSnapshot->getRobotNode(handNodeName)->getGlobalPose());
52 Eigen::Matrix4f transformationOldToNewInRootFrame = newHandNodePose->toEigen() * oldHandNodePose->toEigen().inverse();
53 Eigen::Vector3f kinPosDelta = newHandNodePose->toEigen().block<3, 1>(0, 3) - oldHandNodePose->toEigen().block<3, 1>(0, 3);
55 Eigen::Matrix4f lastLocalization = armarx::LinkedPosePtr::dynamicCast(poseAtLastLocalization)->toGlobalEigen(poseAtLastLocalization->referenceRobot);
58 predictedPose.block<3, 3>(0, 0) = transformationOldToNewInRootFrame.block<3, 3>(0, 0) * lastLocalization.block<3, 3>(0, 0);
59 predictedPose.block<3, 1>(0, 3) = kinPosDelta + lastLocalization.block<3, 1>(0, 3);
61 if (poseAtLastLocalization->frame.empty())
77 if (uncertaintyAtLastLocalization)
79 armarx::PosePtr oldHandNodePose = armarx::PosePtr::dynamicCast(poseAtLastLocalization->referenceRobot->getRobotNode(handNodeName)->getPoseInRootFrame());
83 float dist = (oldHandNodePose->toEigen().block<3, 1>(0, 3) - newHandNodePose->toEigen().block<3, 1>(0, 3)).norm();
87 Eigen::Matrix3f oldUncertainty = MultivariateNormalDistributionPtr::dynamicCast(uncertaintyAtLastLocalization)->toEigenCovariance();
88 Eigen::Matrix3f newUncertainty = oldUncertainty + additionalUncertainty;
98 void MotionModelRobotHand::setPoseAtLastLocalisation(
const armarx::LinkedPoseBasePtr& poseAtLastLocalization,
const armarx::PoseBasePtr& globalRobotPoseAtLastLocalization,
const MultivariateNormalDistributionBasePtr& uncertaintyAtLastLocalization,
const Ice::Current&
c)
102 uncertaintyAtLastLocalization,
c);
103 ARMARX_DEBUG_S <<
"MotionModelRobotHand::setPoseAtLastLocalisation" << this->poseAtLastLocalization->referenceRobot->getName();
104 if (robotStateProxy->getRobotName() != this->poseAtLastLocalization->referenceRobot->getName())
106 ARMARX_DEBUG_S <<
"Setting robot state proxy from " << this->poseAtLastLocalization->agent <<
" to " <<
robotName;