Skip to content
Snippets Groups Projects
Commit 63c1cda4 authored by Markus Grotz's avatar Markus Grotz
Browse files

add NavigateTo statechart

parent b2ebb9c6
No related branches found
No related tags found
No related merge requests found
/*
* This file is part of ArmarX.
*
* ArmarX is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 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 navigation::NavigationGroup
* @author Markus Grotz ( Markus Grotz <markus dot grotz at kit dot edu> )
* @date 2022
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include "NavigateTo.h"
//#include <ArmarXCore/core/time/TimeUtil.h>
//#include <ArmarXCore/observers/variant/DatafieldRef.h>
namespace armarx::NavigationGroup
{
// DO NOT EDIT NEXT LINE
NavigateTo::SubClassRegistry NavigateTo::Registry(NavigateTo::GetName(), &NavigateTo::CreateInstance);
void NavigateTo::onEnter()
{
// put your user code for the enter-point here
// execution time should be short (<100ms)
}
//void NavigateTo::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
//
// // get a private kinematic instance for this state of the robot (tick "Robot State Component" proxy checkbox in statechart group)
// VirtualRobot::RobotPtr robot = getLocalRobot();
//
//// uncomment this if you need a continous run function. Make sure to use sleep or use blocking wait to reduce cpu load.
// while (!isRunningTaskStopped()) // stop run function if returning true
// {
// // do your calculations
// // synchronize robot clone to most recent state
// RemoteRobot::synchronizeLocalClone(robot, getRobotStateComponent());
// }
//}
//void NavigateTo::onBreak()
//{
// // put your user code for the breaking point here
// // execution time should be short (<100ms)
//}
void NavigateTo::onExit()
{
// put your user code for the exit point here
// execution time should be short (<100ms)
}
// DO NOT EDIT NEXT FUNCTION
XMLStateFactoryBasePtr NavigateTo::CreateInstance(XMLStateConstructorParams stateData)
{
return XMLStateFactoryBasePtr(new NavigateTo(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 General Public License version 2 as
* published by the Free Software Foundation.
*
* 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 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 navigation::NavigationGroup
* @author Markus Grotz ( Markus Grotz <markus dot grotz at kit dot edu> )
* @date 2022
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
#include <navigation/statecharts/NavigationGroup/NavigateTo.generated.h>
namespace armarx::NavigationGroup
{
class NavigateTo :
public NavigateToGeneratedBase < NavigateTo >
{
public:
NavigateTo(const XMLStateConstructorParams& stateData):
XMLStateTemplate < NavigateTo > (stateData), NavigateToGeneratedBase < NavigateTo > (stateData)
{
}
// inherited from StateBase
void onEnter() override;
// void run() override;
// void onBreak() override;
void onExit() override;
// static functions for AbstractFactory Method
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
};
}
<?xml version="1.0" encoding="utf-8"?>
<State version="1.2" name="NavigateTo" uuid="BCF0FD77-35EE-4916-ADC1-4C7D05B502EB" width="800" height="600" type="Normal State">
<InputParameters>
<Parameter name="target" type="::armarx::Vector3Base" docType="Vector3" optional="no"/>
</InputParameters>
<OutputParameters/>
<LocalParameters/>
<Substates>
<EndState name="Failure" event="Failure" left="444.08" top="209.3" boundingSquareSize="100"/>
<EndState name="Success" event="Success" left="119.21" top="140" boundingSquareSize="100"/>
</Substates>
<Events>
<Event name="Failure">
<Description>Event for statechart-internal failures or optionally user-code failures</Description>
</Event>
</Events>
<StartState substateName="Success">
<ParameterMappings/>
<SupportPoints/>
</StartState>
<Transitions/>
</State>
......@@ -5,6 +5,7 @@
<Proxy value="armarx_navigation::client.navigator"/>
</Proxies>
<State filename="NavigateBetweenLocations.xml" visibility="public"/>
<State filename="NavigateTo.xml" visibility="public"/>
<State filename="NavigateToLocation.xml" visibility="public"/>
</StatechartGroup>
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