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 <MemoryX/interface/workingmemory/MotionModel.h>
29 
31 
33 
34 #include <mutex>
35 
36 namespace memoryx
37 {
38 
39  class AbstractMotionModel : virtual public MotionModelInterface
40  {
41  public:
43  {
48  };
49 
50 
52 
53 
54  armarx::LinkedPoseBasePtr getPredictedPose(const Ice::Current& = Ice::emptyCurrent) override;
55 
56 
57  MultivariateNormalDistributionBasePtr getUncertainty(const Ice::Current& = Ice::emptyCurrent) override;
58 
59 
60  void setPoseAtLastLocalisation(const armarx::LinkedPoseBasePtr& poseAtLastLocalization,
61  const armarx::PoseBasePtr& globalRobotPoseAtLastLocalization,
62  const MultivariateNormalDistributionBasePtr& uncertaintyAtLastLocalization,
63  const Ice::Current& = Ice::emptyCurrent) override;
64 
65 
66  armarx::LinkedPoseBasePtr getPoseAtLastLocalisation(const Ice::Current& = Ice::emptyCurrent) override;
67 
68 
69  void savePredictedPoseAtStartOfCurrentLocalization(const Ice::Current& = Ice::emptyCurrent) override;
70 
71 
72  armarx::LinkedPoseBasePtr getPredictedPoseAtStartOfCurrentLocalization(const Ice::Current& = Ice::emptyCurrent) override;
73 
74 
75  MultivariateNormalDistributionBasePtr getUncertaintyAtStartOfCurrentLocalization(const Ice::Current& = Ice::emptyCurrent) override;
76 
77 
78  // implement this method in your motion model!
80 
81  virtual std::string getMotionModelName();
82 
83 
84  // returns the enum value of the motion model for a model name given as a string (e.g. coming from the PriorKnowledgeEditor)
85  static EMotionModelType getMotionModelTypeByName(std::string motionModelName);
86 
87 
88  protected:
89 
90  // implement these two methods in your motion model!
92  virtual MultivariateNormalDistributionBasePtr getUncertaintyInternal() = 0;
93 
94 
95  std::recursive_mutex motionPredictionLock;
96 
97 
98  // for the object factory
100  template <class BaseClass, class VariantClass>
101  friend class GenericFactory;
102  };
104 }
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:61
memoryx::AbstractMotionModel::GenericFactory
friend class GenericFactory
Definition: AbstractMotionModel.h:101
memoryx::AbstractMotionModel::getMotionModelType
virtual EMotionModelType getMotionModelType()=0
memoryx::AbstractMotionModel::AbstractMotionModel
AbstractMotionModel()
Definition: AbstractMotionModel.cpp:129
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
memoryx::AbstractMotionModel::getPredictedPose
armarx::LinkedPoseBasePtr getPredictedPose(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:21
memoryx::AbstractMotionModel::getUncertaintyInternal
virtual MultivariateNormalDistributionBasePtr getUncertaintyInternal()=0
memoryx::AbstractMotionModel::getUncertainty
MultivariateNormalDistributionBasePtr getUncertainty(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:30
memoryx::AbstractMotionModel::getMotionModelTypeByName
static EMotionModelType getMotionModelTypeByName(std::string motionModelName)
Definition: AbstractMotionModel.cpp:89
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:83
memoryx::AbstractMotionModel::getUncertaintyAtStartOfCurrentLocalization
MultivariateNormalDistributionBasePtr getUncertaintyAtStartOfCurrentLocalization(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:77
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:39
memoryx::AbstractMotionModel::getPredictedPoseAtStartOfCurrentLocalization
armarx::LinkedPoseBasePtr getPredictedPoseAtStartOfCurrentLocalization(const Ice::Current &=Ice::emptyCurrent) override
Definition: AbstractMotionModel.cpp:71
memoryx::AbstractMotionModel::motionPredictionLock
std::recursive_mutex motionPredictionLock
Definition: AbstractMotionModel.h:95
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:120
memoryx::AbstractMotionModel::EMotionModelType
EMotionModelType
Definition: AbstractMotionModel.h:42