diff --git a/ComponentRosBaseFake/.classpath b/ComponentRosBaseFake/.classpath
new file mode 100644
index 00000000..6d6fc9aa
--- /dev/null
+++ b/ComponentRosBaseFake/.classpath
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/ComponentRosBaseFake/.cproject b/ComponentRosBaseFake/.cproject
new file mode 100644
index 00000000..d28f9605
--- /dev/null
+++ b/ComponentRosBaseFake/.cproject
@@ -0,0 +1,133 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ComponentRosBaseFake/.project b/ComponentRosBaseFake/.project
new file mode 100644
index 00000000..0b2f4afa
--- /dev/null
+++ b/ComponentRosBaseFake/.project
@@ -0,0 +1,43 @@
+
+
+ ComponentRosBaseFake
+
+
+ CommBasicObjects
+ CommNavigationObjects
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.jdt.core.javabuilder
+
+
+
+
+ org.eclipse.xtext.ui.shared.xtextBuilder
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.sirius.nature.modelingproject
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+ org.smartmdsd.utils.natures.ComponentNature
+ org.eclipse.xtext.ui.shared.xtextNature
+ org.eclipse.jdt.core.javanature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+
+
diff --git a/ComponentRosBaseFake/ROS/src-gen/CMakeLists.txt b/ComponentRosBaseFake/ROS/src-gen/CMakeLists.txt
new file mode 100644
index 00000000..b522b818
--- /dev/null
+++ b/ComponentRosBaseFake/ROS/src-gen/CMakeLists.txt
@@ -0,0 +1,39 @@
+#--------------------------------------------------------------------------
+# This file is generated by the SeRoNet Tooling. The SeRoNet Tooling is
+# developed by the SeRoNet Project consortium:
+# http:#www.seronet-projekt.de
+#
+# The ROS Mixed-Port Component is developed by:
+# Service Robotics Research Center of Ulm University of Applied Sciences
+# Fraunhofer Institute for Manufacturing Engineering and Automation IPA
+#
+# This code-generator uses infrastructure of the SmartMDSD Toolchain on
+# which the SeRoNet Tooling is based on.
+#
+# CAUTION:
+# This software is a preview for the purpose of technology demonstration.
+# It is experimental and comes with no support. Use at your own risk.
+# Please do not modify this file. It will be re-generated
+# running the code generator.
+#--------------------------------------------------------------------------
+# %Tag(FULLTEXT)%
+cmake_minimum_required(VERSION 2.8.3)
+project(ros_componentrosbasefake)
+
+find_package(catkin REQUIRED COMPONENTS roscpp geometry_msgs)
+
+catkin_package()
+
+LIST(APPEND LOCAL_INCLUDES ${catkin_INCLUDE_DIRS})
+LIST(APPEND LOCAL_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR})
+LIST(APPEND LOCAL_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../src)
+set(ROS_INCLUDES ${LOCAL_INCLUDES} PARENT_SCOPE)
+
+LIST(APPEND SRCS ${CMAKE_CURRENT_SOURCE_DIR}/ComponentRosBaseFakeRosPortExtension.cc)
+LIST(APPEND SRCS ${CMAKE_CURRENT_SOURCE_DIR}/../src/ComponentRosBaseFakeRosPortCallbacks.cc)
+
+set(ROS_SRCS ${SRCS} PARENT_SCOPE)
+
+set(ROS_LIBS ${catkin_LIBRARIES} PARENT_SCOPE)
+
+# %EndTag(FULLTEXT)%
diff --git a/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortBaseClass.hh b/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortBaseClass.hh
new file mode 100644
index 00000000..c0a1a2bb
--- /dev/null
+++ b/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortBaseClass.hh
@@ -0,0 +1,33 @@
+//--------------------------------------------------------------------------
+// This file is generated by the SeRoNet Tooling. The SeRoNet Tooling is
+// developed by the SeRoNet Project consortium:
+// http://www.seronet-projekt.de
+//
+// The ROS Mixed-Port Component is developed by:
+// Service Robotics Research Center of Ulm University of Applied Sciences
+// Fraunhofer Institute for Manufacturing Engineering and Automation IPA
+//
+// This code-generator uses infrastructure of the SmartMDSD Toolchain on
+// which the SeRoNet Tooling is based on.
+//
+// CAUTION:
+// This software is a preview for the purpose of technology demonstration.
+// It is experimental and comes with no support. Use at your own risk.
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+
+#ifndef ROS_PORT_BASE_CLASS_H_
+#define ROS_PORT_BASE_CLASS_H_
+
+#include
+
+class ComponentRosBaseFakeRosPortBaseClass {
+public:
+ ComponentRosBaseFakeRosPortBaseClass() { };
+ virtual ~ComponentRosBaseFakeRosPortBaseClass() { }
+
+ ros::Publisher twist_pub;
+};
+
+#endif // ROS_PORT_BASE_CLASS_H_
diff --git a/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortCallbacksInterface.hh b/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortCallbacksInterface.hh
new file mode 100644
index 00000000..8ab8abeb
--- /dev/null
+++ b/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortCallbacksInterface.hh
@@ -0,0 +1,34 @@
+//--------------------------------------------------------------------------
+// This file is generated by the SeRoNet Tooling. The SeRoNet Tooling is
+// developed by the SeRoNet Project consortium:
+// http://www.seronet-projekt.de
+//
+// The ROS Mixed-Port Component is developed by:
+// Service Robotics Research Center of Ulm University of Applied Sciences
+// Fraunhofer Institute for Manufacturing Engineering and Automation IPA
+//
+// This code-generator uses infrastructure of the SmartMDSD Toolchain on
+// which the SeRoNet Tooling is based on.
+//
+// CAUTION:
+// This software is a preview for the purpose of technology demonstration.
+// It is experimental and comes with no support. Use at your own risk.
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+
+#ifndef ROS_PORT_CALLBACKS_INTERFACE_H_
+#define ROS_PORT_CALLBACKS_INTERFACE_H_
+
+#include
+
+#include
+
+class ComponentRosBaseFakeRosPortCallbacksInterface {
+public:
+ ComponentRosBaseFakeRosPortCallbacksInterface() { };
+ virtual ~ComponentRosBaseFakeRosPortCallbacksInterface() { }
+
+};
+
+#endif // ROS_PORT_CALLBACKS_INTERFACE_H_
diff --git a/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortExtension.cc b/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortExtension.cc
new file mode 100644
index 00000000..dba65fce
--- /dev/null
+++ b/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortExtension.cc
@@ -0,0 +1,71 @@
+//--------------------------------------------------------------------------
+// This file is generated by the SeRoNet Tooling. The SeRoNet Tooling is
+// developed by the SeRoNet Project consortium:
+// http://www.seronet-projekt.de
+//
+// The ROS Mixed-Port Component is developed by:
+// Service Robotics Research Center of Ulm University of Applied Sciences
+// Fraunhofer Institute for Manufacturing Engineering and Automation IPA
+//
+// This code-generator uses infrastructure of the SmartMDSD Toolchain on
+// which the SeRoNet Tooling is based on.
+//
+// CAUTION:
+// This software is a preview for the purpose of technology demonstration.
+// It is experimental and comes with no support. Use at your own risk.
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+
+#include "ComponentRosBaseFakeRosPortExtension.hh"
+
+// statically create a global PlainOpcUaComponentRosBaseFakeExtension instance
+static ComponentRosBaseFakeRosPortExtension ros_port_extension;
+
+ComponentRosBaseFakeRosPortExtension::ComponentRosBaseFakeRosPortExtension()
+: ComponentRosBaseFakeExtension("ComponentRosBaseFakeRosPortExtension")
+{
+ nh = 0;
+ callbacksPtr = 0;
+}
+
+ComponentRosBaseFakeRosPortExtension::~ComponentRosBaseFakeRosPortExtension()
+{ }
+
+void ComponentRosBaseFakeRosPortExtension::loadParameters(const SmartACE::SmartIniParameter ¶meter)
+{ }
+
+void ComponentRosBaseFakeRosPortExtension::initialize(ComponentRosBaseFake *component, int argc, char* argv[])
+{
+ ros::init(argc, argv, "ComponentRosBaseFake", ros::init_options::NoSigintHandler);
+ nh = new ros::NodeHandle();
+
+ callbacksPtr = new ComponentRosBaseFakeRosPortCallbacks();
+
+ component->rosPorts = this;
+
+ twist_pub = nh->advertise("/base/twist_controller_seronet/command", 10);
+}
+
+int ComponentRosBaseFakeRosPortExtension::onStartup()
+{
+ return startExtensionThread();
+}
+
+int ComponentRosBaseFakeRosPortExtension::extensionExecution()
+{
+ ros::spin();
+ return 0;
+}
+
+int ComponentRosBaseFakeRosPortExtension::onShutdown(const std::chrono::steady_clock::duration &timeoutTime)
+{
+ ros::shutdown();
+ return stopExtensionThread(timeoutTime);
+}
+
+void ComponentRosBaseFakeRosPortExtension::destroy()
+{
+ delete nh;
+ delete callbacksPtr;
+}
diff --git a/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortExtension.hh b/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortExtension.hh
new file mode 100644
index 00000000..a59c611a
--- /dev/null
+++ b/ComponentRosBaseFake/ROS/src-gen/ComponentRosBaseFakeRosPortExtension.hh
@@ -0,0 +1,55 @@
+//--------------------------------------------------------------------------
+// This file is generated by the SeRoNet Tooling. The SeRoNet Tooling is
+// developed by the SeRoNet Project consortium:
+// http://www.seronet-projekt.de
+//
+// The ROS Mixed-Port Component is developed by:
+// Service Robotics Research Center of Ulm University of Applied Sciences
+// Fraunhofer Institute for Manufacturing Engineering and Automation IPA
+//
+// This code-generator uses infrastructure of the SmartMDSD Toolchain on
+// which the SeRoNet Tooling is based on.
+//
+// CAUTION:
+// This software is a preview for the purpose of technology demonstration.
+// It is experimental and comes with no support. Use at your own risk.
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+
+#ifndef ROS_PORT_COMPONENT_EXTENSION_H_
+#define ROS_PORT_COMPONENT_EXTENSION_H_
+
+#include "ComponentRosBaseFakeRosPortBaseClass.hh"
+#include "ComponentRosBaseFakeRosPortCallbacks.hh"
+
+#include "ComponentRosBaseFakeExtension.hh"
+
+// include component's main class
+#include "ComponentRosBaseFake.hh"
+
+class ComponentRosBaseFakeRosPortExtension : public ComponentRosBaseFakeExtension, public ComponentRosBaseFakeRosPortBaseClass
+{
+private:
+ ros::NodeHandle *nh;
+
+ ComponentRosBaseFakeRosPortCallbacks *callbacksPtr;
+
+ virtual int extensionExecution() override;
+public:
+ ComponentRosBaseFakeRosPortExtension();
+ virtual ~ComponentRosBaseFakeRosPortExtension();
+
+ virtual void loadParameters(const SmartACE::SmartIniParameter ¶meter);
+ virtual void initialize(ComponentRosBaseFake *component, int argc, char* argv[]) override;
+ virtual int onStartup() override;
+
+ inline ros::Publisher* getTwist_pubPtr() {
+ return &twist_pub;
+ }
+
+ virtual int onShutdown(const std::chrono::steady_clock::duration &timeoutTime=std::chrono::seconds(2)) override;
+ virtual void destroy() override;
+};
+
+#endif /* ROS_PORT_COMPONENT_EXTENSION_H_ */
diff --git a/ComponentRosBaseFake/ROS/src-gen/package.xml b/ComponentRosBaseFake/ROS/src-gen/package.xml
new file mode 100644
index 00000000..0dc40a28
--- /dev/null
+++ b/ComponentRosBaseFake/ROS/src-gen/package.xml
@@ -0,0 +1,18 @@
+
+ ros_componentrosbasefake
+ 0.0.0
+ The ros_componentrosbasefake package
+
+ Apache 2.0
+
+
+
+ Jane Doe
+ Jane Doe
+
+
+ catkin
+ roscpp
+ geometry_msgs
+
+
diff --git a/ComponentRosBaseFake/ROS/src/ComponentRosBaseFakeRosPortCallbacks.cc b/ComponentRosBaseFake/ROS/src/ComponentRosBaseFakeRosPortCallbacks.cc
new file mode 100644
index 00000000..51d10c9e
--- /dev/null
+++ b/ComponentRosBaseFake/ROS/src/ComponentRosBaseFakeRosPortCallbacks.cc
@@ -0,0 +1,29 @@
+//--------------------------------------------------------------------------
+// This file is generated by the SeRoNet Tooling. The SeRoNet Tooling is
+// developed by the SeRoNet Project consortium:
+// http://www.seronet-projekt.de
+//
+// The ROS Mixed-Port Component is developed by:
+// Service Robotics Research Center of Ulm University of Applied Sciences
+// Fraunhofer Institute for Manufacturing Engineering and Automation IPA
+//
+// This code-generator uses infrastructure of the SmartMDSD Toolchain on
+// which the SeRoNet Tooling is based on.
+//
+// CAUTION:
+// This software is a preview for the purpose of technology demonstration.
+// It is experimental and comes with no support. Use at your own risk.
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+
+#include "ComponentRosBaseFakeRosPortCallbacks.hh"
+
+// include component's main class
+#include "ComponentRosBaseFake.hh"
+
+ComponentRosBaseFakeRosPortCallbacks::ComponentRosBaseFakeRosPortCallbacks() { }
+
+ComponentRosBaseFakeRosPortCallbacks::~ComponentRosBaseFakeRosPortCallbacks() { }
+
+
diff --git a/ComponentRosBaseFake/ROS/src/ComponentRosBaseFakeRosPortCallbacks.hh b/ComponentRosBaseFake/ROS/src/ComponentRosBaseFakeRosPortCallbacks.hh
new file mode 100644
index 00000000..8e3b58f2
--- /dev/null
+++ b/ComponentRosBaseFake/ROS/src/ComponentRosBaseFakeRosPortCallbacks.hh
@@ -0,0 +1,32 @@
+//--------------------------------------------------------------------------
+// This file is generated by the SeRoNet Tooling. The SeRoNet Tooling is
+// developed by the SeRoNet Project consortium:
+// http://www.seronet-projekt.de
+//
+// The ROS Mixed-Port Component is developed by:
+// Service Robotics Research Center of Ulm University of Applied Sciences
+// Fraunhofer Institute for Manufacturing Engineering and Automation IPA
+//
+// This code-generator uses infrastructure of the SmartMDSD Toolchain on
+// which the SeRoNet Tooling is based on.
+//
+// CAUTION:
+// This software is a preview for the purpose of technology demonstration.
+// It is experimental and comes with no support. Use at your own risk.
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+
+#ifndef ROS_PORT_CALLBACKS_H_
+#define ROS_PORT_CALLBACKS_H_
+
+#include "ComponentRosBaseFakeRosPortCallbacksInterface.hh"
+
+class ComponentRosBaseFakeRosPortCallbacks : public ComponentRosBaseFakeRosPortCallbacksInterface {
+public:
+ ComponentRosBaseFakeRosPortCallbacks();
+ virtual ~ComponentRosBaseFakeRosPortCallbacks();
+
+};
+
+#endif // ROS_PORT_CALLBACKS_H_
diff --git a/ComponentRosBaseFake/model/ComponentRosBaseFake.component b/ComponentRosBaseFake/model/ComponentRosBaseFake.component
new file mode 100644
index 00000000..81f8d00b
--- /dev/null
+++ b/ComponentRosBaseFake/model/ComponentRosBaseFake.component
@@ -0,0 +1,14 @@
+ComponentDefinition ComponentRosBaseFake logo "/ComponentRosBaseFake/model/logo.png"
+{
+Activity BaseFakeActivity
+ {
+ InputPortLink NavigationVelocityServiceIn { oversamplingOk undersamplingOk }
+ MixedPortROSLink twist_pub
+ DefaultTrigger PeriodicTimer 1.0 Hz
+ }
+ InputPort NavigationVelocityServiceIn implements CommNavigationObjects.NavigationVelocityService {
+ }
+ OutputPort BaseStateServiceOut implements CommBasicObjects.BaseStateService realizedBy BaseFakeActivity {
+ }
+ MixedPortROS twist_pub
+}
\ No newline at end of file
diff --git a/ComponentRosBaseFake/model/ComponentRosBaseFakeComponentDefinition.jpg b/ComponentRosBaseFake/model/ComponentRosBaseFakeComponentDefinition.jpg
new file mode 100644
index 00000000..cc93a27e
Binary files /dev/null and b/ComponentRosBaseFake/model/ComponentRosBaseFakeComponentDefinition.jpg differ
diff --git a/ComponentRosBaseFake/model/component.rosinterfacespool b/ComponentRosBaseFake/model/component.rosinterfacespool
new file mode 100644
index 00000000..0733f295
--- /dev/null
+++ b/ComponentRosBaseFake/model/component.rosinterfacespool
@@ -0,0 +1,3 @@
+RosInterfacesPool {
+ RosPublisher twist_pub { topicName "/base/twist_controller_seronet/command" type "geometry_msgs.Twist" }
+}
\ No newline at end of file
diff --git a/ComponentRosBaseFake/opcua-backend/src-gen/ComponentRosBaseFakeOpcUaBackendPortFactory.cc b/ComponentRosBaseFake/opcua-backend/src-gen/ComponentRosBaseFakeOpcUaBackendPortFactory.cc
new file mode 100644
index 00000000..e7bf8455
--- /dev/null
+++ b/ComponentRosBaseFake/opcua-backend/src-gen/ComponentRosBaseFakeOpcUaBackendPortFactory.cc
@@ -0,0 +1,95 @@
+//--------------------------------------------------------------------------
+// Code generated by the SmartSoft MDSD Toolchain
+// The SmartSoft Toolchain has been developed by:
+//
+// Service Robotics Research Center
+// University of Applied Sciences Ulm
+// Prittwitzstr. 10
+// 89075 Ulm (Germany)
+//
+// Information about the SmartSoft MDSD Toolchain is available at:
+// www.servicerobotik-ulm.de
+//
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+
+#include "ComponentRosBaseFakeOpcUaBackendPortFactory.hh"
+
+// include all potentially required pattern implementations
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+
+// include referenced CommunicationObject SeRoNetSDK self description implementations
+#include "CommBasicObjectsOpcUa/CommBaseStateOpcUa.hh"
+#include "CommBasicObjectsOpcUa/CommNavigationVelocityOpcUa.hh"
+
+// create a static instance of the OpcUaBackendPortFactory
+static ComponentRosBaseFakeOpcUaBackendPortFactory OpcUaBackendPortFactory;
+
+ComponentRosBaseFakeOpcUaBackendPortFactory::ComponentRosBaseFakeOpcUaBackendPortFactory()
+{
+ componentImpl = 0;
+ ComponentRosBaseFake::instance()->addPortFactory("OpcUa_SeRoNet", this);
+}
+
+ComponentRosBaseFakeOpcUaBackendPortFactory::~ComponentRosBaseFakeOpcUaBackendPortFactory()
+{ }
+
+void ComponentRosBaseFakeOpcUaBackendPortFactory::initialize(ComponentRosBaseFake *component, int argc, char* argv[])
+{
+ componentImpl = new SeRoNet::Utils::Component(component->connections.component.name);
+}
+
+int ComponentRosBaseFakeOpcUaBackendPortFactory::onStartup()
+{
+ if (!component_thread.joinable()) {
+ component_thread = std::thread(&ComponentRosBaseFakeOpcUaBackendPortFactory::task_execution, this);
+ return 0;
+ }
+ return -1;
+}
+
+
+Smart::IPushServerPattern * ComponentRosBaseFakeOpcUaBackendPortFactory::createBaseStateServiceOut(const std::string &serviceName)
+{
+ return new SeRoNet::OPCUA::Server::PushServer(componentImpl, serviceName);
+}
+
+Smart::ISendServerPattern * ComponentRosBaseFakeOpcUaBackendPortFactory::createNavigationVelocityServiceIn(const std::string &serviceName)
+{
+ return new SeRoNet::OPCUA::Server::SendServer(componentImpl, serviceName);
+}
+
+
+int ComponentRosBaseFakeOpcUaBackendPortFactory::task_execution()
+{
+ componentImpl->run();
+ return 0;
+}
+
+int ComponentRosBaseFakeOpcUaBackendPortFactory::onShutdown(const std::chrono::steady_clock::duration &timeoutTime)
+{
+ // stop component-internal infrastructure
+ componentImpl->stopRunning();
+ // wait on component thread to exit
+ if (component_thread.joinable()) {
+ // FIXME: don't wait infinetly (use timeoutTime here)
+ component_thread.join();
+ }
+ return 0;
+}
+
+void ComponentRosBaseFakeOpcUaBackendPortFactory::destroy()
+{
+ // clean-up component's internally used resources
+ delete componentImpl;
+}
diff --git a/ComponentRosBaseFake/opcua-backend/src-gen/ComponentRosBaseFakeOpcUaBackendPortFactory.hh b/ComponentRosBaseFake/opcua-backend/src-gen/ComponentRosBaseFakeOpcUaBackendPortFactory.hh
new file mode 100644
index 00000000..26007d41
--- /dev/null
+++ b/ComponentRosBaseFake/opcua-backend/src-gen/ComponentRosBaseFakeOpcUaBackendPortFactory.hh
@@ -0,0 +1,56 @@
+//--------------------------------------------------------------------------
+// Code generated by the SmartSoft MDSD Toolchain
+// The SmartSoft Toolchain has been developed by:
+//
+// Service Robotics Research Center
+// University of Applied Sciences Ulm
+// Prittwitzstr. 10
+// 89075 Ulm (Germany)
+//
+// Information about the SmartSoft MDSD Toolchain is available at:
+// www.servicerobotik-ulm.de
+//
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+
+#ifndef COMPONENTROSBASEFAKE_OPC_UA_BACKEND_PORTFACTORY_HH_
+#define COMPONENTROSBASEFAKE_OPC_UA_BACKEND_PORTFACTORY_HH_
+
+// include the main component-definition class
+#include "ComponentRosBaseFakePortFactoryInterface.hh"
+
+#include
+#include
+
+// include SeRoNetSDK library
+#include
+#include
+
+class ComponentRosBaseFakeOpcUaBackendPortFactory: public ComponentRosBaseFakePortFactoryInterface
+{
+private:
+ // internal component instance
+ SeRoNet::Utils::Component *componentImpl;
+
+ // component thread
+ std::thread component_thread;
+
+ // internal component thread method
+ int task_execution();
+public:
+ ComponentRosBaseFakeOpcUaBackendPortFactory();
+ virtual ~ComponentRosBaseFakeOpcUaBackendPortFactory();
+
+ virtual void initialize(ComponentRosBaseFake *component, int argc, char* argv[]) override;
+ virtual int onStartup() override;
+
+
+ virtual Smart::IPushServerPattern * createBaseStateServiceOut(const std::string &serviceName) override;
+ virtual Smart::ISendServerPattern * createNavigationVelocityServiceIn(const std::string &serviceName) override;
+
+ virtual int onShutdown(const std::chrono::steady_clock::duration &timeoutTime=std::chrono::seconds(2)) override;
+ virtual void destroy() override;
+};
+
+#endif /* COMPONENTROSBASEFAKE_SERONET_SDK_PORTFACTORY_HH_ */
diff --git a/ComponentRosBaseFake/opcua-backend/src-gen/OpcUaBackend.cmake b/ComponentRosBaseFake/opcua-backend/src-gen/OpcUaBackend.cmake
new file mode 100644
index 00000000..7a1f2e81
--- /dev/null
+++ b/ComponentRosBaseFake/opcua-backend/src-gen/OpcUaBackend.cmake
@@ -0,0 +1,12 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 3.5)
+
+FIND_PACKAGE(Open62541Cpp QUIET)
+SET(SmartSoft_CD_API_DIR $ENV{SMART_ROOT_ACE}/modules)
+FIND_PACKAGE(SeRoNetSDK QUIET)
+
+IF(SeRoNetSDK_FOUND)
+ FIND_PACKAGE(CommBasicObjectsOpcUa PATHS $ENV{SMART_ROOT_ACE}/modules)
+ SET(CMAKE_CXX_STANDARD 14)
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_LIST_DIR})
+ SET(OPC_UA_BACKEND_SRCS "${CMAKE_CURRENT_LIST_DIR}/ComponentRosBaseFakeOpcUaBackendPortFactory.cc")
+ENDIF(SeRoNetSDK_FOUND)
diff --git a/ComponentRosBaseFake/opcua-backend/src-gen/info.txt b/ComponentRosBaseFake/opcua-backend/src-gen/info.txt
new file mode 100644
index 00000000..93cdd389
--- /dev/null
+++ b/ComponentRosBaseFake/opcua-backend/src-gen/info.txt
@@ -0,0 +1,17 @@
+//--------------------------------------------------------------------------
+// Code generated by the SmartSoft MDSD Toolchain
+// The SmartSoft Toolchain has been developed by:
+//
+// Service Robotics Research Center
+// University of Applied Sciences Ulm
+// Prittwitzstr. 10
+// 89075 Ulm (Germany)
+//
+// Information about the SmartSoft MDSD Toolchain is available at:
+// www.servicerobotik-ulm.de
+//
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+
+// Generated with SmartMDSD Toolchain Version 3.12.0.201912041712
diff --git a/ComponentRosBaseFake/representations.aird b/ComponentRosBaseFake/representations.aird
new file mode 100644
index 00000000..bdbb2f95
--- /dev/null
+++ b/ComponentRosBaseFake/representations.aird
@@ -0,0 +1,236 @@
+
+
+
+ model/ComponentRosBaseFake.component
+ model/component.rosinterfacespool
+ platform:/resource/CommNavigationObjects/model/CommNavigationObjects.services
+ platform:/resource/CommBasicObjects/model/CommBasicObjects.types
+ platform:/resource/CommNavigationObjects/model/CommNavigationObjects.types
+ platform:/plugin/org.xtext.base.stateMachine/componentLifecycle/ComponentLifecycle.automaton
+ platform:/resource/CommBasicObjects/model/CommBasicObjects.modes
+ platform:/resource/CommBasicObjects/model/CommBasicObjects.parameters
+ platform:/resource/CommBasicObjects/model/CommBasicObjects.services
+ platform:/resource/CommNavigationObjects/model/CommNavigationObjects.modes
+ platform:/resource/CommNavigationObjects/model/CommNavigationObjects.parameters
+ platform:/plugin/org.xtext.service.parameterDefinition/defaultParameterLib/defaultParameterLib.parameters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ KEEP_LOCATION
+ KEEP_SIZE
+ KEEP_RATIO
+
+
+
+
+
+ KEEP_LOCATION
+ KEEP_SIZE
+ KEEP_RATIO
+
+ bold
+
+
+
+
+
+
+ KEEP_LOCATION
+ KEEP_SIZE
+ KEEP_RATIO
+
+ bold
+
+
+
+
+
+
+ KEEP_LOCATION
+ KEEP_SIZE
+ KEEP_RATIO
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ComponentRosBaseFake/smartsoft/CMakeLists.txt b/ComponentRosBaseFake/smartsoft/CMakeLists.txt
new file mode 100644
index 00000000..4e90a44f
--- /dev/null
+++ b/ComponentRosBaseFake/smartsoft/CMakeLists.txt
@@ -0,0 +1,82 @@
+#--------------------------------------------------------------------------
+# Code generated by the SmartSoft MDSD Toolchain
+# The SmartSoft Toolchain has been developed by:
+#
+# Service Robotics Research Center
+# University of Applied Sciences Ulm
+# Prittwitzstr. 10
+# 89075 Ulm (Germany)
+#
+# Information about the SmartSoft MDSD Toolchain is available at:
+# www.servicerobotik-ulm.de
+#
+# This file is generated once. Modify this file to your needs.
+# If you want the toolchain to re-generate this file, please
+# delete it before running the code generator.
+#--------------------------------------------------------------------------
+
+CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
+
+# find the SmartSoft CMake Macros (version 2 that uses CMake v3)
+FIND_FILE(SMART_MACROS SmartMacros2.cmake PATHS $ENV{SMART_ROOT_ACE}/CMakeMacros /opt/smartSoftAce/CMakeMacros/)
+INCLUDE(${SMART_MACROS})
+
+# Create and configure a CMake project for a CommunicationObject
+SMART_COMPONENT_PROJECT()
+
+# find SmartSoft package
+#FIND_SMARTSOFT(3.0)
+#FIXME: generalize this
+FIND_PACKAGE(AceSmartSoft PATHS $ENV{SMART_ROOT_ACE}/modules)
+
+# generte doxygen documentation
+SMART_COMPONENT_GENERATE_DOC()
+
+# automatically build CommunicationObject dependencies
+SMART_COMPONENT_AUTOBUILD_DEPENDENCIES()
+
+#################################################################################
+## here you can put all your project-specific compiler configurations ##
+## using regular CMake commands (like FIND_PACKAGE, INCLUDE_DIRECTORIES, etc.) ##
+
+# you can add additional external libraries using regular CMake commands, e.g.:
+#FIND_PACKAGE()
+
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/src-gen/MixedPortIncludes.cmake)
+
+# these are the regular includes (add your own includes, if needed)
+INCLUDE_DIRECTORIES(
+ ${CMAKE_CURRENT_LIST_DIR}/src
+ ${CMAKE_CURRENT_LIST_DIR}/src-gen
+ ${CMAKE_CURRENT_LIST_DIR}/src-gen/params
+)
+
+# collect the toolchain-generated source-files
+FILE(GLOB_RECURSE SRC ${CMAKE_CURRENT_LIST_DIR}/src/*.cc)
+FILE(GLOB_RECURSE SRC_GEN ${CMAKE_CURRENT_LIST_DIR}/src-gen/*.cc)
+FILE(GLOB_RECURSE SRC_GEN_PARAMS ${CMAKE_CURRENT_LIST_DIR}/src-gen/params/*.cc)
+
+# collect your own (local) source-files here (if needed)
+#FILE(GLOB_RECURSE USER_SRC ${CMAKE_CURRENT_LIST_DIR}/src/)
+
+# create the executable using collected source-files
+ADD_EXECUTABLE(${PROJECT_NAME} ${SRC} ${SRC_GEN} ${SRC_GEN_PARAMS} ${FURTHER_SRCS}) # add ${USER_SRC} (if needed)
+
+# link your external libraries here (if there are any)
+#TARGET_LINK_LIBRARIES(${PROJECT_NAME} )
+
+INCLUDE(${CMAKE_CURRENT_LIST_DIR}/src-gen/MixedPortTargetConfigs.cmake)
+
+#INSTALL(FILES ${PROJECT_SOURCE_DIR}/src-gen/${PROJECT_NAME}.ini.template DESTINATION etc)
+
+## end user-code ##
+#################################################################################
+
+# SmartSoftKernel is one of the default dependencies for each component
+TARGET_LINK_LIBRARIES(${PROJECT_NAME} AceSmartSoftKernel)
+
+# automatically link to all dependent CommunicationObjects
+SMART_COMPONENT_AUTOLINK_DEPENDENCIES()
+
+# automatically install the component target
+SMART_COMPONENT_AUTOINSTALL()
diff --git a/ComponentRosBaseFake/smartsoft/src-gen/BaseFakeActivityCore.cc b/ComponentRosBaseFake/smartsoft/src-gen/BaseFakeActivityCore.cc
new file mode 100644
index 00000000..d5d1e63e
--- /dev/null
+++ b/ComponentRosBaseFake/smartsoft/src-gen/BaseFakeActivityCore.cc
@@ -0,0 +1,121 @@
+//--------------------------------------------------------------------------
+// Code generated by the SmartSoft MDSD Toolchain
+// The SmartSoft Toolchain has been developed by:
+//
+// Service Robotics Research Center
+// University of Applied Sciences Ulm
+// Prittwitzstr. 10
+// 89075 Ulm (Germany)
+//
+// Information about the SmartSoft MDSD Toolchain is available at:
+// www.servicerobotik-ulm.de
+//
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+#include "BaseFakeActivityCore.hh"
+#include "BaseFakeActivity.hh"
+#include "ComponentRosBaseFake.hh"
+
+//FIXME: use logging
+//#include "smartGlobalLogger.hh"
+
+// include observers
+
+
+BaseFakeActivityCore::BaseFakeActivityCore(Smart::IComponent *comp, const bool &useDefaultState)
+: SmartACE::ManagedTask(comp)
+, useDefaultState(useDefaultState)
+, useLogging(false)
+, taskLoggingId(0)
+, currentUpdateCount(0)
+, navigationVelocityServiceInStatus(Smart::SMART_DISCONNECTED)
+, navigationVelocityServiceInObject()
+{
+}
+
+BaseFakeActivityCore::~BaseFakeActivityCore()
+{
+}
+
+
+void BaseFakeActivityCore::notify_all_interaction_observers() {
+ std::unique_lock lock(interaction_observers_mutex);
+ // try dynamically down-casting this class to the derived class
+ // (we can do it safely here as we exactly know the derived class)
+ if(const BaseFakeActivity* baseFakeActivity = dynamic_cast(this)) {
+ for(auto it=interaction_observers.begin(); it!=interaction_observers.end(); it++) {
+ (*it)->on_update_from(baseFakeActivity);
+ }
+ }
+}
+
+void BaseFakeActivityCore::attach_interaction_observer(BaseFakeActivityObserverInterface *observer) {
+ std::unique_lock lock(interaction_observers_mutex);
+ interaction_observers.push_back(observer);
+}
+
+void BaseFakeActivityCore::detach_interaction_observer(BaseFakeActivityObserverInterface *observer) {
+ std::unique_lock lock(interaction_observers_mutex);
+ interaction_observers.remove(observer);
+}
+
+int BaseFakeActivityCore::execute_protected_region()
+{
+
+ // update of comm-objects must be within the protected region to prevent aged comm-object values
+ this->updateAllCommObjects();
+
+ if(useLogging == true) {
+ //FIXME: use logging
+ //Smart::LOGGER->log(taskLoggingId, getCurrentUpdateCount(), getPreviousCommObjId());
+ }
+
+ // this is the user code (should not internally use the state-pattern any more)
+ int retval = this->on_execute();
+
+ // notify all attached interaction observers
+ this->notify_all_interaction_observers();
+
+ // inform all associated tasks about a new update
+ this->trigger_all_tasks();
+
+ // increment current currentUpdateCount for the next iteration
+ currentUpdateCount++;
+
+ return retval;
+}
+
+
+void BaseFakeActivityCore::updateAllCommObjects()
+{
+ navigationVelocityServiceInStatus = COMP->navigationVelocityServiceInInputTaskTrigger->getUpdate(navigationVelocityServiceInObject);
+
+}
+
+
+// this method is meant to be used in derived classes
+Smart::StatusCode BaseFakeActivityCore::baseStateServiceOutPut(CommBasicObjects::CommBaseState &baseStateServiceOutDataObject)
+{
+ Smart::StatusCode result = COMP->baseStateServiceOut->put(baseStateServiceOutDataObject);
+ if(useLogging == true) {
+ //FIXME: use logging
+ //Smart::LOGGER->log(pushLoggingId+1, getCurrentUpdateCount(), getPreviousCommObjId());
+ }
+ return result;
+}
+
+void BaseFakeActivityCore::triggerLogEntry(const int& idOffset)
+{
+ if(useLogging == true) {
+ int logId = taskLoggingId + 2*1 + idOffset;
+ //FIXME: use logging
+ //Smart::LOGGER->log(logId, getCurrentUpdateCount(), getPreviousCommObjId());
+ }
+}
+
+int BaseFakeActivityCore::getPreviousCommObjId()
+{
+ // this method needs to be overloaded and implemented in derived classes
+ return 0;
+}
diff --git a/ComponentRosBaseFake/smartsoft/src-gen/BaseFakeActivityCore.hh b/ComponentRosBaseFake/smartsoft/src-gen/BaseFakeActivityCore.hh
new file mode 100644
index 00000000..93931f8c
--- /dev/null
+++ b/ComponentRosBaseFake/smartsoft/src-gen/BaseFakeActivityCore.hh
@@ -0,0 +1,108 @@
+//--------------------------------------------------------------------------
+// Code generated by the SmartSoft MDSD Toolchain
+// The SmartSoft Toolchain has been developed by:
+//
+// Service Robotics Research Center
+// University of Applied Sciences Ulm
+// Prittwitzstr. 10
+// 89075 Ulm (Germany)
+//
+// Information about the SmartSoft MDSD Toolchain is available at:
+// www.servicerobotik-ulm.de
+//
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+#ifndef _BASEFAKEACTIVITY_CORE_HH
+#define _BASEFAKEACTIVITY_CORE_HH
+
+#include "aceSmartSoft.hh"
+
+// include upcall interface
+#include "NavigationVelocityServiceInUpcallInterface.hh"
+
+// include communication-objects for output ports
+#include
+
+// include all interaction-observer interfaces
+#include
+
+#include
+
+class BaseFakeActivityCore
+: public SmartACE::ManagedTask
+, public Smart::TaskTriggerSubject
+, public NavigationVelocityServiceInUpcallInterface
+{
+private:
+ bool useDefaultState;
+ bool useLogging;
+ int taskLoggingId;
+ unsigned int currentUpdateCount;
+
+ Smart::StatusCode navigationVelocityServiceInStatus;
+ CommBasicObjects::CommNavigationVelocity navigationVelocityServiceInObject;
+
+
+protected:
+ virtual int execute_protected_region();
+
+ virtual void updateAllCommObjects();
+
+ virtual int getPreviousCommObjId();
+
+ void triggerLogEntry(const int& idOffset);
+
+
+ // overload and implement this method in derived classes to immediately get all incoming updates from NavigationVelocityServiceIn (as soon as they arrive)
+ virtual void on_NavigationVelocityServiceIn(const CommBasicObjects::CommNavigationVelocity &input) {
+ // no-op
+ }
+
+ // this method can be safely used from the thread in derived classes
+ inline Smart::StatusCode navigationVelocityServiceInGetUpdate(CommBasicObjects::CommNavigationVelocity &navigationVelocityServiceInObject) const
+ {
+ // copy local object buffer and return the last status code
+ navigationVelocityServiceInObject = this->navigationVelocityServiceInObject;
+ return navigationVelocityServiceInStatus;
+ }
+
+ // this method is meant to be used in derived classes
+ Smart::StatusCode baseStateServiceOutPut(CommBasicObjects::CommBaseState &baseStateServiceOutDataObject);
+
+
+/**
+ * Implementation of the Subject part of an InteractionObserver
+ */
+private:
+ std::mutex interaction_observers_mutex;
+ std::list interaction_observers;
+protected:
+ void notify_all_interaction_observers();
+public:
+ void attach_interaction_observer(BaseFakeActivityObserverInterface *observer);
+ void detach_interaction_observer(BaseFakeActivityObserverInterface *observer);
+
+public:
+ BaseFakeActivityCore(Smart::IComponent *comp, const bool &useDefaultState=true);
+ virtual ~BaseFakeActivityCore();
+
+ inline void setUpLogging(const int &taskNbr, const bool &useLogging=true) {
+ this->taskLoggingId = taskNbr;
+ this->useLogging = useLogging;
+ }
+
+ inline bool isLoggingActive() const {
+ return useLogging;
+ }
+
+ inline int getLoggingID() const {
+ return taskLoggingId;
+ }
+
+ inline int getCurrentUpdateCount() const {
+ return currentUpdateCount;
+ }
+
+};
+#endif
diff --git a/ComponentRosBaseFake/smartsoft/src-gen/BaseFakeActivityObserverInterface.hh b/ComponentRosBaseFake/smartsoft/src-gen/BaseFakeActivityObserverInterface.hh
new file mode 100644
index 00000000..a4fa8531
--- /dev/null
+++ b/ComponentRosBaseFake/smartsoft/src-gen/BaseFakeActivityObserverInterface.hh
@@ -0,0 +1,29 @@
+//--------------------------------------------------------------------------
+// Code generated by the SmartSoft MDSD Toolchain
+// The SmartSoft Toolchain has been developed by:
+//
+// Service Robotics Research Center
+// University of Applied Sciences Ulm
+// Prittwitzstr. 10
+// 89075 Ulm (Germany)
+//
+// Information about the SmartSoft MDSD Toolchain is available at:
+// www.servicerobotik-ulm.de
+//
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+#ifndef _BASEFAKEACTIVITY_OBSERVER_INTERFACE_HH
+#define _BASEFAKEACTIVITY_OBSERVER_INTERFACE_HH
+
+// forward declaration
+class BaseFakeActivity;
+
+class BaseFakeActivityObserverInterface {
+public:
+ virtual ~BaseFakeActivityObserverInterface() { }
+
+ virtual void on_update_from(const BaseFakeActivity *subject) = 0;
+};
+
+#endif
diff --git a/ComponentRosBaseFake/smartsoft/src-gen/ComponentProject.cmake b/ComponentRosBaseFake/smartsoft/src-gen/ComponentProject.cmake
new file mode 100644
index 00000000..8b7757fc
--- /dev/null
+++ b/ComponentRosBaseFake/smartsoft/src-gen/ComponentProject.cmake
@@ -0,0 +1,17 @@
+#--------------------------------------------------------------------------
+# Code generated by the SmartSoft MDSD Toolchain
+# The SmartSoft Toolchain has been developed by:
+#
+# Service Robotics Research Center
+# University of Applied Sciences Ulm
+# Prittwitzstr. 10
+# 89075 Ulm (Germany)
+#
+# Information about the SmartSoft MDSD Toolchain is available at:
+# www.servicerobotik-ulm.de
+#
+# Please do not modify this file. It will be re-generated
+# running the code generator.
+#--------------------------------------------------------------------------
+
+PROJECT(ComponentRosBaseFake)
diff --git a/ComponentRosBaseFake/smartsoft/src-gen/ComponentRosBaseFake.cc b/ComponentRosBaseFake/smartsoft/src-gen/ComponentRosBaseFake.cc
new file mode 100644
index 00000000..6443b948
--- /dev/null
+++ b/ComponentRosBaseFake/smartsoft/src-gen/ComponentRosBaseFake.cc
@@ -0,0 +1,497 @@
+//--------------------------------------------------------------------------
+// Code generated by the SmartSoft MDSD Toolchain
+// The SmartSoft Toolchain has been developed by:
+//
+// Service Robotics Research Center
+// University of Applied Sciences Ulm
+// Prittwitzstr. 10
+// 89075 Ulm (Germany)
+//
+// Information about the SmartSoft MDSD Toolchain is available at:
+// www.servicerobotik-ulm.de
+//
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+#include "ComponentRosBaseFake.hh"
+#include "smartTimedTaskTrigger.h"
+//FIXME: implement logging
+//#include "smartGlobalLogger.hh"
+
+// the ace port-factory is used as a default port-mapping
+#include "ComponentRosBaseFakeAcePortFactory.hh"
+
+
+// initialize static singleton pointer to zero
+ComponentRosBaseFake* ComponentRosBaseFake::_componentRosBaseFake = 0;
+
+// constructor
+ComponentRosBaseFake::ComponentRosBaseFake()
+{
+ std::cout << "constructor of ComponentRosBaseFake\n";
+
+ // set all pointer members to NULL
+ baseFakeActivity = NULL;
+ baseFakeActivityTrigger = NULL;
+ baseStateServiceOut = NULL;
+ navigationVelocityServiceIn = NULL;
+ navigationVelocityServiceInInputTaskTrigger = NULL;
+ navigationVelocityServiceInUpcallManager = NULL;
+ //twist_pub = NULL;
+ stateChangeHandler = NULL;
+ stateSlave = NULL;
+ wiringSlave = NULL;
+
+ // set default ini parameter values
+ connections.component.name = "ComponentRosBaseFake";
+ connections.component.initialComponentMode = "Neutral";
+ connections.component.defaultScheduler = "DEFAULT";
+ connections.component.useLogger = false;
+
+ connections.baseStateServiceOut.serviceName = "BaseStateServiceOut";
+ connections.baseStateServiceOut.roboticMiddleware = "ACE_SmartSoft";
+ connections.navigationVelocityServiceIn.serviceName = "NavigationVelocityServiceIn";
+ connections.navigationVelocityServiceIn.roboticMiddleware = "ACE_SmartSoft";
+ connections.baseFakeActivity.minActFreq = 0.0;
+ connections.baseFakeActivity.maxActFreq = 0.0;
+ connections.baseFakeActivity.trigger = "PeriodicTimer";
+ connections.baseFakeActivity.periodicActFreq = 1.0;
+ // scheduling default parameters
+ connections.baseFakeActivity.scheduler = "DEFAULT";
+ connections.baseFakeActivity.priority = -1;
+ connections.baseFakeActivity.cpuAffinity = -1;
+
+ // initialize members of ComponentRosBaseFakeROSExtension
+ rosPorts = 0;
+
+ // initialize members of OpcUaBackendComponentGeneratorExtension
+
+ // initialize members of PlainOpcUaComponentRosBaseFakeExtension
+
+}
+
+void ComponentRosBaseFake::addPortFactory(const std::string &name, ComponentRosBaseFakePortFactoryInterface *portFactory)
+{
+ portFactoryRegistry[name] = portFactory;
+}
+
+void ComponentRosBaseFake::addExtension(ComponentRosBaseFakeExtension *extension)
+{
+ componentExtensionRegistry[extension->getName()] = extension;
+}
+
+SmartACE::SmartComponent* ComponentRosBaseFake::getComponentImpl()
+{
+ return dynamic_cast(portFactoryRegistry["ACE_SmartSoft"])->getComponentImpl();
+}
+
+/**
+ * Notify the component that setup/initialization is finished.
+ * You may call this function from anywhere in the component.
+ *
+ * Set component's internal lifecycle state automaton (if any) into
+ * Alive mode (from here on the component is ready to provide its services)
+ */
+void ComponentRosBaseFake::setStartupFinished() {
+ stateSlave->setWaitState("Alive");
+ std::cout << "ComponentDefinition initialization/startup finished." << std::endl;
+}
+
+
+
+
+/**
+ * First connect ALL client ports contained in this component, then start all services:
+ * activate state, push, etc...
+ */
+Smart::StatusCode ComponentRosBaseFake::connectAndStartAllServices() {
+ Smart::StatusCode status = Smart::SMART_OK;
+
+ return status;
+}
+
+/**
+ * Start all tasks contained in this component.
+ */
+void ComponentRosBaseFake::startAllTasks() {
+ // start task BaseFakeActivity
+ if(connections.baseFakeActivity.scheduler != "DEFAULT") {
+ ACE_Sched_Params baseFakeActivity_SchedParams(ACE_SCHED_OTHER, ACE_THR_PRI_OTHER_DEF);
+ if(connections.baseFakeActivity.scheduler == "FIFO") {
+ baseFakeActivity_SchedParams.policy(ACE_SCHED_FIFO);
+ baseFakeActivity_SchedParams.priority(ACE_THR_PRI_FIFO_MIN);
+ } else if(connections.baseFakeActivity.scheduler == "RR") {
+ baseFakeActivity_SchedParams.policy(ACE_SCHED_RR);
+ baseFakeActivity_SchedParams.priority(ACE_THR_PRI_RR_MIN);
+ }
+ baseFakeActivity->start(baseFakeActivity_SchedParams, connections.baseFakeActivity.cpuAffinity);
+ } else {
+ baseFakeActivity->start();
+ }
+}
+
+/**
+ * Start all timers contained in this component
+ */
+void ComponentRosBaseFake::startAllTimers() {
+}
+
+
+Smart::TaskTriggerSubject* ComponentRosBaseFake::getInputTaskTriggerFromString(const std::string &client)
+{
+ if(client == "NavigationVelocityServiceIn") return navigationVelocityServiceInInputTaskTrigger;
+
+ return NULL;
+}
+
+
+void ComponentRosBaseFake::init(int argc, char *argv[])
+{
+ try {
+ Smart::StatusCode status;
+
+ // load initial parameters from ini-file (if found)
+ loadParameter(argc, argv);
+
+
+ // initializations of ComponentRosBaseFakeROSExtension
+
+ // initializations of OpcUaBackendComponentGeneratorExtension
+
+ // initializations of PlainOpcUaComponentRosBaseFakeExtension
+
+
+ // initialize all registered port-factories
+ for(auto portFactory = portFactoryRegistry.begin(); portFactory != portFactoryRegistry.end(); portFactory++)
+ {
+ portFactory->second->initialize(this, argc, argv);
+ }
+
+ // initialize all registered component-extensions
+ for(auto extension = componentExtensionRegistry.begin(); extension != componentExtensionRegistry.end(); extension++)
+ {
+ extension->second->initialize(this, argc, argv);
+ }
+
+ ComponentRosBaseFakePortFactoryInterface *acePortFactory = portFactoryRegistry["ACE_SmartSoft"];
+ if(acePortFactory == 0) {
+ std::cerr << "ERROR: acePortFactory NOT instantiated -> exit(-1)" << std::endl;
+ exit(-1);
+ }
+
+ // this pointer is used for backwards compatibility (deprecated: should be removed as soon as all patterns, including coordination, are moved to port-factory)
+ SmartACE::SmartComponent *component = dynamic_cast(acePortFactory)->getComponentImpl();
+
+ std::cout << "ComponentDefinition ComponentRosBaseFake is named " << connections.component.name << std::endl;
+
+ if(connections.component.useLogger == true) {
+ //FIXME: use logging
+ //Smart::LOGGER->openLogFileInFolder("data/"+connections.component.name);
+ //Smart::LOGGER->startLogging();
+ }
+
+ // create event-test handlers (if needed)
+
+ // create server ports
+ // TODO: set minCycleTime from Ini-file
+ baseStateServiceOut = portFactoryRegistry[connections.baseStateServiceOut.roboticMiddleware]->createBaseStateServiceOut(connections.baseStateServiceOut.serviceName);
+ navigationVelocityServiceIn = portFactoryRegistry[connections.navigationVelocityServiceIn.roboticMiddleware]->createNavigationVelocityServiceIn(connections.navigationVelocityServiceIn.serviceName);
+
+ // create client ports
+
+ // create InputTaskTriggers and UpcallManagers
+ navigationVelocityServiceInInputTaskTrigger = new Smart::InputTaskTrigger(navigationVelocityServiceIn);
+ navigationVelocityServiceInUpcallManager = new NavigationVelocityServiceInUpcallManager(navigationVelocityServiceIn);
+
+ // create input-handler
+
+ // create request-handlers
+
+ // create state pattern
+ stateChangeHandler = new SmartStateChangeHandler();
+ stateSlave = new SmartACE::StateSlave(component, stateChangeHandler);
+ status = stateSlave->setUpInitialState(connections.component.initialComponentMode);
+ if (status != Smart::SMART_OK) std::cerr << status << "; failed setting initial ComponentMode: " << connections.component.initialComponentMode << std::endl;
+ // activate state slave
+ status = stateSlave->activate();
+ if(status != Smart::SMART_OK) std::cerr << "ERROR: activate state" << std::endl;
+
+ wiringSlave = new SmartACE::WiringSlave(component);
+ // add client port to wiring slave
+
+
+
+ // create Task BaseFakeActivity
+ baseFakeActivity = new BaseFakeActivity(component);
+ // configure input-links
+ navigationVelocityServiceInUpcallManager->attach(baseFakeActivity);
+ // configure task-trigger (if task is configurable)
+ if(connections.baseFakeActivity.trigger == "PeriodicTimer") {
+ // create PeriodicTimerTrigger
+ int microseconds = 1000*1000 / connections.baseFakeActivity.periodicActFreq;
+ if(microseconds > 0) {
+ Smart::TimedTaskTrigger *triggerPtr = new Smart::TimedTaskTrigger();
+ triggerPtr->attach(baseFakeActivity);
+ component->getTimerManager()->scheduleTimer(triggerPtr, (void *) 0, std::chrono::microseconds(microseconds), std::chrono::microseconds(microseconds));
+ // store trigger in class member
+ baseFakeActivityTrigger = triggerPtr;
+ } else {
+ std::cerr << "ERROR: could not set-up Timer with cycle-time " << microseconds << " as activation source for Task BaseFakeActivity" << std::endl;
+ }
+ } else if(connections.baseFakeActivity.trigger == "DataTriggered") {
+ baseFakeActivityTrigger = getInputTaskTriggerFromString(connections.baseFakeActivity.inPortRef);
+ if(baseFakeActivityTrigger != NULL) {
+ baseFakeActivityTrigger->attach(baseFakeActivity, connections.baseFakeActivity.prescale);
+ } else {
+ std::cerr << "ERROR: could not set-up InPort " << connections.baseFakeActivity.inPortRef << " as activation source for Task BaseFakeActivity" << std::endl;
+ }
+ } else
+ {
+ // setup default task-trigger as PeriodicTimer
+ Smart::TimedTaskTrigger *triggerPtr = new Smart::TimedTaskTrigger();
+ int microseconds = 1000*1000 / 1.0;
+ if(microseconds > 0) {
+ component->getTimerManager()->scheduleTimer(triggerPtr, (void *) 0, std::chrono::microseconds(microseconds), std::chrono::microseconds(microseconds));
+ triggerPtr->attach(baseFakeActivity);
+ // store trigger in class member
+ baseFakeActivityTrigger = triggerPtr;
+ } else {
+ std::cerr << "ERROR: could not set-up Timer with cycle-time " << microseconds << " as activation source for Task BaseFakeActivity" << std::endl;
+ }
+ }
+
+
+ // link observers with subjects
+ } catch (const std::exception &ex) {
+ std::cerr << "Uncaught std exception" << ex.what() << std::endl;
+ } catch (...) {
+ std::cerr << "Uncaught exception" << std::endl;
+ }
+}
+
+// run the component
+void ComponentRosBaseFake::run()
+{
+ stateSlave->acquire("init");
+ // startup all registered port-factories
+ for(auto portFactory = portFactoryRegistry.begin(); portFactory != portFactoryRegistry.end(); portFactory++)
+ {
+ portFactory->second->onStartup();
+ }
+
+ // startup all registered component-extensions
+ for(auto extension = componentExtensionRegistry.begin(); extension != componentExtensionRegistry.end(); extension++)
+ {
+ extension->second->onStartup();
+ }
+ stateSlave->release("init");
+
+ // do not call this handler within the init state (see above) as this handler internally calls setStartupFinished() (this should be fixed in future)
+ compHandler.onStartup();
+
+ // this call blocks until the component is commanded to shutdown
+ stateSlave->acquire("shutdown");
+
+ // shutdown all registered component-extensions
+ for(auto extension = componentExtensionRegistry.begin(); extension != componentExtensionRegistry.end(); extension++)
+ {
+ extension->second->onShutdown();
+ }
+
+ // shutdown all registered port-factories
+ for(auto portFactory = portFactoryRegistry.begin(); portFactory != portFactoryRegistry.end(); portFactory++)
+ {
+ portFactory->second->onShutdown();
+ }
+
+ if(connections.component.useLogger == true) {
+ //FIXME: use logging
+ //Smart::LOGGER->stopLogging();
+ }
+
+ compHandler.onShutdown();
+
+ stateSlave->release("shutdown");
+}
+
+// clean-up component's resources
+void ComponentRosBaseFake::fini()
+{
+ // unlink all observers
+
+ // destroy all task instances
+ // unlink all UpcallManagers
+ navigationVelocityServiceInUpcallManager->detach(baseFakeActivity);
+ // unlink the TaskTrigger
+ if(baseFakeActivityTrigger != NULL){
+ baseFakeActivityTrigger->detach(baseFakeActivity);
+ delete baseFakeActivity;
+ }
+
+ // destroy all input-handler
+
+ // destroy InputTaskTriggers and UpcallManagers
+ delete navigationVelocityServiceInInputTaskTrigger;
+ delete navigationVelocityServiceInUpcallManager;
+
+ // destroy client ports
+
+ // destroy server ports
+ delete baseStateServiceOut;
+ delete navigationVelocityServiceIn;
+ // destroy event-test handlers (if needed)
+
+ // destroy request-handlers
+
+ delete stateSlave;
+ // destroy state-change-handler
+ delete stateChangeHandler;
+
+ // destroy all master/slave ports
+ delete wiringSlave;
+
+
+ // destroy all registered component-extensions
+ for(auto extension = componentExtensionRegistry.begin(); extension != componentExtensionRegistry.end(); extension++)
+ {
+ extension->second->destroy();
+ }
+
+ // destroy all registered port-factories
+ for(auto portFactory = portFactoryRegistry.begin(); portFactory != portFactoryRegistry.end(); portFactory++)
+ {
+ portFactory->second->destroy();
+ }
+
+ // destruction of ComponentRosBaseFakeROSExtension
+
+ // destruction of OpcUaBackendComponentGeneratorExtension
+
+ // destruction of PlainOpcUaComponentRosBaseFakeExtension
+
+}
+
+void ComponentRosBaseFake::loadParameter(int argc, char *argv[])
+{
+ /*
+ Parameters can be specified via command line --filename= or -f
+
+ With this parameter present:
+ - The component will look for the file in the current working directory,
+ a path relative to the current directory or any absolute path
+ - The component will use the default values if the file cannot be found
+
+ With this parameter absent:
+ - .ini will be read from current working directory, if found there
+ - $SMART_ROOT/etc/.ini will be read otherwise
+ - Default values will be used if neither found in working directory or /etc
+ */
+ SmartACE::SmartIniParameter parameter;
+ std::ifstream parameterfile;
+ bool parameterFileFound = false;
+
+ // load parameters
+ try
+ {
+ // if paramfile is given as argument
+ if(parameter.tryAddFileFromArgs(argc,argv,"filename", 'f'))
+ {
+ parameterFileFound = true;
+ std::cout << "parameter file is loaded from an argv argument \n";
+ } else if(parameter.searchFile("ComponentRosBaseFake.ini", parameterfile)) {
+ parameterFileFound = true;
+ std::cout << "load ComponentRosBaseFake.ini parameter file\n";
+ parameter.addFile(parameterfile);
+ } else {
+ std::cout << "WARNING: ComponentRosBaseFake.ini parameter file not found! (using default values or command line arguments)\n";
+ }
+
+ // add command line arguments to allow overwriting of parameters
+ // from file
+ parameter.addCommandLineArgs(argc,argv,"component");
+
+ // initialize the naming service using the command line parameters parsed in the
+ // SmartIniParameter class. The naming service parameters are expected to be in
+ // the "component" parameter group.
+ SmartACE::NAMING::instance()->checkForHelpArg(argc,argv);
+ if(parameterFileFound)
+ {
+ if(SmartACE::NAMING::instance()->init(parameter.getAllParametersFromGroup("component")) != 0) {
+ // initialization of naming service failed
+ throw std::logic_error( " Service initialization failed!\nPossible causes could be:\n-> Erroneous configuration.\n-> Naming service not reachable.\n" );
+ }
+ } else {
+ if(SmartACE::NAMING::instance()->init(argc, argv) != 0) {
+ // initialization of naming service failed
+ throw std::logic_error( " Service initialization failed!\nPossible causes could be:\n-> Erroneous configuration.\n-> Naming service not reachable.\n" );
+ }
+ }
+
+ // print all known parameters
+ // parameter.print();
+
+ //--- server port // client port // other parameter ---
+ // load parameter
+ parameter.getString("component", "name", connections.component.name);
+ parameter.getString("component", "initialComponentMode", connections.component.initialComponentMode);
+ if(parameter.checkIfParameterExists("component", "defaultScheduler")) {
+ parameter.getString("component", "defaultScheduler", connections.component.defaultScheduler);
+ }
+ if(parameter.checkIfParameterExists("component", "useLogger")) {
+ parameter.getBoolean("component", "useLogger", connections.component.useLogger);
+ }
+
+
+ // load parameters for server BaseStateServiceOut
+ parameter.getString("BaseStateServiceOut", "serviceName", connections.baseStateServiceOut.serviceName);
+ if(parameter.checkIfParameterExists("BaseStateServiceOut", "roboticMiddleware")) {
+ parameter.getString("BaseStateServiceOut", "roboticMiddleware", connections.baseStateServiceOut.roboticMiddleware);
+ }
+ // load parameters for server NavigationVelocityServiceIn
+ parameter.getString("NavigationVelocityServiceIn", "serviceName", connections.navigationVelocityServiceIn.serviceName);
+ if(parameter.checkIfParameterExists("NavigationVelocityServiceIn", "roboticMiddleware")) {
+ parameter.getString("NavigationVelocityServiceIn", "roboticMiddleware", connections.navigationVelocityServiceIn.roboticMiddleware);
+ }
+
+ // load parameters for task BaseFakeActivity
+ parameter.getDouble("BaseFakeActivity", "minActFreqHz", connections.baseFakeActivity.minActFreq);
+ parameter.getDouble("BaseFakeActivity", "maxActFreqHz", connections.baseFakeActivity.maxActFreq);
+ parameter.getString("BaseFakeActivity", "triggerType", connections.baseFakeActivity.trigger);
+ if(connections.baseFakeActivity.trigger == "PeriodicTimer") {
+ parameter.getDouble("BaseFakeActivity", "periodicActFreqHz", connections.baseFakeActivity.periodicActFreq);
+ } else if(connections.baseFakeActivity.trigger == "DataTriggered") {
+ parameter.getString("BaseFakeActivity", "inPortRef", connections.baseFakeActivity.inPortRef);
+ parameter.getInteger("BaseFakeActivity", "prescale", connections.baseFakeActivity.prescale);
+ }
+ if(parameter.checkIfParameterExists("BaseFakeActivity", "scheduler")) {
+ parameter.getString("BaseFakeActivity", "scheduler", connections.baseFakeActivity.scheduler);
+ }
+ if(parameter.checkIfParameterExists("BaseFakeActivity", "priority")) {
+ parameter.getInteger("BaseFakeActivity", "priority", connections.baseFakeActivity.priority);
+ }
+ if(parameter.checkIfParameterExists("BaseFakeActivity", "cpuAffinity")) {
+ parameter.getInteger("BaseFakeActivity", "cpuAffinity", connections.baseFakeActivity.cpuAffinity);
+ }
+
+ // load parameters for ComponentRosBaseFakeROSExtension
+
+ // load parameters for OpcUaBackendComponentGeneratorExtension
+
+ // load parameters for PlainOpcUaComponentRosBaseFakeExtension
+
+
+ // load parameters for all registered component-extensions
+ for(auto extension = componentExtensionRegistry.begin(); extension != componentExtensionRegistry.end(); extension++)
+ {
+ extension->second->loadParameters(parameter);
+ }
+
+
+ } catch (const SmartACE::IniParameterError & e) {
+ std::cerr << e.what() << std::endl;
+ } catch (const std::exception &ex) {
+ std::cerr << "Uncaught std::exception: " << ex.what() << std::endl;
+ } catch (...) {
+ std::cerr << "Uncaught exception" << std::endl;
+ }
+}
diff --git a/ComponentRosBaseFake/smartsoft/src-gen/ComponentRosBaseFake.hh b/ComponentRosBaseFake/smartsoft/src-gen/ComponentRosBaseFake.hh
new file mode 100644
index 00000000..a8ce84f0
--- /dev/null
+++ b/ComponentRosBaseFake/smartsoft/src-gen/ComponentRosBaseFake.hh
@@ -0,0 +1,237 @@
+//--------------------------------------------------------------------------
+// Code generated by the SmartSoft MDSD Toolchain
+// The SmartSoft Toolchain has been developed by:
+//
+// Service Robotics Research Center
+// University of Applied Sciences Ulm
+// Prittwitzstr. 10
+// 89075 Ulm (Germany)
+//
+// Information about the SmartSoft MDSD Toolchain is available at:
+// www.servicerobotik-ulm.de
+//
+// Please do not modify this file. It will be re-generated
+// running the code generator.
+//--------------------------------------------------------------------------
+#ifndef _COMPONENTROSBASEFAKE_HH
+#define _COMPONENTROSBASEFAKE_HH
+
+#include