KinematicSelfLocalization.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 ArmarXSimulation::ArmarXObjects::KinematicSelfLocalization
17 * @author Mirko Waechter ( mirko dot waechter at kit dot edu )
18 * @date 2016
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
27
28#include <RobotAPI/interface/core/RobotLocalization.h>
29#include <RobotAPI/interface/core/RobotState.h>
30
31// MemoryX
33#include <MemoryX/interface/components/WorkingMemoryInterface.h>
35
36// Simulator
37#include <mutex>
38
39#include <VirtualRobot/VirtualRobot.h>
40
41#include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
42
43namespace armarx
44{
45 /**
46 * @class KinematicSelfLocalizationPropertyDefinitions
47 * @brief
48 */
50 {
51 public:
54 {
56 "PlatformTopicName", "PlatformState", "Name of the platform report topic");
58 "RobotName",
59 "Name of the robot in the simulator (as specified in the robot's xml file)");
61 "AgentName", "Name of the agent instance. If empty, RobotName property is used");
63 "RobotStateComponentName",
64 "RobotStateComponent",
65 "Name of the RobotStateComponent that should be used");
66 defineOptionalProperty<std::string>("WorkingMemoryName",
67 "WorkingMemory",
68 "Name of the WorkingMemory that should be used");
70 "RobotPoseZ", 0, "Set the z component of the robot pose to a fixed value");
72 "InitialPlatformPoseX", 0, "Set the x component of the initial platform pose");
74 "InitialPlatformPoseY", 0, "Set the y component of the initial platform pose");
75 defineOptionalProperty<float>("InitialPlatformPoseAngle",
76 0,
77 "Set the angle component of the initial platform pose");
78 }
79 };
80
81 /**
82 * @defgroup Component-KinematicSelfLocalization KinematicSelfLocalization
83 * @ingroup ArmarXSimulation-Components
84 * A description of the component KinematicSelfLocalization.
85 *
86 * @class KinematicSelfLocalization
87 * @ingroup Component-KinematicSelfLocalization
88 * @brief Brief description of class KinematicSelfLocalization.
89 *
90 * Detailed description of class KinematicSelfLocalization.
91 */
93 virtual public armarx::Component,
94 public GlobalRobotPoseLocalizationListener
95 {
96 public:
97 /**
98 * @see armarx::ManagedIceObject::getDefaultName()
99 */
100 std::string
101 getDefaultName() const override
102 {
103 return "KinematicSelfLocalization";
104 }
105
106 protected:
107 /**
108 * @see armarx::ManagedIceObject::onInitComponent()
109 */
110 void onInitComponent() override;
111
112 /**
113 * @see armarx::ManagedIceObject::onConnectComponent()
114 */
115 void onConnectComponent() override;
116
117 /**
118 * @see armarx::ManagedIceObject::onDisconnectComponent()
119 */
120 void onDisconnectComponent() override;
121
122 /**
123 * @see armarx::ManagedIceObject::onExitComponent()
124 */
125 void onExitComponent() override;
126
127 /**
128 * @see PropertyUser::createPropertyDefinitions()
129 */
131
132 protected:
134
135 void reportRobotPose();
137
141
142 memoryx::WorkingMemoryInterfacePrx memoryPrx;
143 memoryx::AgentInstancesSegmentBasePrx agentsMemoryPrx;
145
146 std::string robotAgentId;
147 std::string robotName;
148
149 std::mutex dataMutex;
150
152
153 public:
154 void reportGlobalRobotPose(const ::armarx::TransformStamped&,
155 const ::Ice::Current& = ::Ice::emptyCurrent) override;
156 };
157} // 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 KinematicSelfLocalization.
memoryx::WorkingMemoryInterfacePrx memoryPrx
void reportGlobalRobotPose(const ::armarx::TransformStamped &, const ::Ice::Current &=::Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
memoryx::AgentInstancesSegmentBasePrx agentsMemoryPrx
PeriodicTask< KinematicSelfLocalization >::pointer_type execTask
RobotStateComponentInterfacePrx robotStateComponentPrx
std::string getDefaultName() const override
IceUtil::Handle< PeriodicTask< T > > pointer_type
Shared pointer type for convenience.
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)
PropertyDefinition< PropertyType > & defineRequiredProperty(const std::string &name, 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::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface > RobotStateComponentInterfacePrx
IceInternal::Handle< FramedPose > FramedPosePtr
Definition FramedPose.h:272
IceInternal::Handle< AgentInstance > AgentInstancePtr
Typedef of AgentEntityPtr as IceInternal::Handle<AgentEntity> for convenience.