RobotControl.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 Robot::
17 * @author Mirko Waechter( mirko.waechter at kit dot edu)
18 * @date 2012
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
27 #include <ArmarXCore/interface/operations/RobotControlIceBase.h>
28 
29 namespace armarx
30 {
31  // ****************************************************************
32  // Component and context
33  // ****************************************************************
34 
36  {
39  {
40 
41  defineOptionalProperty<std::string>("XMLStatechartProfile", "", "Name of the statechart profile to be used. This is used as prefix to the proxyName. So GraspGroupRemoteStateOfferer will be Armar3aGraspGroupRemoteStateOfferer");
42  defineOptionalProperty<std::string>("proxyName", "", "name of the proxy to load");
43  defineOptionalProperty<std::string>("stateName", "", "name of the state to load");
44  }
45  };
46 
47 
48 
60  virtual public RemoteStateOfferer<StatechartContext>,
61  virtual public RobotControlIceBase
62  {
63  public:
68  // inherited from RemoteStateOfferer
69  std::string getStateOffererName() const override
70  {
71  return "RobotControl";
72  }
73 
74  void onInitRemoteStateOfferer() override;
75  void onConnectRemoteStateOfferer() override;
76  void onExitRemoteStateOfferer() override;
77  void startRobotStatechart();
78 
79  void hardReset(const Ice::Current& = Ice::emptyCurrent) override;
80 
81  PropertyDefinitionsPtr createPropertyDefinitions() override;
82 
83  private:
84  void createStaticInstance();
86  int stateId;
87  };
88 
89  DEFINEEVENT(EvRobotFailure)
90  DEFINEEVENT(EvStopRobot)
91  DEFINEEVENT(EvStartRobot)
92  DEFINEEVENT(EvLoadingFailed)
110  {
111  void defineState() override;
112  void defineSubstates() override;
113  };
114 
115 
116  DEFINEEVENT(EvInit)
117  DEFINEEVENT(EvInitialized)
118  DEFINEEVENT(EvLoadScenario)
119  DEFINEEVENT(EvStartScenario)
120  DEFINEEVENT(EvInitFailed)
147  {
148  void onEnter() override;
149  void defineSubstates() override;
150  };
151 
156  StateTemplate<RobotPreInitialized>
157  {
159  void onEnter() override;
160  };
161 }
162 
armarx::RobotPreInitialized
Robot is in the state preinitialized.
Definition: RobotControl.h:155
armarx::RobotControlContextProperties::RobotControlContextProperties
RobotControlContextProperties(std::string prefix)
Definition: RobotControl.h:37
armarx::RobotPreInitialized::RobotPreInitialized
RobotPreInitialized()
Definition: RobotControl.cpp:166
armarx::StateTemplate
Definition: State.h:39
armarx::RobotControl::robotFunctionalState
StateBasePtr robotFunctionalState
Refernce to the currently active Functionsl state.
Definition: RobotControl.h:67
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
Statechart.h
IceInternal::Handle< StateBase >
armarx::RobotControl
RobotControl is used for dynamically loading and starting robot programs.
Definition: RobotControl.h:59
armarx::RemoteStateOfferer
Class that holds states, which offer functionality for other states over Ice.
Definition: RemoteStateOfferer.h:182
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::Statechart_Robot
Statechart which describes the most basic states of a robot:
Definition: RobotControl.h:108
armarx::RobotControlContextProperties
Definition: RobotControl.h:35
armarx::RobotPreInitialized::onEnter
void onEnter() override
Definition: RobotControl.cpp:170
IceUtil::Handle
Definition: forward_declarations.h:29
armarx::DEFINEEVENT
DEFINEEVENT(EvInit) struct StateRun
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::RobotControl::getStateOffererName
std::string getStateOffererName() const override
Implement this function to specify the RemoteStateOfferer prefix.
Definition: RobotControl.h:69
armarx::StatechartContextPropertyDefinitions
The StatechartContextPropertyDefinitions class contains properties associated with all statecharts.
Definition: StatechartContext.h:58
armarx::StateRobotControl
Statechart which describes the operational states of a robot program.
Definition: RobotControl.h:145
ImportExportComponent.h