SimpleEpisodicMemoryKinematicUnitConnector.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::SimpleEpisodicMemoryKinematicUnitConnector
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 
26 #include <eigen3/Eigen/Core>
27 
30 #include <RobotAPI/interface/units/KinematicUnitInterface.h>
31 
33 
34 namespace armarx
35 {
37  virtual public armarx::Component,
38  virtual public KinematicUnitListener,
40  {
41  public:
42  std::string getDefaultName() const override;
43 
45 
46  void reportControlModeChanged(const NameControlModeMap&, Ice::Long, bool, const Ice::Current&);
47  void reportJointAngles(const NameValueMap&, Ice::Long, bool, const Ice::Current&);
48  void reportJointVelocities(const NameValueMap&, Ice::Long, bool, const Ice::Current&);
49  void reportJointTorques(const NameValueMap&, Ice::Long, bool, const Ice::Current&);
50  void reportJointAccelerations(const NameValueMap&, Ice::Long, bool, const Ice::Current&);
51  void reportJointCurrents(const NameValueMap&, Ice::Long, bool, const Ice::Current&);
52  void reportJointMotorTemperatures(const NameValueMap&, Ice::Long, bool, const Ice::Current&);
53  void reportJointStatuses(const NameStatusMap&, Ice::Long, bool, const Ice::Current&);
54 
55  private:
56  void checkAndSendToMemory();
57 
58  protected:
59 
60  /// @see armarx::ManagedIceObject::onInitComponent()
61  void onInitComponent() override;
62 
63  /// @see armarx::ManagedIceObject::onConnectComponent()
64  void onConnectComponent() override;
65 
66  /// @see armarx::ManagedIceObject::onDisconnectComponent()
67  void onDisconnectComponent() override;
68 
69  /// @see armarx::ManagedIceObject::onExitComponent()
70  void onExitComponent() override;
71 
72  /// @see PropertyUser::createPropertyDefinitions()
74 
75 
76  private:
77  int frequency;
79  bool updated;
80  double timestampLastUpdateInMs;
81  std::mutex updatedMutex;
82  std::map<std::string, float> jointAngleMap;
83  std::mutex jointAngle_mutex;
84  std::map<std::string, float> jointVelocityMap;
85  std::mutex jointVelocity_mutex;
86  std::map<std::string, float> jointTorqueMap;
87  std::mutex jointTorque_mutex;
88  std::map<std::string, float> jointAccelerationMap;
89  std::mutex jointAcceleration_mutex;
90  std::map<std::string, float> jointCurrentMap;
91  std::mutex jointCurrent_mutex;
92  std::map<std::string, float> jointTemperatureMap;
93  std::mutex jointTemperature_mutex;
94  std::map<std::string, bool> jointEnabledMap;
95  std::mutex jointEnabled_mutex;
96 
97  };
98 }
armarx::SimpleEpisodicMemoryKinematicUnitConnector::reportJointVelocities
void reportJointVelocities(const NameValueMap &, Ice::Long, bool, const Ice::Current &)
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:157
armarx::SimpleEpisodicMemoryKinematicUnitConnector::onDisconnectComponent
void onDisconnectComponent() override
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:66
armarx::SimpleEpisodicMemoryKinematicUnitConnector::onInitComponent
void onInitComponent() override
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:51
PeriodicTask.h
armarx::SimpleEpisodicMemoryKinematicUnitConnector::SimpleEpisodicMemoryKinematicUnitConnector
SimpleEpisodicMemoryKinematicUnitConnector()
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:42
armarx::SimpleEpisodicMemoryKinematicUnitConnector::reportJointStatuses
void reportJointStatuses(const NameStatusMap &, Ice::Long, bool, const Ice::Current &)
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:232
armarx::SimpleEpisodicMemoryKinematicUnitConnector::reportJointAngles
void reportJointAngles(const NameValueMap &, Ice::Long, bool, const Ice::Current &)
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:142
armarx::SimpleEpisodicMemoryKinematicUnitConnector::reportControlModeChanged
void reportControlModeChanged(const NameControlModeMap &, Ice::Long, bool, const Ice::Current &)
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:138
armarx::SimpleEpisodicMemoryKinematicUnitConnector::reportJointTorques
void reportJointTorques(const NameValueMap &, Ice::Long, bool, const Ice::Current &)
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:172
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
armarx::SimpleEpisodicMemoryKinematicUnitConnector::reportJointAccelerations
void reportJointAccelerations(const NameValueMap &, Ice::Long, bool, const Ice::Current &)
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:187
memoryx::SimpleEpisodicMemoryConnector
Definition: SimpleEpisodicMemoryConnector.h:35
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::SimpleEpisodicMemoryKinematicUnitConnector
Definition: SimpleEpisodicMemoryKinematicUnitConnector.h:36
armarx::control::njoint_controller::platform::platform_follower_controller::NameValueMap
std::map< std::string, float > NameValueMap
Definition: PlatformFollowerController.h:91
armarx::SimpleEpisodicMemoryKinematicUnitConnector::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:28
armarx::SimpleEpisodicMemoryKinematicUnitConnector::reportJointCurrents
void reportJointCurrents(const NameValueMap &, Ice::Long, bool, const Ice::Current &)
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:202
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::SimpleEpisodicMemoryKinematicUnitConnector::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:37
armarx::SimpleEpisodicMemoryKinematicUnitConnector::onConnectComponent
void onConnectComponent() override
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:57
armarx::SimpleEpisodicMemoryKinematicUnitConnector::reportJointMotorTemperatures
void reportJointMotorTemperatures(const NameValueMap &, Ice::Long, bool, const Ice::Current &)
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:217
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
SimpleEpisodicMemoryConnector.h
armarx::SimpleEpisodicMemoryKinematicUnitConnector::onExitComponent
void onExitComponent() override
Definition: SimpleEpisodicMemoryKinematicUnitConnector.cpp:72