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
37namespace 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");
53 "WorkingMemoryName", "WorkingMemory", "Name of the WorkingMemory");
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 static std::string GetDefaultName();
85
86 protected:
87 /**
88 * @see armarx::ManagedIceObject::onInitComponent()
89 */
90 void onInitComponent() override;
91
92 /**
93 * @see armarx::ManagedIceObject::onConnectComponent()
94 */
95 void onConnectComponent() override;
96
97 /**
98 * @see armarx::ManagedIceObject::onDisconnectComponent()
99 */
100 void onDisconnectComponent() override;
101
102 /**
103 * @see armarx::ManagedIceObject::onExitComponent()
104 */
105 void onExitComponent() override;
106
107 /**
108 * @see PropertyUser::createPropertyDefinitions()
109 */
111
112 protected:
113 void reportRobotPose();
114
116
117 memoryx::WorkingMemoryInterfacePrx memoryPrx;
118 memoryx::AgentInstancesSegmentBasePrx agentsMemoryPrx;
120
121 std::string robotAgentId;
122 std::string robotName;
125
126 std::mutex dataMutex;
127 std::vector<Eigen::Vector4d> poseBuffer;
128 Eigen::Vector4d currentVelocity;
129 IceUtil::Time lastUpdateTime;
130
131 PlatformUnitListenerPrx platformTopic;
132
135
136 public:
137 // void reportPlatformPose(PlatformPose const& currentPose, const Ice::Current&) override;
138 // void reportNewTargetPose(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current&) override;
139 void reportPlatformVelocity(Ice::Float x,
140 Ice::Float y,
141 Ice::Float alpha,
142 const Ice::Current&) override;
143 void reportPlatformOdometryPose(Ice::Float x,
144 Ice::Float y,
145 Ice::Float alpha,
146 const Ice::Current&) override;
147 };
148} // namespace armarx
Default component property definition container.
Definition Component.h:70
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
Brief description of class DummyAgentReporter.
memoryx::WorkingMemoryInterfacePrx memoryPrx
armarx::FramedOrientationPtr robotOri
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
void reportPlatformOdometryPose(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current &) override
memoryx::AgentInstancesSegmentBasePrx agentsMemoryPrx
std::vector< Eigen::Vector4d > poseBuffer
static std::string GetDefaultName()
memoryx::AgentInstancePtr robotAgent
armarx::FramedPositionPtr robotPos
armarx::RobotStateComponentInterfacePrx robotStateComponentPrx
void reportPlatformVelocity(Ice::Float x, Ice::Float y, Ice::Float alpha, const Ice::Current &) override
std::string getDefaultName() const override
PlatformUnitListenerPrx platformTopic
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
IceInternal::Handle< FramedPosition > FramedPositionPtr
Definition FramedPose.h:149
IceInternal::Handle< FramedOrientation > FramedOrientationPtr
Definition FramedPose.h:207
::IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx
IceInternal::Handle< AgentInstance > AgentInstancePtr
Typedef of AgentEntityPtr as IceInternal::Handle<AgentEntity> for convenience.