38 if (
query.name.empty()){
41 sel = sel.withName(
query.name);
52 return "mem.nav.costmap.";
75 ARMARX_CHECK(not entitySnapshot.empty()) <<
"No entity snapshot instances";
77 entityInstance = &entitySnapshot.getInstance(0);
95 ARMARX_DEBUG <<
"[MappingDataReader] result: " << qResult;
100 return {.costmap = std::nullopt,
107 if (not coreSegment.hasProviderSegment(
query.providerName))
110 <<
"` does not exist (yet).";
115 coreSegment.getProviderSegment(
query.providerName);
117 if (providerSegment.
empty())
120 return {.costmap = std::nullopt,
122 .errorMessage =
"No entities"};
145 .providerName =
"distance_to_obstacle_costmap_provider",
146 .name =
"distance_to_obstacles",
159 ARMARX_VERBOSE <<
"Received costmap \"" << providerName <<
"/" << name <<
"\"";
165 return costmapResult.
costmap.value();
#define ARMARX_CHECK_NOT_EMPTY(c)
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
static DateTime Now()
Current time on the virtual clock.
static void WaitFor(const Duration &duration)
Wait for a certain duration on the virtual clock.
static Duration MilliSeconds(std::int64_t milliSeconds)
Constructs a duration in milliseconds.
CoreSegmentT & getCoreSegment(const std::string &name)
bool forEachEntity(EntityFunctionT &&func)
QueryResult query(const QueryInput &input) const
Perform a query on the WM.
The query::Builder class provides a fluent-style specification of hierarchical queries.
CoreSegmentSelector & coreSegments()
Start specifying core segments.
CoreSegmentSelector & withName(const std::string &name) override
ProviderSegmentSelector & providerSegments()
Start specifying provider segments.
SnapshotSelector & snapshots()
Start specifying entity snapshots.
ProviderSegmentSelector & withName(const std::string &name) override
EntitySelector & entities()
Start specifying entities.
SnapshotSelector & beforeOrAtTime(Time timestamp)
const armem::client::Reader & memoryReader() const
const Properties & properties() const
Client-side working entity instance.
Client-side working memory entity.
Client-side working memory provider segment.
Properties defaultProperties() const override
algorithms::Costmap waitForCostmap(std::string &providerName, std::string &name, int delayMs=200) const
std::string propertyPrefix() const override
::armarx::armem::client::query::Builder buildQuery(const Query &query) const
Result query(const Query &query) const
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#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...
#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...
#define ARMARX_INFO
The normal logging level.
#define ARMARX_DEBUG
The logging level for output that is only interesting while debugging.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
#define ARMARX_VERBOSE
The logging level for verbose information.
Costmap fromAron(const armem::wm::EntityInstance &entityInstance)
constexpr const char * CostmapCoreSegmentName
constexpr const char * NavigationMemoryName
std::string GetHandledExceptionString()
auto & getLatestSnapshot(int snapshotIndex=0)
Retrieve the latest entity snapshot.
wm::Memory memory
The slice of the memory that matched the query.
std::optional< algorithms::Costmap > costmap
enum armarx::navigation::memory::client::costmap::Reader::Result::Status status