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 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;
127 IceUtil::Time lastUpdateTime;
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;
137 void reportPlatformVelocity(Ice::Float x,
138 Ice::Float y,
139 Ice::Float alpha,
140 const Ice::Current&) override;
141 void reportPlatformOdometryPose(Ice::Float x,
142 Ice::Float y,
143 Ice::Float alpha,
144 const Ice::Current&) override;
145 };
146} // 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
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.