HumanMemory.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 RobotAPI::ArmarXObjects::ExampleMemory
17  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
18  * @date 2020
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <mutex>
26 
29 
34 
36 #include <VisionX/components/armem/server/HumanMemory/ComponentInterface.h>
37 #include <VisionX/libraries/armem_human/aron/HumanPose.aron.generated.h>
38 #include <VisionX/libraries/armem_human/server/HumanMemoryServerInterface.h>
44 
46 {
47  class HumanMemory :
48  virtual public armarx::Component,
50  virtual public ComponentInterface,
51  virtual public ArVizComponentPluginUser,
53  {
54  public:
55  HumanMemory();
56 
57  std::string getDefaultName() const override;
58 
59  protected:
61 
62  void onInitComponent() override;
63  void onConnectComponent() override;
64  void onDisconnectComponent() override;
65  void onExitComponent() override;
66 
67  const VirtualRobot::RobotPtr& getSynchronizedRobot(const std::string& robotName,
68  const armarx::DateTime& timestamp);
69 
70  void
71  commitHumanPosesInCameraFrame(const ::armarx::aron::data::dto::AronDictSeq& dictSeq,
72  const ::std::string& providerName,
73  const ::armarx::core::time::dto::DateTime& timestamp,
74  const ::Ice::Current& /*c*/ = ::Ice::emptyCurrent) override;
75 
76  void commitHumanPoses(const std::vector<::armarx::human::arondto::HumanPose>& humanPoses,
77  const std::string& providerName,
78  const armarx::DateTime& timestamp);
79 
80  private:
81  human::ProfileSegment profileSegment;
82  human::PersonInstanceSegment personInstanceSegment;
83  human::PoseSegment poseSegment;
84  human::FaceRecognitionSegment faceRecognitionSegment;
85  human::IdentificationSegment identificationSegment;
86 
87  human::Visu visu;
88 
90  virtualRobotReaderPlugin = nullptr;
91 
92  std::mutex robotsMtx;
93  std::map<std::string, VirtualRobot::RobotPtr> robots;
94  };
95 
96 } // namespace armarx::armem::server::human_memory
ArVizComponentPlugin.h
armarx::armem::server::human::profile::Segment
Definition: Segment.h:32
armarx::armem::client::plugins::ReaderWriterPlugin
A component plugin offering client-side access to a reader or writer and manages the lifecycle,...
Definition: ReaderWriterPlugin.h:44
ReadWritePluginUser.h
armarx::armem::server::human_memory::HumanMemory::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: HumanMemory.cpp:75
ReaderWriterPlugin.h
armarx::armem::server::human::Visu
Definition: Visualization.h:25
armarx::armem::server::human::PoseSegment
Definition: PoseSegment.h:37
armarx::armem::server::human::IdentificationSegment
Definition: IdentificationSegment.h:32
armarx::armem::server::human_memory::ComponentInterface
Definition: ComponentInterface.ice:15
armarx::armem::server::human_memory
Definition: ComponentInterface.ice:12
armarx::armem::server::human_memory::HumanMemory::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: HumanMemory.cpp:105
armarx::ArVizComponentPluginUser
Provides a ready-to-use ArViz client arviz as member variable.
Definition: ArVizComponentPlugin.h:36
PoseSegment.h
armarx::armem::server::human_memory::HumanMemory::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: HumanMemory.cpp:47
armarx::armem::server::plugins::ReadWritePluginUser
Base class of memory server components.
Definition: ReadWritePluginUser.h:20
DebugObserverComponentPlugin.h
VirtualRobotReader.h
armarx::armem::server::human_memory::HumanMemory::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: HumanMemory.cpp:81
PersonInstanceSegment.h
armarx::armem::server::human_memory::HumanMemory::getSynchronizedRobot
const VirtualRobot::RobotPtr & getSynchronizedRobot(const std::string &robotName, const armarx::DateTime &timestamp)
Definition: HumanMemory.cpp:110
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::armem::server::human::PersonInstanceSegment
Definition: PersonInstanceSegment.h:33
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::armem::server::human_memory::HumanMemory::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: HumanMemory.cpp:100
armarx::armem::server::human::facerecog::Segment
Definition: Segment.h:34
Segment.h
IceUtil::Handle< class PropertyDefinitionContainer >
Segment.h
armarx::DebugObserverComponentPluginUser
Definition: DebugObserverComponentPlugin.h:82
armarx::armem::server::human_memory::HumanMemory
Definition: HumanMemory.h:47
IdentificationSegment.h
armarx::armem::server::human_memory::HumanMemory::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: HumanMemory.cpp:94
Visualization.h
armarx::armem::server::human_memory::HumanMemory::HumanMemory
HumanMemory()
Definition: HumanMemory.cpp:63
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
armarx::armem::server::human_memory::HumanMemory::commitHumanPoses
void commitHumanPoses(const std::vector<::armarx::human::arondto::HumanPose > &humanPoses, const std::string &providerName, const armarx::DateTime &timestamp)
Definition: HumanMemory.cpp:246
armarx::armem::server::human_memory::HumanMemory::commitHumanPosesInCameraFrame
void commitHumanPosesInCameraFrame(const ::armarx::aron::data::dto::AronDictSeq &dictSeq, const ::std::string &providerName, const ::armarx::core::time::dto::DateTime &timestamp, const ::Ice::Current &=::Ice::emptyCurrent) override
Definition: HumanMemory.cpp:136