ObjectInstanceMemorySegment.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::WorkingMemory
17 * @author Kai Welke ( welke at kit dot edu)
18 * @date 2012
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
26 
27 #include <MemoryX/interface/core/EntityBase.h>
28 #include <MemoryX/interface/memorytypes/MemoryEntities.h>
29 #include <MemoryX/interface/memorytypes/MemorySegments.h>
34 
35 namespace memoryx
36 {
37  /*!
38  The ObjectInstanceMemorySegment is a specialization of the WorkingMemoryEntitySegment template.
39  \see WorkingMemoryEntitySegment
40  */
42  virtual public WorkingMemoryEntitySegment<ObjectInstance>,
43  virtual public ObjectInstanceMemorySegmentBase
44  {
45  public:
46  ObjectInstanceMemorySegment(float matchThreshold, bool matchByClass);
47 
48 
49  ObjectInstanceBasePtr
50  getObjectInstanceById(const ::std::string& id,
51  const ::Ice::Current& = Ice::emptyCurrent) const override;
52 
53 
54  ObjectInstanceBasePtr
55  getObjectInstanceByName(const ::std::string& name,
56  const ::Ice::Current& = Ice::emptyCurrent) const override;
57 
58 
59  ObjectInstanceList
60  getObjectInstancesByClass(const ::std::string& className,
61  const ::Ice::Current& c = Ice::emptyCurrent) const override;
62 
63 
64  ObjectInstanceList
65  getObjectInstancesByClassList(const NameList& classList,
66  const ::Ice::Current& = Ice::emptyCurrent) const override;
67 
68 
69  ObjectInstanceBasePtr
70  getCorrespondingObjectInstance(const ObjectInstanceBasePtr& objectInstance,
71  const ::Ice::Current& = Ice::emptyCurrent) const override;
72 
73 
74  void setNewMotionModel(const ::std::string& entityId,
75  const ::memoryx::MotionModelInterfacePtr& newMotionModel,
76  const ::Ice::Current& = Ice::emptyCurrent) override;
77 
78 
79  void setObjectPose(const std::string& entityId,
80  const armarx::LinkedPoseBasePtr& objectPose,
81  const ::Ice::Current& = Ice::emptyCurrent) override;
82  void setObjectPoseWithoutMotionModel(const std::string& entityId,
83  const armarx::FramedPoseBasePtr& objectPose,
84  const ::Ice::Current& = Ice::emptyCurrent) override;
85 
86 
87  std::string addObjectInstance(const std::string& instanceName,
88  const std::string& className,
89  const armarx::LinkedPoseBasePtr& objectPose,
90  const ::memoryx::MotionModelInterfacePtr& motionModel,
91  const ::Ice::Current& = Ice::emptyCurrent) override;
92 
93 
94  void updateEntity(const std::string& entityId,
95  const EntityBasePtr& update,
96  const ::Ice::Current& = Ice::emptyCurrent) override;
97 
98  void
99  updateEntityInternal(const std::string& entityId,
100  const EntityBasePtr& update,
101  const ::Ice::Current& c = Ice::emptyCurrent)
102  {
104  }
105 
106  void
107  updateEntityInternal(const std::string& entityId,
108  const EntityBasePtr& update,
109  const Ice::StringSeq& deactivatedFusionMethods)
110  {
111  WorkingMemoryEntitySegment::updateEntity(entityId, update, deactivatedFusionMethods);
112  }
113 
114 
115  private:
116  double matchThreshold;
117  bool matchByClass;
118  };
119 
121 
122 } // namespace memoryx
memoryx::WorkingMemoryEntitySegment::updateEntity
void updateEntity(const std::string &entityId, const EntityBasePtr &update, const ::Ice::Current &c=Ice::emptyCurrent) override
Definition: WorkingMemoryEntitySegment.h:256
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
ObjectClass.h
MotionModelObjectFactories.h
IceInternal::Handle< ObjectInstanceMemorySegment >
memoryx::WorkingMemoryEntitySegment
Definition: WorkingMemoryEntitySegment.h:45
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
memoryx::ObjectInstanceMemorySegment::updateEntityInternal
void updateEntityInternal(const std::string &entityId, const EntityBasePtr &update, const Ice::StringSeq &deactivatedFusionMethods)
Definition: ObjectInstanceMemorySegment.h:107
WorkingMemoryEntitySegment.h
armarx::armem::server::ltm::util::mongodb::detail::update
bool update(mongocxx::collection &coll, const nlohmann::json &query, const nlohmann::json &update)
Definition: mongodb.cpp:68
ObjectInstance.h
memoryx::ObjectInstanceMemorySegment::updateEntityInternal
void updateEntityInternal(const std::string &entityId, const EntityBasePtr &update, const ::Ice::Current &c=Ice::emptyCurrent)
Definition: ObjectInstanceMemorySegment.h:99
memoryx::ObjectInstanceMemorySegment
Definition: ObjectInstanceMemorySegment.h:41
ImportExportComponent.h