37 usingProxy(getProperty<std::string>(
"OLPName").getValue());
38 usingProxy(getProperty<std::string>(
"OLPObserverName").getValue());
39 usingProxy(getProperty<std::string>(
"ImageProviderName").getValue());
40 usingProxy(getProperty<std::string>(
"KinematicUnitName").getValue());
48 armarx::NameControlModeMap controlMode;
49 controlMode[
"Neck_1_Pitch"] = armarx::ePositionControl;
50 controlMode[
"Cameras"] = armarx::ePositionControl;
53 jointValues[
"Neck_1_Pitch"] = 0.3;
54 jointValues[
"Cameras"] = -0.3;
57 std::vector<std::string> imageFilePathsLeft, imageFilePathsRight;
65 imageFilePathsLeft.push_back(
"/homes/staff/schieben/datalog/YCB/Head/09-Frenchs-Mustard/snapshot_left_0000.bmp");
66 imageFilePathsRight.push_back(
"/homes/staff/schieben/datalog/YCB/Head/09-Frenchs-Mustard/snapshot_right_0000.bmp");
112 imageFilePathsLeft.clear();
113 imageFilePathsLeft.push_back(
"/homes/staff/schieben/datalog/YCB/Head/reco-test/img_pos/snapshot_left_0000.bmp");
114 imageFilePathsRight.push_back(
"/homes/staff/schieben/datalog/YCB/Head/reco-test/img_pos/snapshot_right_0000.bmp");
116 std::vector<std::string> objectNames;
117 objectNames.push_back(
"Orange");
119 for (
size_t objectNumber = 0; objectNumber < imageFilePathsLeft.size(); objectNumber++)
121 p->
imageProviderProxy->setImageFilePath(imageFilePathsLeft.at(objectNumber), imageFilePathsRight.at(objectNumber));
125 for (
int i = 0; i < 6; i++)
127 p->
olpProxy->recognizeObject(objectNames.at(objectNumber));
142 for (
size_t objectNumber = 0; objectNumber < imageFilePathsLeft.size(); objectNumber++)
144 p->
imageProviderProxy->setImageFilePath(imageFilePathsLeft.at(objectNumber), imageFilePathsRight.at(objectNumber));
152 p->
olpProxy->CreateInitialObjectHypotheses();
161 olpStatus = p->
olpObserverProxy->getDataField(
new armarx::DataFieldIdentifierBase(
"ObjectLearningByPushingObserver",
"objectHypotheses",
"initialHypothesesCreated"))->getInt();
163 while (olpStatus == 0);
167 ARMARX_WARNING_S <<
"Creation of initial hypotheses failed, skipping this object";
178 p->
olpProxy->ValidateInitialObjectHypotheses();
187 olpStatus = p->
olpObserverProxy->getDataField(
new armarx::DataFieldIdentifierBase(
"ObjectLearningByPushingObserver",
"objectHypotheses",
"hypothesesValidated"))->getInt();
189 while (olpStatus == 0);
193 ARMARX_WARNING_S <<
"Validation of initial hypotheses failed, skipping this object";
200 for (
int i = 2; i <= 5; i++)
204 p->
olpProxy->RevalidateConfirmedObjectHypotheses();
213 olpStatus = p->
olpObserverProxy->getDataField(
new armarx::DataFieldIdentifierBase(
"ObjectLearningByPushingObserver",
"objectHypotheses",
"hypothesesValidated"))->getInt();
215 while (olpStatus == 0);
219 ARMARX_WARNING_S <<
"Validation of hypotheses failed, skipping this object";
224 ARMARX_IMPORTANT_S <<
"Finished segmentation of object " << objectNumber + 1 <<
" of " << imageFilePathsLeft.size();
234 olpProxy = getProxy<ObjectLearningByPushingInterfacePrx>(getProperty<std::string>(
"OLPName").getValue());
235 olpObserverProxy = getProxy<ObjectLearningByPushingListenerPrx>(getProperty<std::string>(
"OLPObserverName").getValue());
236 imageProviderProxy = getProxy<ImageFileSequenceProviderInterfacePrx>(getProperty<std::string>(
"ImageProviderName").getValue());
237 kinematicUnitProxy = getProxy<armarx::KinematicUnitInterfacePrx>(getProperty<std::string>(
"KinematicUnitName").getValue());
238 bool testRecognition = getProperty<bool>(
"TestRecognition").getValue();
240 std::thread t([ =,
this ]()