10#include <VisionX/libraries/armem_human/aron/HumanPose.aron.generated.h>
17 armarx::armem::client::query::Builder
28 if (not
query.providerName.empty())
43 return "mem.human.pose.";
49 return {.memoryName =
"Human", .coreSegmentName =
"Pose"};
52 std::vector<HumanPose>
62 std::vector<HumanPose> humanPoses;
72 entitySnapshot.forEachInstance(
73 [&humanPoses, &
timestamp, &maxAge](
const auto& entityInstance)
78 timestamp - entityInstance.metadata().referencedTime;
88 humanPose.
timestamp = entityInstance.metadata().referencedTime;
90 humanPoses.push_back(humanPose);
111 ARMARX_DEBUG <<
"[MappingDataReader] result: " << qResult;
116 return {.humanPoses = {},
124 if (
query.providerName.empty())
128 std::vector<HumanPose> allHumanPoses;
130 coreSegment.forEachProviderSegment(
131 [&allHumanPoses, &
query](
const auto& providerSegment)
133 const std::vector<HumanPose> humanPoses =
136 humanPoses.begin(), humanPoses.end(), std::back_inserter(allHumanPoses));
139 if (allHumanPoses.empty())
142 return {.humanPoses = {},
144 .errorMessage =
"No entities"};
153 if (not coreSegment.hasProviderSegment(
query.providerName))
156 <<
"` does not exist (yet).";
163 coreSegment.getProviderSegment(
query.providerName);
165 if (providerSegment.
empty())
SpamFilterDataPtr deactivateSpam(SpamFilterDataPtr const &spamFilter, float deactivationDurationSec, const std::string &identifier, bool deactivate)
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.
EntitySelector & all() override
SnapshotSelector & snapshots()
Start specifying entity snapshots.
ProviderSegmentSelector & withName(const std::string &name) override
EntitySelector & entities()
Start specifying entities.
ProviderSegmentSelector & all() override
SnapshotSelector & beforeOrAtTime(Time timestamp)
const armem::client::Reader & memoryReader() const
const Properties & properties() const
Properties defaultProperties() const override
std::string propertyPrefix() const override
::armarx::armem::client::query::Builder buildQuery(const Query &query) const
Result query(const Query &query) const
Represents a point in time.
bool isPositive() const
Tests whether the duration is positive (value in µs > 0).
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#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.
std::vector< HumanPose > asHumanPoses(const wm::ProviderSegment &providerSegment, const DateTime ×tamp, const Duration &maxAge)
void fromAron(const armarx::human::arondto::HumanPose &dto, HumanPose &bo)
armarx::core::time::Duration Duration
std::optional< AronClass > tryCast(const wm::EntityInstance &item)
Tries to cast a armem::EntityInstance to AronClass.
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.