Go to the documentation of this file.
6 #include <RobotAPI/interface/armem/mns/MemoryNameSystemInterface.h>
7 #include <RobotAPI/interface/armem/server/ReadingMemoryInterface.h>
20 #include <armarx/navigation/rooms/aron/Room.aron.generated.h>
46 return "mem.nav.rooms.";
67 ARMARX_CHECK(not entitySnapshot.empty()) <<
"No entity snapshot instances";
69 entityInstance = &entitySnapshot.getInstance(0);
74 const auto aronDto = armem::tryCast<navigation::rooms::arondto::Room>(*entityInstance);
76 const navigation::rooms::arondto::Room& dto = *aronDto;
95 if (not qResult.success)
97 ARMARX_WARNING <<
"Failed to query data from memory: " << qResult.errorMessage;
98 return {.room = std::nullopt,
99 .status = Result::Status::Error,
100 .errorMessage = qResult.errorMessage};
103 const auto coreSegment = qResult.memory.getCoreSegment(
properties().coreSegmentName);
105 if (not coreSegment.hasProviderSegment(
query.providerName))
108 <<
"` does not exist (yet).";
109 return {.
room = std::nullopt, .status = Result::Status::NoData};
113 coreSegment.getProviderSegment(
query.providerName);
115 if (providerSegment.
empty())
118 return {.room = std::nullopt,
119 .status = Result::Status::NoData,
120 .errorMessage =
"No entities"};
125 return Result{.
room =
asRoom(providerSegment), .status = Result::Status::Success};
const std::string RoomsCoreSegmentName
const Properties & properties() const
enum armarx::navigation::memory::client::rooms::Reader::Result::Status status
armarx::navigation::rooms::Room asRoom(const armem::wm::ProviderSegment &providerSegment)
EntitySelector & entities()
Start specifying entities.
Client-side working memory provider segment.
Client-side working entity instance.
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...
const std::string NavigationMemoryName
::armarx::armem::client::query::Builder buildQuery(const Query &query) const
Properties defaultProperties() const override
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
std::string GetHandledExceptionString()
std::optional< armarx::navigation::rooms::Room > room
CoreSegmentSelector & coreSegments()
Start specifying core segments.
CoreSegmentSelector & withName(const std::string &name) override
const armem::client::Reader & memoryReader() const
EntitySelector & withName(const std::string &name) override
ProviderSegmentSelector & withName(const std::string &name) override
bool forEachEntity(EntityFunctionT &&func)
void fromAron(const arondto::Room &dto, Room &bo)
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.
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
Result query(const Query &query) const
std::string propertyPrefix() const override
QueryResult query(const QueryInput &input) const
Perform a query.