AbstractMotionModel.h
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* ArmarX is free software; you can redistribute it and/or modify
5* it under the terms of the GNU General Public License version 2 as
6* published by the Free Software Foundation.
7*
8* ArmarX is distributed in the hope that it will be useful, but
9* WITHOUT ANY WARRANTY; without even the implied warranty of
10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11* GNU General Public License for more details.
12*
13* You should have received a copy of the GNU General Public License
14* along with this program. If not, see <http://www.gnu.org/licenses/>.
15*
16* @package MemoryX::AbstractMotionModel
17* @author David Schiebener ( Schiebener at kit dot edu)
18* @date 2013
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23
24#pragma once
25
26
27#include <mutex>
28
30
32
34#include <MemoryX/interface/workingmemory/MotionModel.h>
35
36namespace memoryx
37{
38
39 class AbstractMotionModel : virtual public MotionModelInterface
40 {
41 public:
49
51
52
53 armarx::LinkedPoseBasePtr
54 getPredictedPose(const Ice::Current& = Ice::emptyCurrent) override;
55
56
57 MultivariateNormalDistributionBasePtr
58 getUncertainty(const Ice::Current& = Ice::emptyCurrent) override;
59
60
62 const armarx::LinkedPoseBasePtr& poseAtLastLocalization,
63 const armarx::PoseBasePtr& globalRobotPoseAtLastLocalization,
64 const MultivariateNormalDistributionBasePtr& uncertaintyAtLastLocalization,
65 const Ice::Current& = Ice::emptyCurrent) override;
66
67
68 armarx::LinkedPoseBasePtr
69 getPoseAtLastLocalisation(const Ice::Current& = Ice::emptyCurrent) override;
70
71
73 const Ice::Current& = Ice::emptyCurrent) override;
74
75
76 armarx::LinkedPoseBasePtr getPredictedPoseAtStartOfCurrentLocalization(
77 const Ice::Current& = Ice::emptyCurrent) override;
78
79
80 MultivariateNormalDistributionBasePtr getUncertaintyAtStartOfCurrentLocalization(
81 const Ice::Current& = Ice::emptyCurrent) override;
82
83
84 // implement this method in your motion model!
86
87 virtual std::string getMotionModelName();
88
89
90 // returns the enum value of the motion model for a model name given as a string (e.g. coming from the PriorKnowledgeEditor)
91 static EMotionModelType getMotionModelTypeByName(std::string motionModelName);
92
93
94 protected:
95 // implement these two methods in your motion model!
97 virtual MultivariateNormalDistributionBasePtr getUncertaintyInternal() = 0;
98
99
100 std::recursive_mutex motionPredictionLock;
101
102
103 // for the object factory
105 template <class BaseClass, class VariantClass>
106 friend class GenericFactory;
107 };
108
110} // namespace memoryx
armarx::LinkedPoseBasePtr getPredictedPoseAtStartOfCurrentLocalization(const Ice::Current &=Ice::emptyCurrent) override
std::recursive_mutex motionPredictionLock
armarx::LinkedPoseBasePtr getPredictedPose(const Ice::Current &=Ice::emptyCurrent) override
MultivariateNormalDistributionBasePtr getUncertainty(const Ice::Current &=Ice::emptyCurrent) override
armarx::LinkedPoseBasePtr getPoseAtLastLocalisation(const Ice::Current &=Ice::emptyCurrent) override
virtual std::string getMotionModelName()
virtual armarx::LinkedPosePtr getPredictedPoseInternal()=0
MultivariateNormalDistributionBasePtr getUncertaintyAtStartOfCurrentLocalization(const Ice::Current &=Ice::emptyCurrent) override
virtual MultivariateNormalDistributionBasePtr getUncertaintyInternal()=0
void savePredictedPoseAtStartOfCurrentLocalization(const Ice::Current &=Ice::emptyCurrent) override
virtual EMotionModelType getMotionModelType()=0
AbstractMotionModel(armarx::RobotStateComponentInterfacePrx robotStateProxy)
static EMotionModelType getMotionModelTypeByName(std::string motionModelName)
void setPoseAtLastLocalisation(const armarx::LinkedPoseBasePtr &poseAtLastLocalization, const armarx::PoseBasePtr &globalRobotPoseAtLastLocalization, const MultivariateNormalDistributionBasePtr &uncertaintyAtLastLocalization, const Ice::Current &=Ice::emptyCurrent) override
IceInternal::Handle< LinkedPose > LinkedPosePtr
Definition LinkedPose.h:52
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx
VirtualRobot headers.
IceInternal::Handle< AbstractMotionModel > AbstractMotionModelPtr