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 
36 namespace memoryx
37 {
38 
39  class AbstractMotionModel : virtual public MotionModelInterface
40  {
41  public:
43  {
48  };
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
LinkedPose.h
memoryx::AbstractMotionModel::getPredictedPoseInternal
virtual armarx::LinkedPosePtr getPredictedPoseInternal()=0
memoryx::AbstractMotionModel::eMotionModelAttachedToOtherObject
@ eMotionModelAttachedToOtherObject
Definition: AbstractMotionModel.h:46
memoryx::AbstractMotionModel::savePredictedPoseAtStartOfCurrentLocalization
void savePredictedPoseAtStartOfCurrentLocalization(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:63
memoryx::AbstractMotionModel::GenericFactory
friend class GenericFactory
Definition: AbstractMotionModel.h:106
memoryx::AbstractMotionModel::getMotionModelType
virtual EMotionModelType getMotionModelType()=0
memoryx::AbstractMotionModel::AbstractMotionModel
AbstractMotionModel()
Definition: AbstractMotionModel.cpp:130
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
memoryx::AbstractMotionModel::getPredictedPose
armarx::LinkedPoseBasePtr getPredictedPose(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:22
memoryx::AbstractMotionModel::getUncertaintyInternal
virtual MultivariateNormalDistributionBasePtr getUncertaintyInternal()=0
memoryx::AbstractMotionModel::getUncertainty
MultivariateNormalDistributionBasePtr getUncertainty(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:31
memoryx::AbstractMotionModel::getMotionModelTypeByName
static EMotionModelType getMotionModelTypeByName(std::string motionModelName)
Definition: AbstractMotionModel.cpp:91
IceInternal::Handle
Definition: forward_declarations.h:8
TimestampVariant.h
memoryx::AbstractMotionModel
Definition: AbstractMotionModel.h:39
memoryx::AbstractMotionModel::eMotionModelRobotHand
@ eMotionModelRobotHand
Definition: AbstractMotionModel.h:45
memoryx::AbstractMotionModel::eMotionModelKBM
@ eMotionModelKBM
Definition: AbstractMotionModel.h:47
memoryx::AbstractMotionModel::getMotionModelName
virtual std::string getMotionModelName()
Definition: AbstractMotionModel.cpp:85
memoryx::AbstractMotionModel::getUncertaintyAtStartOfCurrentLocalization
MultivariateNormalDistributionBasePtr getUncertaintyAtStartOfCurrentLocalization(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:79
memoryx::AbstractMotionModel::setPoseAtLastLocalisation
void setPoseAtLastLocalisation(const armarx::LinkedPoseBasePtr &poseAtLastLocalization, const armarx::PoseBasePtr &globalRobotPoseAtLastLocalization, const MultivariateNormalDistributionBasePtr &uncertaintyAtLastLocalization, const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:40
memoryx::AbstractMotionModel::getPredictedPoseAtStartOfCurrentLocalization
armarx::LinkedPoseBasePtr getPredictedPoseAtStartOfCurrentLocalization(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:73
memoryx::AbstractMotionModel::motionPredictionLock
std::recursive_mutex motionPredictionLock
Definition: AbstractMotionModel.h:100
ProbabilityMeasures.h
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
memoryx::AbstractMotionModel::eMotionModelStaticObject
@ eMotionModelStaticObject
Definition: AbstractMotionModel.h:44
memoryx::AbstractMotionModel::getPoseAtLastLocalisation
armarx::LinkedPoseBasePtr getPoseAtLastLocalisation(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:122
memoryx::AbstractMotionModel::EMotionModelType
EMotionModelType
Definition: AbstractMotionModel.h:42