diff --git a/source/RobotAPI/components/InteractiveMemoryEditor/Editor.cpp b/source/RobotAPI/components/InteractiveMemoryEditor/Editor.cpp index 889375b71708eadc773a613bbd5400d930467cad..a6a66ded128ee1158537daa4a7f605932b37474a 100644 --- a/source/RobotAPI/components/InteractiveMemoryEditor/Editor.cpp +++ b/source/RobotAPI/components/InteractiveMemoryEditor/Editor.cpp @@ -110,7 +110,7 @@ namespace armarx providing.timestamp = DateTime::Now(); } - if (current.confidence > 0) + if (current.confidence > properties.confidenceThreshold) { remainingPoses.push_back(current); } @@ -130,7 +130,10 @@ namespace armarx for (objpose::ObjectPose & objectPose: storedPoses) { - visualizeObject(objectPose); + if (objectPose.confidence > properties.confidenceThreshold) + { + visualizeObject(objectPose); + } } changes.visualizeNewObjects(this); diff --git a/source/RobotAPI/components/InteractiveMemoryEditor/Editor.h b/source/RobotAPI/components/InteractiveMemoryEditor/Editor.h index e56a3d51ab55122f7a884c8ed63d8ae7463dacef..fea9dcc1489cb02324e6654ff826c49de19a9341 100644 --- a/source/RobotAPI/components/InteractiveMemoryEditor/Editor.h +++ b/source/RobotAPI/components/InteractiveMemoryEditor/Editor.h @@ -18,6 +18,7 @@ namespace armarx { std::string providerName; float const& objectScaling; + float const& confidenceThreshold; }; explicit Editor(viz::Client& client, diff --git a/source/RobotAPI/components/InteractiveMemoryEditor/InteractiveMemoryEditor.cpp b/source/RobotAPI/components/InteractiveMemoryEditor/InteractiveMemoryEditor.cpp index 4328ec8f5058c9554c574c0b256307c62fe95436..0d5b646a8fe83ffbc1b5c87b0b6ce8884779d413 100644 --- a/source/RobotAPI/components/InteractiveMemoryEditor/InteractiveMemoryEditor.cpp +++ b/source/RobotAPI/components/InteractiveMemoryEditor/InteractiveMemoryEditor.cpp @@ -16,6 +16,9 @@ namespace armarx defs->optional(this->objectScaling, "Editor.ObjectScaling", "Scaling factor that is applied to all intractable objects."); + defs->optional(this->confidenceThreshold, "Editor.ConfidenceThreshold", + "Only objects with a confidence greater than this value are shown."); + return defs; } @@ -63,7 +66,12 @@ namespace armarx objpose::ObjectPoseClient client = getClient(); - Editor::Properties properties = { .providerName = getName(), .objectScaling = objectScaling }; + Editor::Properties properties = + { + .providerName = getName(), + .objectScaling = objectScaling, + .confidenceThreshold = confidenceThreshold + }; Editor editor(arviz, properties, [&](objpose::ProvidedObjectPoseSeq &poses) diff --git a/source/RobotAPI/components/InteractiveMemoryEditor/InteractiveMemoryEditor.h b/source/RobotAPI/components/InteractiveMemoryEditor/InteractiveMemoryEditor.h index a4dc5235452ee715c71bed99ed0b9dd16290bf73..2a9890d75b3fc386c1500fc5397344bd08951fe7 100644 --- a/source/RobotAPI/components/InteractiveMemoryEditor/InteractiveMemoryEditor.h +++ b/source/RobotAPI/components/InteractiveMemoryEditor/InteractiveMemoryEditor.h @@ -41,6 +41,7 @@ namespace armarx objpose::ProviderInfo providerInfo; float objectScaling = 1.01F; + float confidenceThreshold = 0.0F; armarx::SimpleRunningTask<>::pointer_type objectVizTask; };