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