Skip to content
Snippets Groups Projects
Commit 9ce639b0 authored by Manfred Kröhnert's avatar Manfred Kröhnert
Browse files

add empty StopRobot state

parent 8d7e8bf6
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ set(SOURCES
MotionControlGroupRemoteStateOfferer.cpp
./MoveJoints.cpp
testing/testMoveJoints.cpp
./StopRobot.cpp
#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.cpp
)
......@@ -27,6 +28,7 @@ set(HEADERS
MotionControlGroupRemoteStateOfferer.h
./MoveJoints.h
testing/testMoveJoints.h
./StopRobot.h
#@TEMPLATE_LINE@@COMPONENT_PATH@/@COMPONENT_NAME@.h
)
......
......@@ -4,5 +4,6 @@
<State filename="testMoveJoints.xml"/>
</Folder>
<State filename="MoveJoints.xml" visibility="public"/>
<State filename="StopRobot.xml"/>
</StatechartGroup>
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package RobotAPI::MotionControlGroup
* @author Manfred Kroehnert ( Manfred dot Kroehnert at kit dot edu )
* @date 2014
* @copyright http://www.gnu.org/licenses/gpl.txt
* GNU General Public License
*/
#include "StopRobot.h"
using namespace armarx;
using namespace MotionControlGroup;
// DO NOT EDIT NEXT LINE
StopRobot::SubClassRegistry StopRobot::Registry(StopRobot::GetName(), &StopRobot::CreateInstance);
StopRobot::StopRobot(XMLStateConstructorParams stateData) :
XMLStateTemplate < StopRobot > (stateData)
{
}
void StopRobot::onEnter()
{
// put your user code for the enter-point here
// execution time should be short (<100ms)
}
void StopRobot::run()
{
// put your user code for the execution-phase here
// runs in seperate thread, thus can do complex operations
// should check constantly whether isRunningTaskStopped() returns true
while (!isRunningTaskStopped()) // stop run function if returning true
{
// do your calculations
}
}
void StopRobot::onBreak()
{
// put your user code for the breaking point here
// execution time should be short (<100ms)
}
void StopRobot::onExit()
{
// put your user code for the exit point here
// execution time should be short (<100ms)
}
// DO NOT EDIT NEXT FUNCTION
std::string StopRobot::GetName()
{
return "StopRobot";
}
// DO NOT EDIT NEXT FUNCTION
XMLStateFactoryBasePtr StopRobot::CreateInstance(XMLStateConstructorParams stateData)
{
return XMLStateFactoryBasePtr(new StopRobot(stateData));
}
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* ArmarX is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package RobotAPI::MotionControlGroup
* @author Manfred Kroehnert ( Manfred dot Kroehnert at kit dot edu )
* @date 2014
* @copyright http://www.gnu.org/licenses/gpl.txt
* GNU General Public License
*/
#ifndef _ARMARX_XMLUSERCODE_RobotAPI_MotionControlGroup_StopRobot_H
#define _ARMARX_XMLUSERCODE_RobotAPI_MotionControlGroup_StopRobot_H
#include <Core/statechart/xmlstates/XMLState.h>
namespace armarx
{
namespace MotionControlGroup
{
class StopRobot :
virtual public XMLStateTemplate < StopRobot > ,
public XMLStateFactoryBase
{
public:
StopRobot(XMLStateConstructorParams stateData);
// inherited from StateBase
void onEnter();
void run();
void onBreak();
void onExit();
// static functions for AbstractFactory Method
static std::string GetName();
static XMLStateFactoryBasePtr CreateInstance(XMLStateConstructorParams stateData);
static SubClassRegistry Registry;
// DO NOT INSERT ANY CLASS MEMBERS,
// use stateparameters instead,
// if classmember are neccessary nonetheless, reset them in onEnter
};
}
}
#endif
<?xml version="1.0" encoding="utf-8"?>
<State version="1.0" name="StopRobot" uuid="A88DB279-17A6-4776-A3C0-114B775609C9" width="800" height="600">
<InputParameters/>
<OutputParameters/>
<LocalParameters/>
<Substates/>
<Events/>
<Transitions/>
</State>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment