DummyAgentReporter.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package MemoryX::ArmarXObjects::DummyAgentReporter
19  * @author Peter Kaiser ( peter dot kaiser at kit dot edu )
20  * @date 2015
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 
29 
30 #include <RobotAPI/interface/units/PlatformUnitInterface.h>
31 #include <RobotAPI/interface/core/RobotState.h>
32 
33 #include <MemoryX/interface/memorytypes/MemorySegments.h>
34 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
36 
37 namespace armarx
38 {
39  /**
40  * @class DummyAgentReporterPropertyDefinitions
41  * @brief
42  */
45  {
46  public:
49  {
50  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the RobotStateComponent");
51  defineOptionalProperty<std::string>("WorkingMemoryName", "WorkingMemory", "Name of the WorkingMemory");
52  defineOptionalProperty<std::string>("PlatformStateTopicName", "PlatformState", "Name of the PlatformState topic");
53  }
54  };
55 
56  /**
57  * @defgroup Component-DummyAgentReporter DummyAgentReporter
58  * @ingroup MemoryX-Components
59  * A description of the component DummyAgentReporter.
60  *
61  * @class DummyAgentReporter
62  * @ingroup Component-DummyAgentReporter
63  * @brief Brief description of class DummyAgentReporter.
64  *
65  * Detailed description of class DummyAgentReporter.
66  */
68  virtual public armarx::Component,
69  virtual public armarx::PlatformUnitListener
70  {
71  public:
72  /**
73  * @see armarx::ManagedIceObject::getDefaultName()
74  */
75  std::string getDefaultName() const override
76  {
77  return "DummyAgentReporter";
78  }
79 
80  protected:
81  /**
82  * @see armarx::ManagedIceObject::onInitComponent()
83  */
84  void onInitComponent() override;
85 
86  /**
87  * @see armarx::ManagedIceObject::onConnectComponent()
88  */
89  void onConnectComponent() override;
90 
91  /**
92  * @see armarx::ManagedIceObject::onDisconnectComponent()
93  */
94  void onDisconnectComponent() override;
95 
96  /**
97  * @see armarx::ManagedIceObject::onExitComponent()
98  */
99  void onExitComponent() override;
100 
101  /**
102  * @see PropertyUser::createPropertyDefinitions()
103  */
105 
106  protected:
107  void reportRobotPose();
108 
110 
111  memoryx::WorkingMemoryInterfacePrx memoryPrx;
112  memoryx::AgentInstancesSegmentBasePrx agentsMemoryPrx;
114 
115  std::string robotAgentId;
116  std::string robotName;
119 
120  std::mutex dataMutex;
121  std::vector<Eigen::Vector4d> poseBuffer;
122  Eigen::Vector4d currentVelocity;
124 
125  PlatformUnitListenerPrx platformTopic;
126 
129 
130  public:
131  // void reportPlatformPose(PlatformPose const& currentPose, const Ice::Current&) override;
132  // void reportNewTargetPose(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current&) override;
133  void reportPlatformVelocity(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current&) override;
134  void reportPlatformOdometryPose(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current&) override;
135  };
136 }
armarx::DummyAgentReporter::reportRobotPose
void reportRobotPose()
Definition: DummyAgentReporter.cpp:153
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:918
armarx::DummyAgentReporter::robotAgent
memoryx::AgentInstancePtr robotAgent
Definition: DummyAgentReporter.h:113
armarx::DummyAgentReporter::onDisconnectComponent
void onDisconnectComponent() override
Definition: DummyAgentReporter.cpp:75
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::DummyAgentReporter
Brief description of class DummyAgentReporter.
Definition: DummyAgentReporter.h:67
armarx::DummyAgentReporterPropertyDefinitions
Definition: DummyAgentReporter.h:43
armarx::DummyAgentReporter::velocityDeltaUpdateCount
float velocityDeltaUpdateCount
Definition: DummyAgentReporter.h:128
armarx::DummyAgentReporter::dataMutex
std::mutex dataMutex
Definition: DummyAgentReporter.h:120
armarx::DummyAgentReporter::robotPos
armarx::FramedPositionPtr robotPos
Definition: DummyAgentReporter.h:117
armarx::DummyAgentReporter::onExitComponent
void onExitComponent() override
Definition: DummyAgentReporter.cpp:79
IceInternal::Handle< AgentInstance >
armarx::DummyAgentReporter::onInitComponent
void onInitComponent() override
Definition: DummyAgentReporter.cpp:35
armarx::DummyAgentReporter::velocityDeltaSum
float velocityDeltaSum
Definition: DummyAgentReporter.h:127
armarx::DummyAgentReporter::getDefaultName
std::string getDefaultName() const override
Definition: DummyAgentReporter.h:75
armarx::DummyAgentReporter::currentVelocity
Eigen::Vector4d currentVelocity
Definition: DummyAgentReporter.h:122
armarx::DummyAgentReporter::reportPlatformVelocity
void reportPlatformVelocity(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current &) override
Definition: DummyAgentReporter.cpp:137
armarx::DummyAgentReporterPropertyDefinitions::DummyAgentReporterPropertyDefinitions
DummyAgentReporterPropertyDefinitions(std::string prefix)
Definition: DummyAgentReporter.h:47
armarx::DummyAgentReporter::poseBuffer
std::vector< Eigen::Vector4d > poseBuffer
Definition: DummyAgentReporter.h:121
armarx::DummyAgentReporter::onConnectComponent
void onConnectComponent() override
Definition: DummyAgentReporter.cpp:46
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::DummyAgentReporter::robotStateComponentPrx
armarx::RobotStateComponentInterfacePrx robotStateComponentPrx
Definition: DummyAgentReporter.h:109
armarx::DummyAgentReporter::robotAgentId
std::string robotAgentId
Definition: DummyAgentReporter.h:115
armarx::DummyAgentReporter::agentsMemoryPrx
memoryx::AgentInstancesSegmentBasePrx agentsMemoryPrx
Definition: DummyAgentReporter.h:112
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
armarx::DummyAgentReporter::memoryPrx
memoryx::WorkingMemoryInterfacePrx memoryPrx
Definition: DummyAgentReporter.h:111
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
AgentInstance.h
armarx::DummyAgentReporter::robotName
std::string robotName
Definition: DummyAgentReporter.h:116
armarx::DummyAgentReporter::lastUpdateTime
IceUtil::Time lastUpdateTime
Definition: DummyAgentReporter.h:123
armarx::DummyAgentReporter::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: DummyAgentReporter.cpp:83
armarx::DummyAgentReporter::robotOri
armarx::FramedOrientationPtr robotOri
Definition: DummyAgentReporter.h:118
armarx::DummyAgentReporter::reportPlatformOdometryPose
void reportPlatformOdometryPose(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current &) override
Definition: DummyAgentReporter.cpp:189
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::DummyAgentReporter::platformTopic
PlatformUnitListenerPrx platformTopic
Definition: DummyAgentReporter.h:125