Skip to content
Snippets Groups Projects
Commit 7aac1404 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Fix query processors not transferring type

parent d1e7d772
No related branches found
No related tags found
2 merge requests!192Fix bugs in ArMem and make disk loading and storing nicer,!188ArMem Updates
...@@ -142,12 +142,10 @@ namespace armarx::armem::base ...@@ -142,12 +142,10 @@ namespace armarx::armem::base
detail::toIce(ice.aronType, coreSegment.aronType()); detail::toIce(ice.aronType, coreSegment.aronType());
ARMARX_CHECK(!coreSegment.aronType() || ice.aronType); ARMARX_CHECK(!coreSegment.aronType() || ice.aronType);
// toIce(ice.providerSegments, coreSegment.providerSegments());
ice.providerSegments.clear(); ice.providerSegments.clear();
coreSegment.forEachProviderSegment([&ice](const auto & providerSegment) coreSegment.forEachProviderSegment([&ice](const auto & providerSegment)
{ {
armem::toIce(ice.providerSegments[providerSegment.name()], providerSegment); armem::toIce(ice.providerSegments[providerSegment.name()], providerSegment);
return true;
}); });
} }
template <class ...Args> template <class ...Args>
...@@ -176,7 +174,6 @@ namespace armarx::armem::base ...@@ -176,7 +174,6 @@ namespace armarx::armem::base
memory.forEachCoreSegment([&ice](const auto & coreSegment) memory.forEachCoreSegment([&ice](const auto & coreSegment)
{ {
armem::toIce(ice.coreSegments[coreSegment.name()], coreSegment); armem::toIce(ice.coreSegments[coreSegment.name()], coreSegment);
return true;
}); });
} }
template <class ...Args> template <class ...Args>
......
#pragma once #pragma once
#include <regex> #include "BaseQueryProcessorBase.h"
#include <ArmarXCore/core/logging/Logging.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <RobotAPI/interface/armem/query.h>
#include <RobotAPI/libraries/armem/core/error.h> #include <RobotAPI/libraries/armem/core/error.h>
#include <RobotAPI/interface/armem/query.h>
#include "BaseQueryProcessorBase.h" #include <regex>
namespace armarx::armem::server::query_proc::base namespace armarx::armem::server::query_proc::base
...@@ -74,7 +71,7 @@ namespace armarx::armem::server::query_proc::base ...@@ -74,7 +71,7 @@ namespace armarx::armem::server::query_proc::base
{ {
coreSegment.forEachProviderSegment([this, &query, &result](const ProviderSegmentT & providerSegment) coreSegment.forEachProviderSegment([this, &query, &result](const ProviderSegmentT & providerSegment)
{ {
childProcessor.process(result.addProviderSegment(providerSegment.name()), query.providerSegmentQueries, providerSegment); childProcessor.process(result.addProviderSegment(providerSegment.name(), providerSegment.aronType()), query.providerSegmentQueries, providerSegment);
}); });
} }
...@@ -85,7 +82,7 @@ namespace armarx::armem::server::query_proc::base ...@@ -85,7 +82,7 @@ namespace armarx::armem::server::query_proc::base
try try
{ {
const ProviderSegmentT& providerSegment = coreSegment.getProviderSegment(query.providerSegmentName); const ProviderSegmentT& providerSegment = coreSegment.getProviderSegment(query.providerSegmentName);
childProcessor.process(result.addProviderSegment(providerSegment.name()), query.providerSegmentQueries, providerSegment); childProcessor.process(result.addProviderSegment(providerSegment.name(), providerSegment.aronType()), query.providerSegmentQueries, providerSegment);
} }
catch (const error::MissingEntry&) catch (const error::MissingEntry&)
{ {
...@@ -103,7 +100,7 @@ namespace armarx::armem::server::query_proc::base ...@@ -103,7 +100,7 @@ namespace armarx::armem::server::query_proc::base
{ {
if (std::regex_search(providerSegment.name(), regex)) if (std::regex_search(providerSegment.name(), regex))
{ {
childProcessor.process(result.addProviderSegment(providerSegment.name()), query.providerSegmentQueries, providerSegment); childProcessor.process(result.addProviderSegment(providerSegment.name(), providerSegment.aronType()), query.providerSegmentQueries, providerSegment);
} }
}); });
} }
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <RobotAPI/interface/armem/query.h> #include <RobotAPI/interface/armem/query.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h> #include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <ArmarXCore/core/logging/Logging.h>
#include <cstdint> #include <cstdint>
#include <iterator> #include <iterator>
...@@ -99,11 +98,10 @@ namespace armarx::armem::server::query_proc::base ...@@ -99,11 +98,10 @@ namespace armarx::armem::server::query_proc::base
} }
catch (const armem::error::EntityHistoryEmpty&) catch (const armem::error::EntityHistoryEmpty&)
{ {
if (false) #if 0
{ ARMARX_IMPORTANT << "Failed to retrieve latest snapshot from entity " << entity.id() << ". "
ARMARX_IMPORTANT << "Failed to retrieve latest snapshot from entity " << entity.id() << ". " << "Entity is empty.";
<< "Entity has not timestamps."; #endif
}
} }
} }
else else
...@@ -117,19 +115,18 @@ namespace armarx::armem::server::query_proc::base ...@@ -117,19 +115,18 @@ namespace armarx::armem::server::query_proc::base
catch (const armem::error::MissingEntry&) catch (const armem::error::MissingEntry&)
{ {
// Leave empty. // Leave empty.
if (false) #if 0
std::stringstream ss;
ss << "Failed to retrieve snapshot with timestamp "
<< armem::toDateTimeMilliSeconds(time)
<< " from entity " << entity.id() << ".\n"
<< "Entity has timestamps: ";
for (const Time& t : entity.getTimestamps())
{ {
std::stringstream ss; ss << "\n- " << armem::toDateTimeMilliSeconds(t);
ss << "Failed to retrieve snapshot with timestamp "
<< armem::toDateTimeMilliSeconds(time)
<< " from entity " << entity.id() << ".\n"
<< "Entity has timestamps: ";
for (const Time& t : entity.getTimestamps())
{
ss << "\n- " << armem::toDateTimeMilliSeconds(t);
}
ARMARX_IMPORTANT << ss.str();
} }
ARMARX_IMPORTANT << ss.str();
#endif
} }
} }
} }
......
...@@ -5,9 +5,6 @@ ...@@ -5,9 +5,6 @@
#include <RobotAPI/libraries/armem/core/error.h> #include <RobotAPI/libraries/armem/core/error.h>
#include <RobotAPI/interface/armem/query.h> #include <RobotAPI/interface/armem/query.h>
#include <ArmarXCore/core/logging/Logging.h>
#include <ArmarXCore/core/exceptions/local/ExpressionException.h>
#include <regex> #include <regex>
...@@ -76,7 +73,7 @@ namespace armarx::armem::server::query_proc::base ...@@ -76,7 +73,7 @@ namespace armarx::armem::server::query_proc::base
{ {
memory.forEachCoreSegment([this, &result, &query](const CoreSegmentT & coreSegment) memory.forEachCoreSegment([this, &result, &query](const CoreSegmentT & coreSegment)
{ {
childProcessor.process(result.addCoreSegment(coreSegment.name()), query.coreSegmentQueries, coreSegment); childProcessor.process(result.addCoreSegment(coreSegment.name(), coreSegment.aronType()), query.coreSegmentQueries, coreSegment);
}); });
} }
...@@ -87,7 +84,7 @@ namespace armarx::armem::server::query_proc::base ...@@ -87,7 +84,7 @@ namespace armarx::armem::server::query_proc::base
try try
{ {
const CoreSegmentT& coreSegment = memory.getCoreSegment(query.coreSegmentName); const CoreSegmentT& coreSegment = memory.getCoreSegment(query.coreSegmentName);
childProcessor.process(result.addCoreSegment(coreSegment.name()), query.coreSegmentQueries, coreSegment); childProcessor.process(result.addCoreSegment(coreSegment.name(), coreSegment.aronType()), query.coreSegmentQueries, coreSegment);
} }
catch (const error::MissingEntry&) catch (const error::MissingEntry&)
{ {
...@@ -103,7 +100,7 @@ namespace armarx::armem::server::query_proc::base ...@@ -103,7 +100,7 @@ namespace armarx::armem::server::query_proc::base
{ {
if (std::regex_search(coreSegment.name(), regex)) if (std::regex_search(coreSegment.name(), regex))
{ {
childProcessor.process(result.addCoreSegment(coreSegment.name()), query.coreSegmentQueries, coreSegment); childProcessor.process(result.addCoreSegment(coreSegment.name(), coreSegment.aronType()), query.coreSegmentQueries, coreSegment);
} }
}); });
} }
......
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