10 #include "ObjectMemoryGroupStatechartContext.generated.h"
35 if (not in.getEnable())
43 const std::string provider = in.isProviderSet() ? in.getProvider() :
"";
45 const std::vector<std::string> objectIdsString = in.getObjectIds();
49 std::stringstream info;
50 std::stringstream warn;
52 std::vector<armarx::ObjectID> objectIds;
53 for (
const std::string& idString : objectIdsString)
58 objectIds.push_back(
id);
59 info <<
"Requesting object " <<
id <<
"\n";
61 catch (
const armarx::LocalException& e)
63 warn <<
"\nGiven object ID '" << idString
64 <<
"' could not parsed as ObjectID: " << e.what();
68 auto context = getContext<ObjectMemoryGroupStatechartContext>();
75 armarx::objpose::observer::RequestObjectsInput
input;
76 input.provider = provider;
84 objpose::observer::RequestObjectsOutput output;
87 output = storage->requestObjects(
input);
89 catch (
const Ice::Exception& e)
91 ARMARX_WARNING <<
"Failed to request object localization: " << e.what();
96 for (
const auto& [
id, result] : output.results)
98 if (result.result.success)
100 info <<
"Requested object " <<
id <<
" via provider '" << result.providerName
105 warn <<
"\nFailed to request the object " <<
id <<
" for localization.";
109 if (not info.str().empty())
113 if (not warn.str().empty())
116 <<
"The following issues occurred whhen requesting objects for localization:"