43 defineOptionalProperty<std::string>(
"SimulatorProxyName",
"Simulator",
"name of dynamics simulator proxy");
44 defineOptionalProperty<std::string>(
"RobotName",
"Armar3",
"Name of robot used for calculating reference frame");
45 defineOptionalProperty<std::string>(
"ReferenceFrameName",
"EyeLeftCamera",
"Name of reference frame to use for pose");
48 defineOptionalProperty<float>(
"RecognitionCertainty", 0.9f,
"Certainty of recognition used in simulation (0...1).");
49 defineOptionalProperty<bool>(
"VisibilityCheck",
false,
"Whether to simulate camera and checking visibility within camera");
56 usingProxy(getProperty<std::string>(
"SimulatorProxyName").getValue());
58 robotName = getProperty<std::string>(
"RobotName").getValue();
59 frameName = getProperty<std::string>(
"ReferenceFrameName").getValue();
61 recognitionCertainty = getProperty<float>(
"RecognitionCertainty").getValue();
62 performVisibilityCheck = getProperty<bool>(
"VisibilityCheck").getValue();
64 if (performVisibilityCheck)
90 ARMARX_VERBOSE <<
"Simulating object localization of type " <<
getName() <<
" for robot " << robotName;
96 simulatorPrx = getProxy<SimulatorInterfacePrx>(getProperty<std::string>(
"SimulatorProxyName").getValue());
103 mean.push_back(pos(0));
104 mean.push_back(pos(1));
105 mean.push_back(pos(2));
109 posDist->setMean(
mean);
110 posDist->setCovariance(0, 0, 2.0f);
111 posDist->setCovariance(1, 1, 2.0f);
112 posDist->setCovariance(2, 2, 2.0f);
117 const memoryx::ObjectClassNameList& objectClassNames,
const Ice::Current&)
120 memoryx::ObjectLocalizationResultList resultList;
126 for (
const auto& className : objectClassNames)
130 ObjectClassInformationSequence objectInstances = simulatorPrx->getObjectClassPoses(robotName, frameName, className);
133 for (
const auto& instanceInfo : objectInstances)
135 memoryx::ObjectLocalizationResult result;
137 result.timeStamp =
new TimestampVariant(instanceInfo.timestampMicroSeconds);
140 result.objectClassName = instanceInfo.className;
146 result.position = position;
147 result.orientation = pose->getOrientation();
151 result.recognitionCertainty = recognitionCertainty;
153 resultList.push_back(result);
176 return "ObjectLocalizerDynamicSimulation";