40 robotStateProxy->getRobotSnapshot(
"MotionModelBodySchemaPrediction");
41 armarx::SharedRobotNodeInterfacePrx handNode =
48 std::string parentName = handNode->getParent();
50 while (!parentName.empty())
52 armarx::SharedRobotNodeInterfacePrx node =
53 currentRobotSnapshot->getRobotNode(parentName);
55 if (node->getType() == armarx::eRevolute)
57 this->parentNodeNames.push_back(parentName);
60 parentName = node->getParent();
63 this->model.reset(
new KBM(parentNodeNames.size(), 16, 3.14 / 4.0));
77 poseAtLastLocalization->referenceRobot->getRobotNode(
handNodeName)->getGlobalPose());
79 poseAtLastLocalization->referenceRobot->getRobotNode(poseAtLastLocalization->frame)
83 robotStateProxy->getRobotSnapshot(
"MotionModelBodySchemaPrediction");
87 unsigned int index = 0;
90 proprioception(
index) = currentRobotSnapshot->getRobotNode(nodeName)->getJointValue();
94 Eigen::VectorXf predictionXf = this->
model->predict(proprioception);
95 Eigen::Matrix4f prediction = Eigen::Matrix4f::Map(predictionXf.data());
98 prediction, currentRobotSnapshot->getRootNode()->getName(), currentRobotSnapshot);
104 const armarx::LinkedPoseBasePtr& poseAtLastLocalization,
105 const armarx::PoseBasePtr& globalRobotPoseAtLastLocalization,
106 const Ice::Current&
c)
111 this->poseAtLastLocalization = poseAtLastLocalization;
112 this->globalRobotPoseAtLastLocalization = globalRobotPoseAtLastLocalization;
114 Eigen::Matrix4f mat =
115 armarx::LinkedPosePtr::dynamicCast(this->poseAtLastLocalization)->toEigen();
118 Eigen::VectorXf shape = Eigen::VectorXf::Map(mat.data(), mat.rows() * mat.cols());
120 armarx::SharedRobotNodeInterfacePrx handNode =
121 poseAtLastLocalization->referenceRobot->getRobotNode(
handNodeName);
125 unsigned int index = 0;
128 proprioception(
index) =
129 poseAtLastLocalization->referenceRobot->getRobotNode(nodeName)->getJointValue();
133 this->
model->online(proprioception, shape);
virtual MultivariateNormalDistributionBasePtr getUncertaintyInternal()
std::shared_ptr< memoryx::KBM > model
virtual armarx::LinkedPosePtr GetPredictedPoseInternal()
armarx::NameList parentNodeNames
LongtermMemoryInterfacePrx longtermMemory
virtual void SetPoseAtLastLocalisation(const armarx::LinkedPoseBasePtr &poseAtLastLocalization, const armarx::PoseBasePtr &globalRobotPoseAtLastLocalization, const Ice::Current &c=Ice::emptyCurrent)
MotionModelBodySchema(armarx::RobotStateComponentInterfacePrx robotStateProxy, std::string handNodeName, LongtermMemoryInterfacePrx longtermMemory)