6 #include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
7 #include <RobotAPI/interface/armem/server/ReadingMemoryInterface.h>
20 #include <armarx/navigation/human/aron/Human.aron.generated.h>
64 return "mem.nav.human.";
82 ARMARX_CHECK(providerSegment.
size() == 1) <<
"There should be only one entity!";
88 ARMARX_CHECK(not entitySnapshot.empty()) <<
"No entity snapshot instances";
90 entitySnapshot.forEachInstance(
93 const Duration dtToNow = timestamp - entityInstance.
metadata().referencedTime;
98 navigation::human::arondto::Human::FromAron(entityInstance.data());
100 navigation::human::Human human;
101 fromAron(dto, human);
102 humans.push_back(human);
118 ARMARX_CHECK(providerSegment.
size() == 1) <<
"There should be only one entity!";
124 ARMARX_CHECK(not entitySnapshot.empty()) <<
"No entity snapshot instances";
126 entitySnapshot.forEachInstance(
129 const Duration dtToNow = timestamp - entityInstance.
metadata().referencedTime;
131 if (dtToNow < maxAge and dtToNow.
isPositive())
133 const auto dto = navigation::human::arondto::HumanGroup::FromAron(
134 entityInstance.data());
136 navigation::human::HumanGroup human;
137 fromAron(dto, human);
138 humans.push_back(human);
146 Reader::HumanGroupResult
155 ARMARX_DEBUG <<
"[MappingDataReader] result: " << qResult;
157 if (not qResult.success)
159 ARMARX_WARNING <<
"Failed to query data from memory: " << qResult.errorMessage;
160 return {.groups = {},
161 .status = HumanGroupResult::Status::Error,
162 .errorMessage = qResult.errorMessage};
165 const auto coreSegment = qResult.memory.getCoreSegment(
properties().coreSegmentName);
167 if (not coreSegment.hasProviderSegment(query.
providerName))
170 return {.groups = {}, .status = HumanGroupResult::Status::NoData};
176 if (providerSegment.
empty())
179 return {.groups = {},
180 .status = HumanGroupResult::Status::NoData,
181 .errorMessage =
"No entities"};
188 .status = HumanGroupResult::Status::Success};
193 .status = HumanGroupResult::Status::Error,
208 ARMARX_DEBUG <<
"[MappingDataReader] result: " << qResult;
210 if (not qResult.success)
212 ARMARX_WARNING <<
"Failed to query data from memory: " << qResult.errorMessage;
213 return {.humans = {},
214 .status = HumanResult::Status::Error,
215 .errorMessage = qResult.errorMessage};
218 const auto coreSegment = qResult.memory.getCoreSegment(
properties().coreSegmentName);
220 if (not coreSegment.hasProviderSegment(query.
providerName))
223 <<
"` does not exist (yet).";
224 return {.humans = {}, .status = HumanResult::Status::NoData};
230 if (providerSegment.
empty())
234 .humans = {}, .status = HumanResult::Status::NoData, .errorMessage =
"No entities"};
240 .status = HumanResult::Status::Success};
245 .status = HumanResult::Status::Error,