From b1c44ff1d3499d21d74c972438168f563bf71b79 Mon Sep 17 00:00:00 2001
From: Simon Ottenhaus <simon.ottenhaus@kit.edu>
Date: Mon, 18 May 2020 14:52:39 +0200
Subject: [PATCH] added component plugins

---
 .../RobotAPIComponentPlugins/CMakeLists.txt   | 14 +++++
 ...artesianPositionControlComponentPlugin.cpp | 53 +++++++++++++++++
 .../CartesianPositionControlComponentPlugin.h | 58 ++++++++++++++++++
 .../GraspCandidateObserverComponentPlugin.cpp | 54 +++++++++++++++++
 .../GraspCandidateObserverComponentPlugin.h   | 58 ++++++++++++++++++
 .../KinematicUnitComponentPlugin.cpp          | 56 ++++++++++++++++++
 .../KinematicUnitComponentPlugin.h            | 59 +++++++++++++++++++
 .../PlatformUnitComponentPlugin.cpp           | 53 +++++++++++++++++
 .../PlatformUnitComponentPlugin.h             | 58 ++++++++++++++++++
 .../RobotStateComponentPlugin.cpp             | 10 ++++
 .../RobotStateComponentPlugin.h               |  5 ++
 .../RobotUnitComponentPlugin.cpp              | 53 +++++++++++++++++
 .../RobotUnitComponentPlugin.h                | 58 ++++++++++++++++++
 .../RobotUnitObserverComponentPlugin.cpp      | 54 +++++++++++++++++
 .../RobotUnitObserverComponentPlugin.h        | 58 ++++++++++++++++++
 .../TrajectoryPlayerComponentPlugin.cpp       | 54 +++++++++++++++++
 .../TrajectoryPlayerComponentPlugin.h         | 58 ++++++++++++++++++
 17 files changed, 813 insertions(+)
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/CartesianPositionControlComponentPlugin.cpp
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/CartesianPositionControlComponentPlugin.h
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/GraspCandidateObserverComponentPlugin.cpp
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/GraspCandidateObserverComponentPlugin.h
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/KinematicUnitComponentPlugin.cpp
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/KinematicUnitComponentPlugin.h
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/PlatformUnitComponentPlugin.cpp
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/PlatformUnitComponentPlugin.h
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitComponentPlugin.cpp
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitComponentPlugin.h
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitObserverComponentPlugin.cpp
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitObserverComponentPlugin.h
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/TrajectoryPlayerComponentPlugin.cpp
 create mode 100644 source/RobotAPI/libraries/RobotAPIComponentPlugins/TrajectoryPlayerComponentPlugin.h

diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/CMakeLists.txt b/source/RobotAPI/libraries/RobotAPIComponentPlugins/CMakeLists.txt
index 1292e78fa..0be4a3ac9 100644
--- a/source/RobotAPI/libraries/RobotAPIComponentPlugins/CMakeLists.txt
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/CMakeLists.txt
@@ -13,11 +13,25 @@ set(LIB_FILES
     RobotStateComponentPlugin.cpp
     DebugDrawerHelperComponentPlugin.cpp
     ArVizComponentPlugin.cpp
+    GraspCandidateObserverComponentPlugin.cpp
+    PlatformUnitComponentPlugin.cpp
+    RobotUnitComponentPlugin.cpp
+    RobotUnitObserverComponentPlugin.cpp
+    KinematicUnitComponentPlugin.cpp
+    TrajectoryPlayerComponentPlugin.cpp
+    CartesianPositionControlComponentPlugin.cpp
 )
 set(LIB_HEADERS
     RobotStateComponentPlugin.h
     DebugDrawerHelperComponentPlugin.h
     ArVizComponentPlugin.h
+    GraspCandidateObserverComponentPlugin.h
+    PlatformUnitComponentPlugin.h
+    RobotUnitComponentPlugin.h
+    RobotUnitObserverComponentPlugin.h
+    KinematicUnitComponentPlugin.h
+    TrajectoryPlayerComponentPlugin.h
+    CartesianPositionControlComponentPlugin.h
 )
 
 armarx_add_library("${LIB_NAME}" "${LIB_FILES}" "${LIB_HEADERS}" "${LIBS}")
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/CartesianPositionControlComponentPlugin.cpp b/source/RobotAPI/libraries/RobotAPIComponentPlugins/CartesianPositionControlComponentPlugin.cpp
new file mode 100644
index 000000000..6b403e45c
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/CartesianPositionControlComponentPlugin.cpp
@@ -0,0 +1,53 @@
+#include "CartesianPositionControlComponentPlugin.h"
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        void CartesianPositionControlComponentPlugin::preOnInitComponent()
+        {
+            parent<Component>().usingProxyFromProperty(PROPERTY_NAME);
+        }
+
+        void CartesianPositionControlComponentPlugin::preOnConnectComponent()
+        {
+            parent<Component>().getProxyFromProperty(_cartesianPositionControl, PROPERTY_NAME);
+        }
+
+        void CartesianPositionControlComponentPlugin::postCreatePropertyDefinitions(armarx::PropertyDefinitionsPtr& properties)
+        {
+            if (!properties->hasDefinition(PROPERTY_NAME))
+            {
+                properties->defineRequiredProperty<std::string>(
+                    PROPERTY_NAME,
+                    "Name of the CartesianPositionControl");
+            }
+        }
+
+        CartesianPositionControlInterfacePrx CartesianPositionControlComponentPlugin::getCartesianPositionControl()
+        {
+            return _cartesianPositionControl;
+        }
+
+
+    }
+}
+
+namespace armarx
+{
+
+    CartesianPositionControlComponentPluginUser::CartesianPositionControlComponentPluginUser()
+    {
+        addPlugin(plugin);
+    }
+
+    CartesianPositionControlInterfacePrx CartesianPositionControlComponentPluginUser::getCartesianPositionControl()
+    {
+        return plugin->getCartesianPositionControl();
+    }
+
+
+}
+
+
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/CartesianPositionControlComponentPlugin.h b/source/RobotAPI/libraries/RobotAPIComponentPlugins/CartesianPositionControlComponentPlugin.h
new file mode 100644
index 000000000..0d53885cc
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/CartesianPositionControlComponentPlugin.h
@@ -0,0 +1,58 @@
+#pragma once
+
+#include <ArmarXCore/core/Component.h>
+#include <RobotAPI/interface/components/CartesianPositionControlInterface.h>
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        class CartesianPositionControlComponentPlugin : public ComponentPlugin
+        {
+        public:
+            using ComponentPlugin::ComponentPlugin;
+
+            void preOnInitComponent() override;
+
+            void preOnConnectComponent() override;
+
+            void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
+
+            CartesianPositionControlInterfacePrx getCartesianPositionControl();
+
+        private:
+            static constexpr const char* PROPERTY_NAME = "CartesianPositionControlName";
+            CartesianPositionControlInterfacePrx _cartesianPositionControl;
+        };
+
+    }
+}
+
+namespace armarx
+{
+    /**
+     * @brief Provides a ready-to-use CartesianPositionControl.
+     */
+    class CartesianPositionControlComponentPluginUser : virtual public ManagedIceObject
+    {
+    public:
+        CartesianPositionControlComponentPluginUser();
+        CartesianPositionControlInterfacePrx getCartesianPositionControl();
+
+    private:
+        armarx::plugins::CartesianPositionControlComponentPlugin* plugin = nullptr;
+    };
+
+}
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+        // Legacy typedef.
+        using CartesianPositionControlComponentPluginUser = armarx::CartesianPositionControlComponentPluginUser;
+    }
+}
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/GraspCandidateObserverComponentPlugin.cpp b/source/RobotAPI/libraries/RobotAPIComponentPlugins/GraspCandidateObserverComponentPlugin.cpp
new file mode 100644
index 000000000..3e99ccfb4
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/GraspCandidateObserverComponentPlugin.cpp
@@ -0,0 +1,54 @@
+#include "GraspCandidateObserverComponentPlugin.h"
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        void GraspCandidateObserverComponentPlugin::preOnInitComponent()
+        {
+            parent<Component>().usingProxyFromProperty(PROPERTY_NAME);
+        }
+
+        void GraspCandidateObserverComponentPlugin::preOnConnectComponent()
+        {
+            parent<Component>().getProxyFromProperty(_graspCandidateObserver, PROPERTY_NAME);
+        }
+
+        void GraspCandidateObserverComponentPlugin::postCreatePropertyDefinitions(armarx::PropertyDefinitionsPtr& properties)
+        {
+            if (!properties->hasDefinition(PROPERTY_NAME))
+            {
+                properties->defineOptionalProperty<std::string>(
+                    PROPERTY_NAME,
+                    "GraspCandidateObserver",
+                    "Name of the GraspCandidateObserver");
+            }
+        }
+
+        grasping::GraspCandidateObserverInterfacePrx GraspCandidateObserverComponentPlugin::getGraspCandidateObserver()
+        {
+            return _graspCandidateObserver;
+        }
+
+
+    }
+}
+
+namespace armarx
+{
+
+    GraspCandidateObserverComponentPluginUser::GraspCandidateObserverComponentPluginUser()
+    {
+        addPlugin(plugin);
+    }
+
+    grasping::GraspCandidateObserverInterfacePrx GraspCandidateObserverComponentPluginUser::getGraspCandidateObserver()
+    {
+        return plugin->getGraspCandidateObserver();
+    }
+
+
+}
+
+
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/GraspCandidateObserverComponentPlugin.h b/source/RobotAPI/libraries/RobotAPIComponentPlugins/GraspCandidateObserverComponentPlugin.h
new file mode 100644
index 000000000..e15688a68
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/GraspCandidateObserverComponentPlugin.h
@@ -0,0 +1,58 @@
+#pragma once
+
+#include <ArmarXCore/core/Component.h>
+#include <RobotAPI/interface/observers/GraspCandidateObserverInterface.h>
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        class GraspCandidateObserverComponentPlugin : public ComponentPlugin
+        {
+        public:
+            using ComponentPlugin::ComponentPlugin;
+
+            void preOnInitComponent() override;
+
+            void preOnConnectComponent() override;
+
+            void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
+
+            grasping::GraspCandidateObserverInterfacePrx getGraspCandidateObserver();
+
+        private:
+            static constexpr const char* PROPERTY_NAME = "GraspCandidateObserverName";
+            grasping::GraspCandidateObserverInterfacePrx _graspCandidateObserver;
+        };
+
+    }
+}
+
+namespace armarx
+{
+    /**
+     * @brief Provides a ready-to-use GraspCandidateObserver.
+     */
+    class GraspCandidateObserverComponentPluginUser : virtual public ManagedIceObject
+    {
+    public:
+        GraspCandidateObserverComponentPluginUser();
+        grasping::GraspCandidateObserverInterfacePrx getGraspCandidateObserver();
+
+    private:
+        armarx::plugins::GraspCandidateObserverComponentPlugin* plugin = nullptr;
+    };
+
+}
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+        // Legacy typedef.
+        using GraspCandidateObserverComponentPluginUser = armarx::GraspCandidateObserverComponentPluginUser;
+    }
+}
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/KinematicUnitComponentPlugin.cpp b/source/RobotAPI/libraries/RobotAPIComponentPlugins/KinematicUnitComponentPlugin.cpp
new file mode 100644
index 000000000..ba8ba16d2
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/KinematicUnitComponentPlugin.cpp
@@ -0,0 +1,56 @@
+#include "KinematicUnitComponentPlugin.h"
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        void KinematicUnitComponentPlugin::preOnInitComponent()
+        {
+            parent<Component>().usingProxyFromProperty(PROPERTY_NAME);
+        }
+
+        void KinematicUnitComponentPlugin::preOnConnectComponent()
+        {
+            parent<Component>().getProxyFromProperty(_kinematicUnit, PROPERTY_NAME);
+        }
+
+        void KinematicUnitComponentPlugin::postCreatePropertyDefinitions(armarx::PropertyDefinitionsPtr& properties)
+        {
+            if (!properties->hasDefinition(PROPERTY_NAME))
+            {
+                properties->defineRequiredProperty<std::string>(
+                    PROPERTY_NAME,
+                    "Name of the KinematicUnit");
+            }
+        }
+
+        KinematicUnitInterfacePrx KinematicUnitComponentPlugin::getKinematicUnit()
+        {
+            return _kinematicUnit;
+        }
+
+
+    }
+
+}
+
+namespace armarx
+{
+
+    KinematicUnitComponentPluginUser::KinematicUnitComponentPluginUser()
+    {
+        addPlugin(plugin);
+    }
+
+    KinematicUnitInterfacePrx KinematicUnitComponentPluginUser::getKinematicUnit()
+    {
+        return plugin->getKinematicUnit();
+    }
+
+
+
+
+}
+
+
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/KinematicUnitComponentPlugin.h b/source/RobotAPI/libraries/RobotAPIComponentPlugins/KinematicUnitComponentPlugin.h
new file mode 100644
index 000000000..e3b4062b5
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/KinematicUnitComponentPlugin.h
@@ -0,0 +1,59 @@
+#pragma once
+
+#include <ArmarXCore/core/Component.h>
+#include <RobotAPI/interface/units/KinematicUnitInterface.h>
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        class KinematicUnitComponentPlugin : public ComponentPlugin
+        {
+        public:
+            using ComponentPlugin::ComponentPlugin;
+
+            void preOnInitComponent() override;
+
+            void preOnConnectComponent() override;
+
+            void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
+
+            KinematicUnitInterfacePrx getKinematicUnit();
+
+        private:
+            static constexpr const char* PROPERTY_NAME = "KinematicUnitName";
+            KinematicUnitInterfacePrx _kinematicUnit;
+        };
+
+    }
+}
+
+namespace armarx
+{
+    /**
+     * @brief Provides a ready-to-use KinematicUnit.
+     */
+    class KinematicUnitComponentPluginUser : virtual public ManagedIceObject
+    {
+    public:
+        KinematicUnitComponentPluginUser();
+        KinematicUnitInterfacePrx getKinematicUnit();
+
+    private:
+        armarx::plugins::KinematicUnitComponentPlugin* plugin = nullptr;
+    };
+
+
+}
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+        // Legacy typedef.
+        using KinematicUnitComponentPluginUser = armarx::KinematicUnitComponentPluginUser;
+    }
+}
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/PlatformUnitComponentPlugin.cpp b/source/RobotAPI/libraries/RobotAPIComponentPlugins/PlatformUnitComponentPlugin.cpp
new file mode 100644
index 000000000..f40b6cd34
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/PlatformUnitComponentPlugin.cpp
@@ -0,0 +1,53 @@
+#include "PlatformUnitComponentPlugin.h"
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        void PlatformUnitComponentPlugin::preOnInitComponent()
+        {
+            parent<Component>().usingProxyFromProperty(PROPERTY_NAME);
+        }
+
+        void PlatformUnitComponentPlugin::preOnConnectComponent()
+        {
+            parent<Component>().getProxyFromProperty(_platformUnit, PROPERTY_NAME);
+        }
+
+        void PlatformUnitComponentPlugin::postCreatePropertyDefinitions(armarx::PropertyDefinitionsPtr& properties)
+        {
+            if (!properties->hasDefinition(PROPERTY_NAME))
+            {
+                properties->defineRequiredProperty<std::string>(
+                    PROPERTY_NAME,
+                    "Name of the PlatformUnit");
+            }
+        }
+
+        PlatformUnitInterfacePrx PlatformUnitComponentPlugin::getPlatformUnit()
+        {
+            return _platformUnit;
+        }
+
+
+    }
+}
+
+namespace armarx
+{
+
+    PlatformUnitComponentPluginUser::PlatformUnitComponentPluginUser()
+    {
+        addPlugin(plugin);
+    }
+
+    PlatformUnitInterfacePrx PlatformUnitComponentPluginUser::getPlatformUnit()
+    {
+        return plugin->getPlatformUnit();
+    }
+
+
+}
+
+
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/PlatformUnitComponentPlugin.h b/source/RobotAPI/libraries/RobotAPIComponentPlugins/PlatformUnitComponentPlugin.h
new file mode 100644
index 000000000..d2cec0f45
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/PlatformUnitComponentPlugin.h
@@ -0,0 +1,58 @@
+#pragma once
+
+#include <ArmarXCore/core/Component.h>
+#include <RobotAPI/interface/units/PlatformUnitInterface.h>
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        class PlatformUnitComponentPlugin : public ComponentPlugin
+        {
+        public:
+            using ComponentPlugin::ComponentPlugin;
+
+            void preOnInitComponent() override;
+
+            void preOnConnectComponent() override;
+
+            void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
+
+            PlatformUnitInterfacePrx getPlatformUnit();
+
+        private:
+            static constexpr const char* PROPERTY_NAME = "PlatformUnitName";
+            PlatformUnitInterfacePrx _platformUnit;
+        };
+
+    }
+}
+
+namespace armarx
+{
+    /**
+     * @brief Provides a ready-to-use PlatformUnit.
+     */
+    class PlatformUnitComponentPluginUser : virtual public ManagedIceObject
+    {
+    public:
+        PlatformUnitComponentPluginUser();
+        PlatformUnitInterfacePrx getPlatformUnit();
+
+    private:
+        armarx::plugins::PlatformUnitComponentPlugin* plugin = nullptr;
+    };
+
+}
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+        // Legacy typedef.
+        using PlatformUnitComponentPluginUser = armarx::PlatformUnitComponentPluginUser;
+    }
+}
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.cpp b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.cpp
index 500ac2a18..687092e13 100644
--- a/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.cpp
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.cpp
@@ -130,6 +130,11 @@ namespace armarx::plugins
         }
     }
 
+    RobotStateComponentInterfacePrx RobotStateComponentPlugin::getRobotStateComponent()
+    {
+        return _robotStateComponent;
+    }
+
     bool RobotStateComponentPlugin::synchronizeLocalClone(const VirtualRobot::RobotPtr& robot) const
     {
         return RemoteRobot::synchronizeLocalClone(robot, _robotStateComponent);
@@ -295,6 +300,11 @@ namespace armarx
         getRobotStateComponentPlugin().setRobotRNSAndNode(id, rnsName, nodeName);
     }
 
+    RobotStateComponentInterfacePrx RobotStateComponentPluginUser::getRobotStateComponent()
+    {
+        return getRobotStateComponentPlugin().getRobotStateComponent();
+    }
+
     bool RobotStateComponentPluginUser::synchronizeLocalClone(const VirtualRobot::RobotPtr& robot) const
     {
         return getRobotStateComponentPlugin().synchronizeLocalClone(robot);
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.h b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.h
index 846de6628..0f2bb620c 100644
--- a/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.h
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotStateComponentPlugin.h
@@ -82,6 +82,8 @@ namespace armarx::plugins
         VirtualRobot::RobotPtr getRobot(const std::string& id) const;
         RobotData getRobotData(const std::string& id) const;
         void setRobotRNSAndNode(const std::string& id, const std::string& rnsName, const std::string& nodeName);
+
+        RobotStateComponentInterfacePrx getRobotStateComponent();
         //sync
     public:
         bool synchronizeLocalClone(const VirtualRobot::RobotPtr& robot) const;
@@ -184,6 +186,9 @@ namespace armarx
         VirtualRobot::RobotPtr getRobot(const std::string& id) const;
         RobotStateComponentPlugin::RobotData getRobotData(const std::string& id) const;
         void setRobotRNSAndNode(const std::string& id, const std::string& rnsName, const std::string& nodeName);
+
+        RobotStateComponentInterfacePrx getRobotStateComponent();
+
         //sync
     public:
         bool synchronizeLocalClone(const VirtualRobot::RobotPtr& robot) const;
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitComponentPlugin.cpp b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitComponentPlugin.cpp
new file mode 100644
index 000000000..383de616a
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitComponentPlugin.cpp
@@ -0,0 +1,53 @@
+#include "RobotUnitComponentPlugin.h"
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        void RobotUnitComponentPlugin::preOnInitComponent()
+        {
+            parent<Component>().usingProxyFromProperty(PROPERTY_NAME);
+        }
+
+        void RobotUnitComponentPlugin::preOnConnectComponent()
+        {
+            parent<Component>().getProxyFromProperty(_robotUnit, PROPERTY_NAME);
+        }
+
+        void RobotUnitComponentPlugin::postCreatePropertyDefinitions(armarx::PropertyDefinitionsPtr& properties)
+        {
+            if (!properties->hasDefinition(PROPERTY_NAME))
+            {
+                properties->defineRequiredProperty<std::string>(
+                    PROPERTY_NAME,
+                    "Name of the RobotUnit");
+            }
+        }
+
+        RobotUnitInterfacePrx RobotUnitComponentPlugin::getRobotUnit()
+        {
+            return _robotUnit;
+        }
+
+
+    }
+}
+
+namespace armarx
+{
+
+    RobotUnitComponentPluginUser::RobotUnitComponentPluginUser()
+    {
+        addPlugin(plugin);
+    }
+
+    RobotUnitInterfacePrx RobotUnitComponentPluginUser::getRobotUnit()
+    {
+        return plugin->getRobotUnit();
+    }
+
+
+}
+
+
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitComponentPlugin.h b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitComponentPlugin.h
new file mode 100644
index 000000000..4dc53dcb9
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitComponentPlugin.h
@@ -0,0 +1,58 @@
+#pragma once
+
+#include <ArmarXCore/core/Component.h>
+#include <RobotAPI/interface/units/RobotUnit/RobotUnitInterface.h>
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        class RobotUnitComponentPlugin : public ComponentPlugin
+        {
+        public:
+            using ComponentPlugin::ComponentPlugin;
+
+            void preOnInitComponent() override;
+
+            void preOnConnectComponent() override;
+
+            void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
+
+            RobotUnitInterfacePrx getRobotUnit();
+
+        private:
+            static constexpr const char* PROPERTY_NAME = "RobotUnitName";
+            RobotUnitInterfacePrx _robotUnit;
+        };
+
+    }
+}
+
+namespace armarx
+{
+    /**
+     * @brief Provides a ready-to-use RobotUnit.
+     */
+    class RobotUnitComponentPluginUser : virtual public ManagedIceObject
+    {
+    public:
+        RobotUnitComponentPluginUser();
+        RobotUnitInterfacePrx getRobotUnit();
+
+    private:
+        armarx::plugins::RobotUnitComponentPlugin* plugin = nullptr;
+    };
+
+}
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+        // Legacy typedef.
+        using RobotUnitComponentPluginUser = armarx::RobotUnitComponentPluginUser;
+    }
+}
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitObserverComponentPlugin.cpp b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitObserverComponentPlugin.cpp
new file mode 100644
index 000000000..284533cf1
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitObserverComponentPlugin.cpp
@@ -0,0 +1,54 @@
+#include "RobotUnitObserverComponentPlugin.h"
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        void RobotUnitObserverComponentPlugin::preOnInitComponent()
+        {
+            parent<Component>().usingProxyFromProperty(PROPERTY_NAME);
+        }
+
+        void RobotUnitObserverComponentPlugin::preOnConnectComponent()
+        {
+            parent<Component>().getProxyFromProperty(_robotUnitObserver, PROPERTY_NAME);
+        }
+
+        void RobotUnitObserverComponentPlugin::postCreatePropertyDefinitions(armarx::PropertyDefinitionsPtr& properties)
+        {
+            if (!properties->hasDefinition(PROPERTY_NAME))
+            {
+                properties->defineOptionalProperty<std::string>(
+                    PROPERTY_NAME,
+                    "RobotUnitObserver",
+                    "Name of the RobotUnitObserver");
+            }
+        }
+
+        ObserverInterfacePrx RobotUnitObserverComponentPlugin::getRobotUnitObserver()
+        {
+            return _robotUnitObserver;
+        }
+
+
+    }
+}
+
+namespace armarx
+{
+
+    RobotUnitObserverComponentPluginUser::RobotUnitObserverComponentPluginUser()
+    {
+        addPlugin(plugin);
+    }
+
+    ObserverInterfacePrx RobotUnitObserverComponentPluginUser::getRobotUnitObserver()
+    {
+        return plugin->getRobotUnitObserver();
+    }
+
+
+}
+
+
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitObserverComponentPlugin.h b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitObserverComponentPlugin.h
new file mode 100644
index 000000000..0ebeff910
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/RobotUnitObserverComponentPlugin.h
@@ -0,0 +1,58 @@
+#pragma once
+
+#include <ArmarXCore/core/Component.h>
+#include <ArmarXCore/interface/observers/ObserverInterface.h>
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        class RobotUnitObserverComponentPlugin : public ComponentPlugin
+        {
+        public:
+            using ComponentPlugin::ComponentPlugin;
+
+            void preOnInitComponent() override;
+
+            void preOnConnectComponent() override;
+
+            void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
+
+            ObserverInterfacePrx getRobotUnitObserver();
+
+        private:
+            static constexpr const char* PROPERTY_NAME = "RobotUnitObserverName";
+            ObserverInterfacePrx _robotUnitObserver;
+        };
+
+    }
+}
+
+namespace armarx
+{
+    /**
+     * @brief Provides a ready-to-use RobotUnitObserver.
+     */
+    class RobotUnitObserverComponentPluginUser : virtual public ManagedIceObject
+    {
+    public:
+        RobotUnitObserverComponentPluginUser();
+        ObserverInterfacePrx getRobotUnitObserver();
+
+    private:
+        armarx::plugins::RobotUnitObserverComponentPlugin* plugin = nullptr;
+    };
+
+}
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+        // Legacy typedef.
+        using RobotUnitObserverComponentPluginUser = armarx::RobotUnitObserverComponentPluginUser;
+    }
+}
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/TrajectoryPlayerComponentPlugin.cpp b/source/RobotAPI/libraries/RobotAPIComponentPlugins/TrajectoryPlayerComponentPlugin.cpp
new file mode 100644
index 000000000..1de30ae07
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/TrajectoryPlayerComponentPlugin.cpp
@@ -0,0 +1,54 @@
+#include "TrajectoryPlayerComponentPlugin.h"
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        void TrajectoryPlayerComponentPlugin::preOnInitComponent()
+        {
+            parent<Component>().usingProxyFromProperty(PROPERTY_NAME);
+        }
+
+        void TrajectoryPlayerComponentPlugin::preOnConnectComponent()
+        {
+            parent<Component>().getProxyFromProperty(_trajectoryPlayer, PROPERTY_NAME);
+        }
+
+        void TrajectoryPlayerComponentPlugin::postCreatePropertyDefinitions(armarx::PropertyDefinitionsPtr& properties)
+        {
+            if (!properties->hasDefinition(PROPERTY_NAME))
+            {
+                properties->defineOptionalProperty<std::string>(
+                    PROPERTY_NAME,
+                    "TrajectoryPlayer",
+                    "Name of the TrajectoryPlayer");
+            }
+        }
+
+        TrajectoryPlayerInterfacePrx TrajectoryPlayerComponentPlugin::getTrajectoryPlayer()
+        {
+            return _trajectoryPlayer;
+        }
+
+
+    }
+}
+
+namespace armarx
+{
+
+    TrajectoryPlayerComponentPluginUser::TrajectoryPlayerComponentPluginUser()
+    {
+        addPlugin(plugin);
+    }
+
+    TrajectoryPlayerInterfacePrx TrajectoryPlayerComponentPluginUser::getTrajectoryPlayer()
+    {
+        return plugin->getTrajectoryPlayer();
+    }
+
+
+}
+
+
diff --git a/source/RobotAPI/libraries/RobotAPIComponentPlugins/TrajectoryPlayerComponentPlugin.h b/source/RobotAPI/libraries/RobotAPIComponentPlugins/TrajectoryPlayerComponentPlugin.h
new file mode 100644
index 000000000..3fc52df85
--- /dev/null
+++ b/source/RobotAPI/libraries/RobotAPIComponentPlugins/TrajectoryPlayerComponentPlugin.h
@@ -0,0 +1,58 @@
+#pragma once
+
+#include <ArmarXCore/core/Component.h>
+#include <RobotAPI/interface/components/TrajectoryPlayerInterface.h>
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+
+        class TrajectoryPlayerComponentPlugin : public ComponentPlugin
+        {
+        public:
+            using ComponentPlugin::ComponentPlugin;
+
+            void preOnInitComponent() override;
+
+            void preOnConnectComponent() override;
+
+            void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
+
+            TrajectoryPlayerInterfacePrx getTrajectoryPlayer();
+
+        private:
+            static constexpr const char* PROPERTY_NAME = "TrajectoryPlayerName";
+            TrajectoryPlayerInterfacePrx _trajectoryPlayer;
+        };
+
+    }
+}
+
+namespace armarx
+{
+    /**
+     * @brief Provides a ready-to-use TrajectoryPlayer.
+     */
+    class TrajectoryPlayerComponentPluginUser : virtual public ManagedIceObject
+    {
+    public:
+        TrajectoryPlayerComponentPluginUser();
+        TrajectoryPlayerInterfacePrx getTrajectoryPlayer();
+
+    private:
+        armarx::plugins::TrajectoryPlayerComponentPlugin* plugin = nullptr;
+    };
+
+}
+
+
+namespace armarx
+{
+    namespace plugins
+    {
+        // Legacy typedef.
+        using TrajectoryPlayerComponentPluginUser = armarx::TrajectoryPlayerComponentPluginUser;
+    }
+}
-- 
GitLab