Go to the documentation of this file.
6 #include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
7 #include <RobotAPI/interface/armem/server/ReadingMemoryInterface.h>
46 return "mem.nav.costmap.";
60 ARMARX_CHECK(providerSegment.
size() == 1) <<
"There should be only one entity!";
67 ARMARX_CHECK(not entitySnapshot.empty()) <<
"No entity snapshot instances";
69 entityInstance = &entitySnapshot.getInstance(0);
85 ARMARX_DEBUG <<
"[MappingDataReader] result: " << qResult;
87 if (not qResult.success)
89 ARMARX_WARNING <<
"Failed to query data from memory: " << qResult.errorMessage;
90 return {.costmap = std::nullopt,
91 .status = Result::Status::Error,
92 .errorMessage = qResult.errorMessage};
95 const auto coreSegment = qResult.memory.getCoreSegment(
properties().coreSegmentName);
97 if (not coreSegment.hasProviderSegment(
query.providerName))
100 <<
"` does not exist (yet).";
101 return {.
costmap = std::nullopt, .status = Result::Status::NoData};
105 coreSegment.getProviderSegment(
query.providerName);
107 if (providerSegment.
empty())
110 return {.costmap = std::nullopt,
111 .status = Result::Status::NoData,
112 .errorMessage =
"No entities"};
EntitySelector & all() override
const Properties & properties() const
EntitySelector & entities()
Start specifying entities.
::armarx::armem::client::query::Builder buildQuery(const Query &query) const
Client-side working memory provider segment.
const std::string CostmapCoreSegmentName
Client-side working entity instance.
Costmap fromAron(const armem::wm::EntityInstance &entityInstance)
auto & getLatestSnapshot(int snapshotIndex=0)
Retrieve the latest entity snapshot.
SnapshotSelector & snapshots()
Start specifying entity snapshots.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
std::string propertyPrefix() const override
const std::string NavigationMemoryName
Result query(const Query &query) const
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
algorithms::Costmap asCostmap(const armem::wm::ProviderSegment &providerSegment)
std::string GetHandledExceptionString()
std::optional< algorithms::Costmap > costmap
CoreSegmentSelector & coreSegments()
Start specifying core segments.
CoreSegmentSelector & withName(const std::string &name) override
const armem::client::Reader & memoryReader() const
enum armarx::navigation::memory::client::costmap::Reader::Result::Status status
ProviderSegmentSelector & withName(const std::string &name) override
Properties defaultProperties() const override
bool forEachEntity(EntityFunctionT &&func)
SnapshotSelector & beforeOrAtTime(Time timestamp)
The query::Builder class provides a fluent-style specification of hierarchical queries.
ProviderSegmentSelector & providerSegments()
Start specifying provider segments.
Client-side working memory entity.
QueryResult query(const QueryInput &input) const
Perform a query.