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
29
30#include <RobotAPI/interface/units/PlatformUnitInterface.h>
31
33
34namespace 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 /// @see armarx::ManagedIceObject::onInitComponent()
56 void onInitComponent() override;
57
58 /// @see armarx::ManagedIceObject::onConnectComponent()
59 void onConnectComponent() override;
60
61 /// @see armarx::ManagedIceObject::onDisconnectComponent()
62 void onDisconnectComponent() override;
63
64 /// @see armarx::ManagedIceObject::onExitComponent()
65 void onExitComponent() override;
66
67 /// @see PropertyUser::createPropertyDefinitions()
69
70 private:
71 void checkAndSendToMemory();
72
73 private:
74 int frequency;
76 bool updated_pose;
77 double timestampLastUpdateInMs_pose;
78 std::mutex updatedMutex_pose;
79
80 bool updated_target;
81 double timestampLastUpdateInMs_target;
82 std::mutex updatedMutex_target;
83
84
85 float x;
86 float y;
87 float rot;
88 std::mutex platformPose_mutex;
89
90 float goal_x;
91 float goal_y;
92 float goal_rot;
93 std::mutex platformTarget_mutex;
94
95 float acc_x;
96 float acc_y;
97 float acc_rot;
98 std::mutex platformAcceleration_mutex;
99 };
100} // 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 reportPlatformVelocity(Ice::Float, Ice::Float, Ice::Float, const Ice::Current &)
void reportPlatformOdometryPose(Ice::Float, Ice::Float, Ice::Float, const Ice::Current &)
void reportNewTargetPose(Ice::Float, Ice::Float, Ice::Float, const Ice::Current &)
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.