From 2f3326fdfecad75fe7a1047e694a6857ba78b6aa Mon Sep 17 00:00:00 2001
From: Mirko Waechter <mirko.waechter@kit.edu>
Date: Thu, 14 Aug 2014 16:21:12 +0200
Subject: [PATCH] Added HandUnitObserver

---
 source/RobotAPI/applications/CMakeLists.txt   |  2 +
 .../HandUnitObserver/CMakeLists.txt           | 16 ++++++
 .../HandUnitObserver/HandUnitObserverApp.h    | 54 +++++++++++++++++++
 .../applications/HandUnitObserver/main.cpp    | 33 ++++++++++++
 source/RobotAPI/units/HandUnitObserver.h      |  2 +-
 5 files changed, 106 insertions(+), 1 deletion(-)
 create mode 100644 source/RobotAPI/applications/HandUnitObserver/CMakeLists.txt
 create mode 100644 source/RobotAPI/applications/HandUnitObserver/HandUnitObserverApp.h
 create mode 100644 source/RobotAPI/applications/HandUnitObserver/main.cpp

diff --git a/source/RobotAPI/applications/CMakeLists.txt b/source/RobotAPI/applications/CMakeLists.txt
index 343addf16..63328dbb3 100644
--- a/source/RobotAPI/applications/CMakeLists.txt
+++ b/source/RobotAPI/applications/CMakeLists.txt
@@ -20,3 +20,5 @@ add_subdirectory(PlatformUnitSimulation)
 add_subdirectory(PlatformUnitObserver)
 add_subdirectory(RobotStateComponent)
 add_subdirectory(RobotStateObserver)
+
+add_subdirectory(HandUnitObserver)
\ No newline at end of file
diff --git a/source/RobotAPI/applications/HandUnitObserver/CMakeLists.txt b/source/RobotAPI/applications/HandUnitObserver/CMakeLists.txt
new file mode 100644
index 000000000..ddfca935c
--- /dev/null
+++ b/source/RobotAPI/applications/HandUnitObserver/CMakeLists.txt
@@ -0,0 +1,16 @@
+armarx_component_set_name("HandUnitObserverApp")
+
+#find_package(MyLib QUIET)
+#armarx_build_if(MyLib_FOUND "MyLib not available")
+#
+# all include_directories must be guarded by if(Xyz_FOUND)
+# for multiple libraries write: if(X_FOUND AND Y_FOUND)....
+#if(MyLib_FOUND)
+#    include_directories(${MyLib_INCLUDE_DIRS})
+#endif()
+
+set(COMPONENT_LIBS RobotAPIUnits ArmarXInterfaces ArmarXCore)
+
+set(EXE_SOURCE main.cpp)
+
+armarx_add_component_executable("${EXE_SOURCE}")
diff --git a/source/RobotAPI/applications/HandUnitObserver/HandUnitObserverApp.h b/source/RobotAPI/applications/HandUnitObserver/HandUnitObserverApp.h
new file mode 100644
index 000000000..3a8cbcf77
--- /dev/null
+++ b/source/RobotAPI/applications/HandUnitObserver/HandUnitObserverApp.h
@@ -0,0 +1,54 @@
+/*
+ * This file is part of ArmarX.
+ *
+ * ArmarX is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * ArmarX is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @package    RobotAPI::application::HandUnitObserver
+ * @author     Mirko Waechter ( mirko dot waechter at kit dot edu )
+ * @date       2014
+ * @copyright  http://www.gnu.org/licenses/gpl.txt
+ *             GNU General Public License
+ */
+
+#ifndef _ARMARX_APPLICATION_RobotAPI_HandUnitObserver_H
+#define _ARMARX_APPLICATION_RobotAPI_HandUnitObserver_H
+
+
+ #include <RobotAPI/units/HandUnitObserver.h>
+
+#include <Core/core/application/Application.h>
+
+namespace armarx
+{
+    /**
+     * @class HandUnitObserverApp
+     * @brief A brief description
+     *
+     * Detailed Description
+     */
+    class HandUnitObserverApp :
+        virtual public armarx::Application
+    {
+        /**
+         * @see armarx::Application::setup()
+         */
+        void setup(const ManagedIceObjectRegistryInterfacePtr& registry,
+                   Ice::PropertiesPtr properties)
+        {
+            registry->addObject( Component::create<HandUnitObserver>(properties) );
+        }
+    };
+}
+
+#endif
diff --git a/source/RobotAPI/applications/HandUnitObserver/main.cpp b/source/RobotAPI/applications/HandUnitObserver/main.cpp
new file mode 100644
index 000000000..340d40964
--- /dev/null
+++ b/source/RobotAPI/applications/HandUnitObserver/main.cpp
@@ -0,0 +1,33 @@
+/*
+ * This file is part of ArmarX.
+ *
+ * ArmarX is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * ArmarX is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * @package    RobotAPI::application::HandUnitObserver
+ * @author     Mirko Waechter ( mirko dot waechter at kit dot edu )
+ * @date       2014
+ * @copyright  http://www.gnu.org/licenses/gpl.txt
+ *             GNU General Public License
+ */
+
+#include "HandUnitObserverApp.h"
+#include <Core/core/logging/Logging.h>
+
+int main(int argc, char* argv[])
+{
+    armarx::ApplicationPtr app = armarx::Application::createInstance < armarx::HandUnitObserverApp > ();
+    app->setName("HandUnitObserver");
+
+    return app->main(argc, argv);
+}
diff --git a/source/RobotAPI/units/HandUnitObserver.h b/source/RobotAPI/units/HandUnitObserver.h
index 74d9a20d5..98134d4fd 100644
--- a/source/RobotAPI/units/HandUnitObserver.h
+++ b/source/RobotAPI/units/HandUnitObserver.h
@@ -48,7 +48,7 @@ namespace armarx
             virtual public HandUnitListener
     {
     public:
-        HandUnitObserver();
+        HandUnitObserver(){}
 
         //void setTopicName(std::string topicName);
 
-- 
GitLab