From f8a61a42b078c5fc3e47a7e7367a1e950ff432d6 Mon Sep 17 00:00:00 2001
From: alissa <alissamueller@outlook.de>
Date: Fri, 7 May 2021 13:06:23 +0200
Subject: [PATCH] Deleted unneccessary Code for Grasp memory server from copied
 example server code

---
 .../armem/server/GraspMemory/GraspMemory.cpp  | 25 ++-----------------
 .../armem/server/GraspMemory/GraspMemory.h    | 20 +++------------
 2 files changed, 6 insertions(+), 39 deletions(-)

diff --git a/source/RobotAPI/components/armem/server/GraspMemory/GraspMemory.cpp b/source/RobotAPI/components/armem/server/GraspMemory/GraspMemory.cpp
index 4bf9a3744..653435b4e 100644
--- a/source/RobotAPI/components/armem/server/GraspMemory/GraspMemory.cpp
+++ b/source/RobotAPI/components/armem/server/GraspMemory/GraspMemory.cpp
@@ -18,14 +18,7 @@ namespace armarx
 
         defs->topic(debugObserver);
 
-        defs->optional(p.memoryName, "memory.Name", "Name of this memory server.");
-
-        p.core._defaultSegmentsStr = simox::alg::join(p.core.defaultCoreSegments, ", ");
-        defs->optional(p.core._defaultSegmentsStr, "core.DefaultSegments",
-                       "Core segments to add on start up (just as Grasp).");
-        defs->optional(p.core.addOnUsage, "core.AddOnUsage",
-                       "If enabled, core segments are added when required by a new provider segment."
-                       "This will usually be off for most memory servers.");
+        defs->optional(memoryName, "memory.Name", "Name of this memory server.");
 
         return defs;
     }
@@ -38,16 +31,11 @@ namespace armarx
 
     void GraspMemory::onInitComponent()
     {
-        memory.name() = p.memoryName;
+        memory.name() = memoryName;
 
         // Usually, the memory server will specify a number of core segments with a specific aron type.
         memory.addCoreSegment("GraspCandidate", armarx::grasping::arondto::GraspCandidate::toInitialAronType());
 
-        // For illustration purposes, we add more segments (without types).
-        bool trim = true;
-        p.core.defaultCoreSegments = simox::alg::split(p.core._defaultSegmentsStr, ",", trim);
-        p.core._defaultSegmentsStr.clear();
-        memory.addCoreSegments(p.core.defaultCoreSegments);
     }
 
     void GraspMemory::onConnectComponent()
@@ -68,15 +56,6 @@ namespace armarx
 
     // WRITING
 
-    armem::data::AddSegmentsResult GraspMemory::addSegments(const armem::data::AddSegmentsInput& input, const Ice::Current&)
-    {
-        // This function is overloaded to trigger the remote gui rebuild.
-        armem::data::AddSegmentsResult result = ComponentPluginUser::addSegments(input, p.core.addOnUsage);
-        tab.rebuild = true;
-        return result;
-    }
-
-
     armem::data::CommitResult GraspMemory::commit(const armem::data::Commit& commit, const Ice::Current&)
     {
         // This function is overloaded to trigger the remote gui rebuild.
diff --git a/source/RobotAPI/components/armem/server/GraspMemory/GraspMemory.h b/source/RobotAPI/components/armem/server/GraspMemory/GraspMemory.h
index c3568423b..732c74a83 100644
--- a/source/RobotAPI/components/armem/server/GraspMemory/GraspMemory.h
+++ b/source/RobotAPI/components/armem/server/GraspMemory/GraspMemory.h
@@ -23,7 +23,7 @@ namespace armarx
      * Detailed description of class ExampleMemory.
      */
     class GraspMemory :
-        virtual public armarx::Component
+        virtual public Component
         , virtual public armem::server::ComponentPluginUser
         , virtual public LightweightRemoteGuiComponentPluginUser
     // , virtual public armarx::ArVizComponentPluginUser
@@ -36,7 +36,6 @@ namespace armarx
 
         // WritingInterface interface
     public:
-        armem::data::AddSegmentsResult addSegments(const armem::data::AddSegmentsInput& input, const Ice::Current&) override;
         armem::data::CommitResult commit(const armem::data::Commit& commit, const Ice::Current&) override;
 
 
@@ -48,7 +47,7 @@ namespace armarx
 
     protected:
 
-        armarx::PropertyDefinitionsPtr createPropertyDefinitions() override;
+        PropertyDefinitionsPtr createPropertyDefinitions() override;
 
         void onInitComponent() override;
         void onConnectComponent() override;
@@ -58,22 +57,11 @@ namespace armarx
 
     private:
 
-        armarx::DebugObserverInterfacePrx debugObserver;
+        DebugObserverInterfacePrx debugObserver;
 
-        struct Properties
-        {
-            std::string memoryName = "Grasp";
 
-            struct CoreSegments
-            {
-                std::vector<std::string> defaultCoreSegments = { "GraspModality", "GraspConcept" };
-                std::string _defaultSegmentsStr;
-                bool addOnUsage = false;
-            };
+        std::string memoryName = "Grasp";
 
-            CoreSegments core;
-        };
-        Properties p;
 
 
         struct RemoteGuiTab : RemoteGui::Client::Tab
-- 
GitLab