SimpleEpisodicMemoryPlatformUnitConnector.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 RobotComponents::ArmarXObjects::SimpleEpisodicMemoryPlatformUnitConnector
17  * @author Fabian PK ( fabian dot peller-konrad 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 <Eigen/Core>
26 
28 
29 #include <RobotAPI/interface/units/PlatformUnitInterface.h>
31 
33 
34 namespace armarx
35 {
36 
38  virtual public armarx::Component,
39  virtual public PlatformUnitListener,
41  {
42  public:
44 
45  /// @see armarx::ManagedIceObject::getDefaultName()
46  std::string getDefaultName() const override;
47 
48 
49  void reportPlatformPose(const PlatformPose&, const Ice::Current&);
50  void reportNewTargetPose(Ice::Float, Ice::Float, Ice::Float, const Ice::Current&);
51  void reportPlatformVelocity(Ice::Float, Ice::Float, Ice::Float, const Ice::Current&);
52  void reportPlatformOdometryPose(Ice::Float, Ice::Float, Ice::Float, const Ice::Current&);
53 
54  protected:
55 
56  /// @see armarx::ManagedIceObject::onInitComponent()
57  void onInitComponent() override;
58 
59  /// @see armarx::ManagedIceObject::onConnectComponent()
60  void onConnectComponent() override;
61 
62  /// @see armarx::ManagedIceObject::onDisconnectComponent()
63  void onDisconnectComponent() override;
64 
65  /// @see armarx::ManagedIceObject::onExitComponent()
66  void onExitComponent() override;
67 
68  /// @see PropertyUser::createPropertyDefinitions()
70 
71  private:
72  void checkAndSendToMemory();
73 
74  private:
75  int frequency;
77  bool updated_pose;
78  double timestampLastUpdateInMs_pose;
79  std::mutex updatedMutex_pose;
80 
81  bool updated_target;
82  double timestampLastUpdateInMs_target;
83  std::mutex updatedMutex_target;
84 
85 
86  float x;
87  float y;
88  float rot;
89  std::mutex platformPose_mutex;
90 
91  float goal_x;
92  float goal_y;
93  float goal_rot;
94  std::mutex platformTarget_mutex;
95 
96  float acc_x;
97  float acc_y;
98  float acc_rot;
99  std::mutex platformAcceleration_mutex;
100 
101  };
102 }
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:918
PeriodicTask.h
armarx::SimpleEpisodicMemoryPlatformUnitConnector::onInitComponent
void onInitComponent() override
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:54
armarx::SimpleEpisodicMemoryPlatformUnitConnector::reportPlatformVelocity
void reportPlatformVelocity(Ice::Float, Ice::Float, Ice::Float, const Ice::Current &)
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:151
armarx::SimpleEpisodicMemoryPlatformUnitConnector::onDisconnectComponent
void onDisconnectComponent() override
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:69
armarx::SimpleEpisodicMemoryPlatformUnitConnector::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:29
armarx::SimpleEpisodicMemoryPlatformUnitConnector::reportNewTargetPose
void reportNewTargetPose(Ice::Float, Ice::Float, Ice::Float, const Ice::Current &)
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:139
armarx::SimpleEpisodicMemoryPlatformUnitConnector::SimpleEpisodicMemoryPlatformUnitConnector
SimpleEpisodicMemoryPlatformUnitConnector()
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:43
armarx::SimpleEpisodicMemoryPlatformUnitConnector
Definition: SimpleEpisodicMemoryPlatformUnitConnector.h:37
memoryx::SimpleEpisodicMemoryConnector
Definition: SimpleEpisodicMemoryConnector.h:35
armarx::SimpleEpisodicMemoryPlatformUnitConnector::onConnectComponent
void onConnectComponent() override
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:60
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::SimpleEpisodicMemoryPlatformUnitConnector::reportPlatformOdometryPose
void reportPlatformOdometryPose(Ice::Float, Ice::Float, Ice::Float, const Ice::Current &)
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:163
armarx::SimpleEpisodicMemoryPlatformUnitConnector::getDefaultName
std::string getDefaultName() const override
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:38
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::SimpleEpisodicMemoryPlatformUnitConnector::reportPlatformPose
void reportPlatformPose(const PlatformPose &, const Ice::Current &)
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:127
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
SimpleEpisodicMemoryConnector.h
armarx::SimpleEpisodicMemoryPlatformUnitConnector::onExitComponent
void onExitComponent() override
Definition: SimpleEpisodicMemoryPlatformUnitConnector.cpp:75