Skip to content
Snippets Groups Projects
Commit 29d7e1f9 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add statechart group

parent c567ca6f
No related branches found
No related tags found
1 merge request!69Add DebugDrawerToArViz
......@@ -11,4 +11,5 @@ add_subdirectory(ForceTorqueUtility)
add_subdirectory(RobotNameHelperTestGroup)
add_subdirectory(StatechartExecutionGroup)
add_subdirectory(ProsthesisKinestheticTeachIn)
\ No newline at end of file
add_subdirectory(ProsthesisKinestheticTeachIn)
add_subdirectory(DebugDrawerToArVizGroup)
armarx_component_set_name("DebugDrawerToArVizGroup")
#find_package(Simox QUIET)
#armarx_build_if(Simox_FOUND "Simox-VirtualRobot not available")
set(COMPONENT_LIBS
# VirtualRobot
)
# Sources
set(SOURCES
DebugDrawerToArVizGroupRemoteStateOfferer.cpp
)
set(HEADERS
DebugDrawerToArVizGroupRemoteStateOfferer.h
DebugDrawerToArVizGroup.scgxml
)
# adds all existing state headers and sources to CMake
armarx_generate_statechart_cmake_lists()
armarx_add_component("${SOURCES}" "${HEADERS}")
#find_package(MyLib QUIET)
#armarx_build_if(MyLib_FOUND "MyLib not available")
# all target_include_directories must be guarded by if(Xyz_FOUND)
# for multiple libraries write: if(X_FOUND AND Y_FOUND)....
#if(MyLib_FOUND)
# target_include_directories(DebugDrawerToArVizGroup PUBLIC ${MyLib_INCLUDE_DIRS})
#endif()
<?xml version="1.0" encoding="utf-8"?>
<StatechartGroup name="DebugDrawerToArVizGroup" package="RobotAPI" generateContext="true">
<Proxies>
<Proxy value="RobotAPIInterfaces.debugDrawerToArVizLayerBlackWhitelist"/>
</Proxies>
<Configurations/>
<State filename="UpateLayerBlackWhitelist.xml" visibility="public"/>
</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 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 RobotAPI::DebugDrawerToArVizGroup::DebugDrawerToArVizGroupRemoteStateOfferer
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2020
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include "DebugDrawerToArVizGroupRemoteStateOfferer.h"
namespace armarx::DebugDrawerToArVizGroup
{
// DO NOT EDIT NEXT LINE
DebugDrawerToArVizGroupRemoteStateOfferer::SubClassRegistry DebugDrawerToArVizGroupRemoteStateOfferer::Registry(DebugDrawerToArVizGroupRemoteStateOfferer::GetName(), &DebugDrawerToArVizGroupRemoteStateOfferer::CreateInstance);
DebugDrawerToArVizGroupRemoteStateOfferer::DebugDrawerToArVizGroupRemoteStateOfferer(StatechartGroupXmlReaderPtr reader) :
XMLRemoteStateOfferer < DebugDrawerToArVizGroupStatechartContext > (reader)
{}
void DebugDrawerToArVizGroupRemoteStateOfferer::onInitXMLRemoteStateOfferer() {}
void DebugDrawerToArVizGroupRemoteStateOfferer::onConnectXMLRemoteStateOfferer() {}
void DebugDrawerToArVizGroupRemoteStateOfferer::onExitXMLRemoteStateOfferer() {}
// DO NOT EDIT NEXT FUNCTION
std::string DebugDrawerToArVizGroupRemoteStateOfferer::GetName()
{
return "DebugDrawerToArVizGroupRemoteStateOfferer";
}
// DO NOT EDIT NEXT FUNCTION
XMLStateOffererFactoryBasePtr DebugDrawerToArVizGroupRemoteStateOfferer::CreateInstance(StatechartGroupXmlReaderPtr reader)
{
return XMLStateOffererFactoryBasePtr(new DebugDrawerToArVizGroupRemoteStateOfferer(reader));
}
}
/*
* 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 RobotAPI::DebugDrawerToArVizGroup
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2020
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
#include <ArmarXCore/statechart/xmlstates/XMLRemoteStateOfferer.h>
#include "DebugDrawerToArVizGroupStatechartContext.generated.h"
namespace armarx::DebugDrawerToArVizGroup
{
class DebugDrawerToArVizGroupRemoteStateOfferer :
virtual public XMLRemoteStateOfferer < DebugDrawerToArVizGroupStatechartContext > // Change this statechart context if you need another context (dont forget to change in the constructor as well)
{
public:
DebugDrawerToArVizGroupRemoteStateOfferer(StatechartGroupXmlReaderPtr reader);
// inherited from RemoteStateOfferer
void onInitXMLRemoteStateOfferer() override;
void onConnectXMLRemoteStateOfferer() override;
void onExitXMLRemoteStateOfferer() override;
// static functions for AbstractFactory Method
static std::string GetName();
static XMLStateOffererFactoryBasePtr CreateInstance(StatechartGroupXmlReaderPtr reader);
static SubClassRegistry Registry;
};
}
/*
* 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 RobotAPI::DebugDrawerToArVizGroup
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2020
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#include "UpateLayerBlackWhitelist.h"
//#include <ArmarXCore/core/time/TimeUtil.h>
//#include <ArmarXCore/observers/variant/DatafieldRef.h>
namespace armarx::DebugDrawerToArVizGroup
{
// DO NOT EDIT NEXT LINE
UpateLayerBlackWhitelist::SubClassRegistry UpateLayerBlackWhitelist::Registry(UpateLayerBlackWhitelist::GetName(), &UpateLayerBlackWhitelist::CreateInstance);
void UpateLayerBlackWhitelist::onEnter()
{
// put your user code for the enter-point here
// execution time should be short (<100ms)
armarx::BlackWhitelistUpdate update;
update.blacklist.clear = in.getClearBlacklist();
update.blacklist.add = in.getAddToBlacklist();
update.blacklist.set = in.getSetBlacklist();
update.whitelist.clear = in.getClearWhitelist();
update.whitelist.add = in.getAddToWhitelist();
update.whitelist.set = in.getSetWhitelist();
getDebugDrawerToArVizLayerBlackWhitelist()->updateBlackWhiteList(update);
emitSuccess();
}
//void UpateLayerBlackWhitelist::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 UpateLayerBlackWhitelist::onBreak()
//{
// // put your user code for the breaking point here
// // execution time should be short (<100ms)
//}
void UpateLayerBlackWhitelist::onExit()
{
// put your user code for the exit point here
// execution time should be short (<100ms)
}
// DO NOT EDIT NEXT FUNCTION
XMLStateFactoryBasePtr UpateLayerBlackWhitelist::CreateInstance(XMLStateConstructorParams stateData)
{
return XMLStateFactoryBasePtr(new UpateLayerBlackWhitelist(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 RobotAPI::DebugDrawerToArVizGroup
* @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
* @date 2020
* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
* GNU General Public License
*/
#pragma once
#include <RobotAPI/statecharts/DebugDrawerToArVizGroup/UpateLayerBlackWhitelist.generated.h>
namespace armarx::DebugDrawerToArVizGroup
{
class UpateLayerBlackWhitelist :
public UpateLayerBlackWhitelistGeneratedBase < UpateLayerBlackWhitelist >
{
public:
UpateLayerBlackWhitelist(const XMLStateConstructorParams& stateData):
XMLStateTemplate < UpateLayerBlackWhitelist > (stateData), UpateLayerBlackWhitelistGeneratedBase < UpateLayerBlackWhitelist > (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="UpateLayerBlackWhitelist" uuid="E175EAE8-47AD-40B8-8BFB-7BB10F4D38FE" width="800" height="600" type="Normal State">
<InputParameters>
<Parameter name="AddToBlacklist" type="::armarx::SingleTypeVariantListBase(::armarx::StringVariantData)" docType="List(string)" optional="no">
<DefaultValue value='{"array":[],"type":"::armarx::SingleTypeVariantListBase"}' docValue=""/>
</Parameter>
<Parameter name="AddToWhitelist" type="::armarx::SingleTypeVariantListBase(::armarx::StringVariantData)" docType="List(string)" optional="no">
<DefaultValue value='{"array":[],"type":"::armarx::SingleTypeVariantListBase"}' docValue=""/>
</Parameter>
<Parameter name="ClearBlacklist" type="::armarx::BoolVariantData" docType="bool" optional="no">
<DefaultValue value='{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::BoolVariantData","value":false}}' docValue="False"/>
</Parameter>
<Parameter name="ClearWhitelist" type="::armarx::BoolVariantData" docType="bool" optional="no">
<DefaultValue value='{"type":"::armarx::SingleVariantBase","variant":{"typeName":"::armarx::BoolVariantData","value":false}}' docValue="False"/>
</Parameter>
<Parameter name="SetBlacklist" type="::armarx::SingleTypeVariantListBase(::armarx::StringVariantData)" docType="List(string)" optional="no">
<DefaultValue value='{"array":[],"type":"::armarx::SingleTypeVariantListBase"}' docValue=""/>
</Parameter>
<Parameter name="SetWhitelist" type="::armarx::SingleTypeVariantListBase(::armarx::StringVariantData)" docType="List(string)" optional="no">
<DefaultValue value='{"array":[],"type":"::armarx::SingleTypeVariantListBase"}' docValue=""/>
</Parameter>
</InputParameters>
<OutputParameters/>
<LocalParameters/>
<Substates/>
<Events>
<Event name="Failure">
<Description>Event for statechart-internal failures or optionally user-code failures</Description>
</Event>
<Event name="Success"/>
</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