6#include <RobotAPI/libraries/armem_skills/aron/Skill.aron.generated.h>
13 std::optional<armarx::core::time::DateTime>
15 const std::string& providerName,
16 const std::string& skillName)
const
33 ARMARX_WARNING <<
"[SkillStatusReader] Query failed: " << qResult.errorMessage;
37 if (!qResult.memory.hasCoreSegment(
properties().coreSegmentName))
42 const auto& coreSegment =
45 if (!coreSegment.hasProviderSegment(providerName))
50 const auto& providerSegment = coreSegment.getProviderSegment(providerName);
52 if (!providerSegment.hasEntity(skillName))
57 const auto& entity = providerSegment.getEntity(skillName);
64 const auto& latestSnapshot = entity.getLatestSnapshot();
66 std::optional<armarx::core::time::DateTime> result;
68 latestSnapshot.forEachInstance(
69 [&result](
const auto& instance)
74 armarx::skills::arondto::SkillStatusUpdate::FromAron(
76 result =
dto.executionStartedTimestamp;
89 return "mem.skill_status.";
95 return {.memoryName =
"Skill", .coreSegmentName =
"SkillEvent"};
CoreSegmentT & getCoreSegment(const std::string &name)
QueryResult query(const QueryInput &input) const
Perform a query on the WM.
The query::Builder class provides a fluent-style specification of hierarchical queries.
QueryInput buildQueryInput() const
CoreSegmentSelector & coreSegments()
Start specifying core segments.
CoreSegmentSelector & withName(const std::string &name) override
ProviderSegmentSelector & providerSegments()
Start specifying provider segments.
EntitySelector & withName(const std::string &name) override
SnapshotSelector & snapshots()
Start specifying entity snapshots.
ProviderSegmentSelector & withName(const std::string &name) override
EntitySelector & entities()
Start specifying entities.
SnapshotSelector & latest()
const armem::client::Reader & memoryReader() const
const Properties & properties() const
Properties defaultProperties() const override
std::optional< armarx::core::time::DateTime > queryLatestExecutionStartedTimestamp(const std::string &providerName, const std::string &skillName) const
Query the Skill memory for the most recent executionStartedTimestamp of the given skill (by provider ...
std::string propertyPrefix() const override
~SkillStatusReader() override
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
wm::Memory memory
The slice of the memory that matched the query.