PlanMotionBase.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 RobotSkillTemplates::MotionPlanningGroup
17  * @author Raphael Grimm ( raphael dot grimm 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 
25 #include <mutex>
26 #include <RobotSkillTemplates/statecharts/MotionPlanningGroup/PlanMotionBase.generated.h>
28 
30 {
32  public PlanMotionBaseGeneratedBase < PlanMotionBase >
33  {
34  public:
36  XMLStateTemplate < PlanMotionBase > (stateData), PlanMotionBaseGeneratedBase < PlanMotionBase > (stateData)
37  {
38  }
39 
41  IceUtil::Shared(other),
42  StateIceBase(other),
43  StateBase(other),
44  StateController(other),
45  State(other),
46  XMLState(other),
48  PlanMotionBaseGeneratedBase < PlanMotionBase >(other)
49  {
50  //no need to copy the handle or mutex
51  }
52 
53  // inherited from StateBase
54  void onEnter() override
55  {
56  resetTask();
57  }
58  void run() override;
59  void onBreak() override
60  {
61  resetTask();
62  }
63  void onExit() override
64  {
65  resetTask();
66  }
67 
68  void resetTask();
69 
70  // static functions for AbstractFactory Method
72  static SubClassRegistry Registry;
73 
74  // DO NOT INSERT ANY CLASS MEMBERS,
75  // use stateparameters instead,
76  // if classmember are neccessary nonetheless, reset them in onEnter
78  std::mutex taskMutex;
79  };
80 }
81 
82 
armarx::StateController
Definition: StateController.h:55
Task.h
armarx::MotionPlanningGroup
Definition: ExecuteMotion.h:27
armarx::XMLStateConstructorParams
Definition: XMLState.h:50
IceUtil
Definition: Instance.h:21
armarx::MotionPlanningGroup::PlanMotionBase
Definition: PlanMotionBase.h:31
armarx::MotionPlanningGroup::PlanMotionBase::Registry
static SubClassRegistry Registry
Definition: PlanMotionBase.h:72
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::XMLStateTemplate
Class for legacy to stay compatible with old statecharts.
Definition: XMLState.h:137
armarx::MotionPlanningGroup::PlanMotionBase::run
void run() override
Definition: PlanMotionBase.cpp:36
armarx::MotionPlanningGroup::PlanMotionBase::CreateInstance
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData)
Definition: PlanMotionBase.cpp:204
armarx::XMLState
Definition: XMLState.h:96
armarx::State
Definition: State.h:54
armarx::MotionPlanningGroup::PlanMotionBase::taskMutex
std::mutex taskMutex
Definition: PlanMotionBase.h:78
armarx::StateBase
Definition: StateBase.h:61
armarx::MotionPlanningGroup::PlanMotionBase::PlanMotionBase
PlanMotionBase(const XMLStateConstructorParams &stateData)
Definition: PlanMotionBase.h:35
armarx::MotionPlanningGroup::PlanMotionBase::PlanMotionBase
PlanMotionBase(const PlanMotionBase &other)
Definition: PlanMotionBase.h:40
armarx::MotionPlanningGroup::PlanMotionBase::onEnter
void onEnter() override
Definition: PlanMotionBase.h:54
armarx::MotionPlanningGroup::PlanMotionBase::resetTask
void resetTask()
Definition: PlanMotionBase.cpp:193
armarx::RemoteHandle< MotionPlanningMultiPathWithCostTaskControlInterfacePrx >
armarx::MotionPlanningGroup::PlanMotionBase::task
RandomShortcutPostprocessorTaskHandle task
Definition: PlanMotionBase.h:77
armarx::MotionPlanningGroup::PlanMotionBase::onExit
void onExit() override
Definition: PlanMotionBase.h:63
armarx::MotionPlanningGroup::PlanMotionBase::onBreak
void onBreak() override
Definition: PlanMotionBase.h:59