Skip to content
Snippets Groups Projects
Commit 38e8a62d authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add single shot option to ObjectPoseProviderExample

parent ad2cb83b
No related branches found
No related tags found
No related merge requests found
......@@ -135,6 +135,15 @@
# ArmarX.ObjectPoseProviderExample.Objects = KIT/Amicelli, KIT/YellowSaltCylinder
# ArmarX.ObjectPoseProviderExample.SingleShot: If true, publishes only one snapshot.
# Attributes:
# - Default: false
# - Case sensitivity: yes
# - Required: no
# - Possible values: {0, 1, false, no, true, yes}
# ArmarX.ObjectPoseProviderExample.SingleShot = false
# ArmarX.ObjectPoseProviderExample.tpc.pub.DebugObserver: Name of the `DebugObserver` topic to publish data to.
# Attributes:
# - Default: DebugObserver
......
......@@ -42,6 +42,8 @@ namespace armarx
defs->optional(initialObjectIDs, "Objects", "Object IDs of objects to be tracked.")
.map(simox::alg::join(initialObjectIDs, ", "), initialObjectIDs);
defs->optional(singleShot, "SingleShot", "If true, publishes only one snapshot.");
return defs;
}
......@@ -172,6 +174,11 @@ namespace armarx
ARMARX_VERBOSE << "Reporting " << poses.size() << " object poses";
objectPoseTopic->reportObjectPoses(getName(), poses);
if (singleShot)
{
break;
}
cycle.waitForCycleDuration();
}
}
......
......@@ -102,6 +102,8 @@ namespace armarx
armarx::ObjectFinder objectFinder;
std::vector<std::string> initialObjectIDs = { "KIT/Amicelli", "KIT/YellowSaltCylinder" };
bool singleShot = false;
armarx::SimpleRunningTask<>::pointer_type poseEstimationTask;
......
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