Skip to content
Snippets Groups Projects
Commit fa95b90e authored by armar-user's avatar armar-user
Browse files

fix error in location reader to gezt locations in global frame

parent 25691dbb
No related branches found
No related tags found
No related merge requests found
......@@ -52,18 +52,22 @@ namespace armarx::armem::locations::client
std::map<std::string, armarx::navigation::location::arondto::Location>
Reader::getAllLocations()
{
auto mId = armarx::armem::MemoryID{p.memoryName, "Locations"};
auto mId = armarx::armem::MemoryID{p.memoryName, "Location"};
auto res = locationReader.getLatestSnapshotsIn(mId);
if (res.success)
{
std::map<std::string, armarx::navigation::location::arondto::Location> ret;
res.memory.forEachInstance(
[&ret](const armarx::armem::wm::EntityInstance& i)
res.memory.forEachEntity(
[&ret](const armarx::armem::wm::Entity& e)
{
auto loc = i.dataAs<armarx::navigation::location::arondto::Location>();
ret[i.id().entityName] = loc;
});
auto i = e.findLatestInstance();
if (i)
{
auto loc = i->dataAs<armarx::navigation::location::arondto::Location>();
ret[i->id().entityName] = loc;
}
});
return ret;
}
......
......@@ -37,7 +37,7 @@ namespace armarx::armem::locations
return;
}
if (simox::alg::starts_with(framedLoc.framedPose.header.agent, objPose.objectID.str()))
if (simox::alg::starts_with(objPose.objectID.str(), framedLoc.framedPose.header.agent))
{
ARMARX_CHECK(framedLoc.framedPose.header.frame ==
"root"); // TODO: Right now we only allow root
......
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