BringObjectGroupStatechartContext.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2014-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 RobotSkillTemplates::BringObjectGroup
19  * @author Mirko Waechter ( mirko dot waechter 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 
26 #pragma once
27 
31 
32 
33 // Custom Includes
34 //#include <RobotAPI/interface/units/KinematicUnitInterface.h>
35 //#include <RobotAPI/interface/units/TCPControlUnit.h>
36 //#include <RobotAPI/interface/observers/KinematicUnitObserverInterface.h>
37 #include <RobotAPI/interface/core/FramedPoseBase.h>
38 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
39 #include <VirtualRobot/VirtualRobot.h>
40 
41 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
42 #include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
43 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
44 //#include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
46 
47 #include <RobotComponents/interface/components/PathPlanner.h>
48 #include <RobotAPI/interface/components/ViewSelectionInterface.h>
49 
50 
52 {
53 
55  {
58  {
59  // defineRequiredProperty<std::string>("KinematicUnitName", "Name of the kinematic unit that should be used");
60  // defineRequiredProperty<std::string>("KinematicUnitObserverName", "Name of the kinematic unit observer that should be used");
61  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the robot state component that should be used");
62  // defineOptionalProperty<std::string>("TCPControlUnitName", "TCPControlUnit", "Name of the tcp control unit component that should be used");
63 
64  defineOptionalProperty<std::string>("WorkingMemoryName", "WorkingMemory", "Name of the WorkingMemory component that should be used");
65  defineOptionalProperty<std::string>("ObjectMemoryObserverName", "ObjectMemoryObserver", "Name of the ObjectMemoryObserver component that should be used");
66  defineOptionalProperty<std::string>("PriorKnowledgeName", "PriorKnowledge", "Name of the PriorKnowledge component that should be used");
67  defineOptionalProperty<std::string>("PathPlannerName", "PathPlanner", "Name of the Path Planner component that should be used");
68  defineOptionalProperty<std::string>("ViewSelectionName", "ViewSelection", "Name of the ViewSelection component that should be used");
69 
70  }
71  };
72 
73  /**
74  * @class BringObjectGroupStatechartContext is a custom implementation of the StatechartContext
75  * for a statechart
76  */
78  virtual public XMLStatechartContext
79  {
80  public:
81  // inherited from Component
82  std::string getDefaultName() const override
83  {
84  return "BringObjectGroupStatechartContext";
85  }
86  void onInitStatechartContext() override;
87  void onConnectStatechartContext() override;
88 
89  memoryx::WorkingMemoryInterfacePrx getWorkingMemoryProxy()
90  {
91  return workingMemoryProxy;
92  }
93  memoryx::ObjectMemoryObserverInterfacePrx getObjectMemoryObserverProxy()
94  {
95  return objectMemoryObserverProxy;
96  }
97  memoryx::PriorKnowledgeInterfacePrx getPriorKnowledgeProxy()
98  {
99  return priorKnowledgeProxy;
100  }
101 
103  {
104  return debugDrawerTopicProxy;
105  }
107  {
108  return remoteRobot;
109  }
111  {
112  return robotStateComponent;
113  }
114  // KinematicUnitInterfacePrx getKinematicUnit() { return kinematicUnitPrx; }
115  // std::string getKinematicUnitObserverName() { return getProperty<std::string>("KinematicUnitObserverName").getValue(); }
116  // TCPControlUnitInterfacePrx getTCPControlUnit() { return tcpControlPrx;}
117  //SimulatorInterfacePrx getSimulatorProxy() { return simulatorPrx; }
118  PathPlannerBasePrx getPathPlanner() const
119  {
120  return pathPlannerPrx;
121  }
122  ViewSelectionInterfacePrx getViewSelection() const
123  {
124  return viewSelection;
125  }
126  private:
127 
128 
129  /**
130  * @see PropertyUser::createPropertyDefinitions()
131  */
132  PropertyDefinitionsPtr createPropertyDefinitions() override;
133 
134 
135  RobotStateComponentInterfacePrx robotStateComponent;
136  // KinematicUnitInterfacePrx kinematicUnitPrx;
137  // KinematicUnitObserverInterfacePrx kinematicUnitObserverPrx;
138  // TCPControlUnitInterfacePrx tcpControlPrx;
139  VirtualRobot::RobotPtr remoteRobot;
140 
141  memoryx::WorkingMemoryInterfacePrx workingMemoryProxy;
142  memoryx::ObjectMemoryObserverInterfacePrx objectMemoryObserverProxy;
143  memoryx::PriorKnowledgeInterfacePrx priorKnowledgeProxy;
144 
145  armarx::DebugDrawerInterfacePrx debugDrawerTopicProxy;
146  //SimulatorInterfacePrx simulatorPrx;
147  PathPlannerBasePrx pathPlannerPrx;
148  ViewSelectionInterfacePrx viewSelection;
149  };
150 
151 }
152 
153 
armarx::XMLStatechartContext
Definition: StatechartContext.h:196
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
StatechartContext.h
armarx::BringObjectGroup
Definition: BringObjectGroupRemoteStateOfferer.h:30
armarx::BringObjectGroup::BringObjectGroupStatechartContext
Definition: BringObjectGroupStatechartContext.h:77
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getObjectMemoryObserverProxy
memoryx::ObjectMemoryObserverInterfacePrx getObjectMemoryObserverProxy()
Definition: BringObjectGroupStatechartContext.h:93
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getPathPlanner
PathPlannerBasePrx getPathPlanner() const
Definition: BringObjectGroupStatechartContext.h:118
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: BringObjectGroupStatechartContext.h:82
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getWorkingMemoryProxy
memoryx::WorkingMemoryInterfacePrx getWorkingMemoryProxy()
Definition: BringObjectGroupStatechartContext.h:89
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getPriorKnowledgeProxy
memoryx::PriorKnowledgeInterfacePrx getPriorKnowledgeProxy()
Definition: BringObjectGroupStatechartContext.h:97
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getRobotStateComponent
RobotStateComponentInterfacePrx getRobotStateComponent()
Definition: BringObjectGroupStatechartContext.h:110
Component.h
armarx::BringObjectGroup::BringObjectGroupStatechartContextProperties::BringObjectGroupStatechartContextProperties
BringObjectGroupStatechartContextProperties(std::string prefix)
Definition: BringObjectGroupStatechartContext.h:56
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getRobot
const VirtualRobot::RobotPtr getRobot()
Definition: BringObjectGroupStatechartContext.h:106
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getViewSelection
ViewSelectionInterfacePrx getViewSelection() const
Definition: BringObjectGroupStatechartContext.h:122
MemoryXUpdaterObjectFactories.h
armarx::BringObjectGroup::BringObjectGroupStatechartContext::getDebugDrawerTopicProxy
armarx::DebugDrawerInterfacePrx getDebugDrawerTopicProxy()
Definition: BringObjectGroupStatechartContext.h:102
armarx::StatechartContextPropertyDefinitions
The StatechartContextPropertyDefinitions class contains properties associated with all statecharts.
Definition: StatechartContext.h:58
armarx::BringObjectGroup::BringObjectGroupStatechartContextProperties
Definition: BringObjectGroupStatechartContext.h:54
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
ImportExportComponent.h