20#include <armarx/view_selection/gaze_targets/aron/GazeTarget.aron.generated.h>
28 std::string providerSegmentName) :
29 memoryNameSystem(mns),
30 providerSegmentName(providerSegmentName),
31 coreSegmentID(
memory::constants::ViewMemoryName,
32 memory::constants::GazeTargetCoreSegmentName)
42 ARMARX_IMPORTANT <<
"ViewSelection: Waiting for memory '" << coreSegmentID <<
"' ...";
45 memoryWriter = memoryNameSystem.useWriter(coreSegmentID);
46 memoryReader = memoryNameSystem.useReader(coreSegmentID);
47 ARMARX_IMPORTANT <<
"ViewSelection: Connected to memory '" << coreSegmentID <<
"'";
56 std::optional<gaze_targets::GazeTarget>
65 const auto* entityInstance = queryResult.memory.findLatestInstance(entityId);
67 if (entityInstance !=
nullptr)
70 gaze_targets::arondto::GazeTarget::FromAron(entityInstance->data()));
85 "ViewSelection::connect() in onConnectComponent()?";
88 if (target.name ==
"")
90 ARMARX_WARNING <<
"The target name is empty. Did you forget to initialize it?";
94 gaze_targets::arondto::GazeTarget dto;
99 coreSegmentID.withProviderSegmentName(providerSegmentName).withEntityName(dto.name);
101 update.instancesData = {dto.toAron()};
102 memoryWriter.commit(update);
108 for (
const auto& target :
targets)
static DateTime Now()
Current time on the virtual clock.
MemoryID withProviderSegmentName(const std::string &name) const
MemoryID withEntityName(const std::string &name) const
The memory name system (MNS) client.
The query::Builder class provides a fluent-style specification of hierarchical queries.
void latestEntitySnapshot(const MemoryID &entityID)
QueryInput buildQueryInput() const
Indicates that a query to the Memory Name System failed.
void commitGazeTargets(const std::vector< gaze_targets::GazeTarget > &targets)
void commitGazeTarget(const gaze_targets::GazeTarget &target)
std::optional< gaze_targets::GazeTarget > readGazeTarget(const std::string &name)
ViewSelection(armarx::armem::client::MemoryNameSystem &mns, std::string providerSegmentName)
Business Object (BO) class of GazeTarget.
#define ARMARX_IMPORTANT
The logging level for always important information, but expected behaviour (in contrast to ARMARX_WAR...
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
#define ARMARX_VERBOSE
The logging level for verbose information.
void fromAron(const T &dto, T &bo)
This file is part of ArmarX.
void toAron(arondto::PackagePath &dto, const PackageFileLocation &bo)
An update of an entity for a specific point in time.