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