Skip to content
Snippets Groups Projects
Commit f8a61a42 authored by alissa's avatar alissa
Browse files

Deleted unneccessary Code for Grasp memory server from copied example server code

parent cf5a083b
No related branches found
No related tags found
2 merge requests!195Add GraspMemory,!135Resolve "Add Grasp (Affordance) Memory"
This commit is part of merge request !135. Comments created here will be created in the context of that merge request.
......@@ -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.
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment