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/core/RobotState.h>
31 #include <RobotAPI/interface/units/PlatformUnitInterface.h>
32 
33 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
34 #include <MemoryX/interface/memorytypes/MemorySegments.h>
36 
37 namespace armarx
38 {
39  /**
40  * @class DummyAgentReporterPropertyDefinitions
41  * @brief
42  */
44  {
45  public:
48  {
49  defineOptionalProperty<std::string>("RobotStateComponentName",
50  "RobotStateComponent",
51  "Name of the RobotStateComponent");
52  defineOptionalProperty<std::string>(
53  "WorkingMemoryName", "WorkingMemory", "Name of the WorkingMemory");
54  defineOptionalProperty<std::string>(
55  "PlatformStateTopicName", "PlatformState", "Name of the PlatformState topic");
56  }
57  };
58 
59  /**
60  * @defgroup Component-DummyAgentReporter DummyAgentReporter
61  * @ingroup MemoryX-Components
62  * A description of the component DummyAgentReporter.
63  *
64  * @class DummyAgentReporter
65  * @ingroup Component-DummyAgentReporter
66  * @brief Brief description of class DummyAgentReporter.
67  *
68  * Detailed description of class DummyAgentReporter.
69  */
71  virtual public armarx::Component,
72  virtual public armarx::PlatformUnitListener
73  {
74  public:
75  /**
76  * @see armarx::ManagedIceObject::getDefaultName()
77  */
78  std::string
79  getDefaultName() const override
80  {
81  return "DummyAgentReporter";
82  }
83 
84  protected:
85  /**
86  * @see armarx::ManagedIceObject::onInitComponent()
87  */
88  void onInitComponent() override;
89 
90  /**
91  * @see armarx::ManagedIceObject::onConnectComponent()
92  */
93  void onConnectComponent() override;
94 
95  /**
96  * @see armarx::ManagedIceObject::onDisconnectComponent()
97  */
98  void onDisconnectComponent() override;
99 
100  /**
101  * @see armarx::ManagedIceObject::onExitComponent()
102  */
103  void onExitComponent() override;
104 
105  /**
106  * @see PropertyUser::createPropertyDefinitions()
107  */
109 
110  protected:
111  void reportRobotPose();
112 
114 
115  memoryx::WorkingMemoryInterfacePrx memoryPrx;
116  memoryx::AgentInstancesSegmentBasePrx agentsMemoryPrx;
118 
119  std::string robotAgentId;
120  std::string robotName;
123 
124  std::mutex dataMutex;
125  std::vector<Eigen::Vector4d> poseBuffer;
126  Eigen::Vector4d currentVelocity;
128 
129  PlatformUnitListenerPrx platformTopic;
130 
133 
134  public:
135  // void reportPlatformPose(PlatformPose const& currentPose, const Ice::Current&) override;
136  // void reportNewTargetPose(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current&) override;
138  Ice::Float y,
139  Ice::Float alpha,
140  const Ice::Current&) override;
142  Ice::Float y,
143  Ice::Float alpha,
144  const Ice::Current&) override;
145  };
146 } // namespace armarx
armarx::DummyAgentReporter::reportRobotPose
void reportRobotPose()
Definition: DummyAgentReporter.cpp:169
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:919
armarx::DummyAgentReporter::robotAgent
memoryx::AgentInstancePtr robotAgent
Definition: DummyAgentReporter.h:117
armarx::DummyAgentReporter::onDisconnectComponent
void onDisconnectComponent() override
Definition: DummyAgentReporter.cpp:82
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
armarx::DummyAgentReporter
Brief description of class DummyAgentReporter.
Definition: DummyAgentReporter.h:70
armarx::DummyAgentReporterPropertyDefinitions
Definition: DummyAgentReporter.h:43
armarx::DummyAgentReporter::velocityDeltaUpdateCount
float velocityDeltaUpdateCount
Definition: DummyAgentReporter.h:132
armarx::DummyAgentReporter::dataMutex
std::mutex dataMutex
Definition: DummyAgentReporter.h:124
armarx::DummyAgentReporter::robotPos
armarx::FramedPositionPtr robotPos
Definition: DummyAgentReporter.h:121
armarx::DummyAgentReporter::onExitComponent
void onExitComponent() override
Definition: DummyAgentReporter.cpp:87
IceInternal::Handle< AgentInstance >
armarx::DummyAgentReporter::onInitComponent
void onInitComponent() override
Definition: DummyAgentReporter.cpp:37
armarx::DummyAgentReporter::velocityDeltaSum
float velocityDeltaSum
Definition: DummyAgentReporter.h:131
armarx::DummyAgentReporter::getDefaultName
std::string getDefaultName() const override
Definition: DummyAgentReporter.h:79
armarx::DummyAgentReporter::currentVelocity
Eigen::Vector4d currentVelocity
Definition: DummyAgentReporter.h:126
armarx::DummyAgentReporter::reportPlatformVelocity
void reportPlatformVelocity(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current &) override
Definition: DummyAgentReporter.cpp:148
armarx::DummyAgentReporterPropertyDefinitions::DummyAgentReporterPropertyDefinitions
DummyAgentReporterPropertyDefinitions(std::string prefix)
Definition: DummyAgentReporter.h:46
armarx::DummyAgentReporter::poseBuffer
std::vector< Eigen::Vector4d > poseBuffer
Definition: DummyAgentReporter.h:125
armarx::DummyAgentReporter::onConnectComponent
void onConnectComponent() override
Definition: DummyAgentReporter.cpp:49
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:91
armarx::DummyAgentReporter::robotStateComponentPrx
armarx::RobotStateComponentInterfacePrx robotStateComponentPrx
Definition: DummyAgentReporter.h:113
armarx::DummyAgentReporter::robotAgentId
std::string robotAgentId
Definition: DummyAgentReporter.h:119
armarx::DummyAgentReporter::agentsMemoryPrx
memoryx::AgentInstancesSegmentBasePrx agentsMemoryPrx
Definition: DummyAgentReporter.h:116
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
armarx::DummyAgentReporter::memoryPrx
memoryx::WorkingMemoryInterfacePrx memoryPrx
Definition: DummyAgentReporter.h:115
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
AgentInstance.h
armarx::DummyAgentReporter::robotName
std::string robotName
Definition: DummyAgentReporter.h:120
armarx::DummyAgentReporter::lastUpdateTime
IceUtil::Time lastUpdateTime
Definition: DummyAgentReporter.h:127
armarx::DummyAgentReporter::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: DummyAgentReporter.cpp:92
armarx::DummyAgentReporter::robotOri
armarx::FramedOrientationPtr robotOri
Definition: DummyAgentReporter.h:122
armarx::DummyAgentReporter::reportPlatformOdometryPose
void reportPlatformOdometryPose(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current &) override
Definition: DummyAgentReporter.cpp:205
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::DummyAgentReporter::platformTopic
PlatformUnitListenerPrx platformTopic
Definition: DummyAgentReporter.h:129