17 writer(
std::move(writer))
23 MemoryStatusPublisher::publish(
30 const std::scoped_lock lock(mutex);
36 published = lifecycle;
40 lifecycles.erase(gazeTargetID);
44 writer->store(published);
111 publish(gazeTargetID,
123 const std::scoped_lock lock(mutex);
125 const auto it = lifecycles.find(gazeTargetID);
127 return it != lifecycles.end() and it->second.wasReached();
static DateTime Now()
Current time on the virtual clock.
Represents a point in time.
void aborted(const armem::MemoryID &gazeTargetID, const std::string &reason) override
Left the queue without ever being reached. Terminal, and a failure.
void preempted(const armem::MemoryID &gazeTargetID, const std::string &reason) override
Lost the active slot but stays in the queue. Not terminal.
void requested(const armem::MemoryID &gazeTargetID, const armarx::DateTime &creationTimestamp) override
Admitted to the scheduler's queue.
void scheduled(const armem::MemoryID &gazeTargetID) override
Submitted to the low-level controller.
void released(const armem::MemoryID &gazeTargetID, const std::string &reason) override
Left the queue having been reached. Terminal, and a success for whoever asked.
void reached(const armem::MemoryID &gazeTargetID, const gaze_controller::GazeResidual &residual) override
The gaze settled on the target.
bool wasReached(const armem::MemoryID &gazeTargetID) const override
Whether this target was reached at any point.
MemoryStatusPublisher(std::experimental::observer_ptr< memory::client::status::Writer > writer)
Business Object (BO) class of GazeTargetStatus: the lifecycle of one gaze target request,...
bool isTerminal() const
Whether the target has left the scheduler's queue for good.
armarx::DateTime activationTimestamp
armarx::DateTime releasedTimestamp
std::string message
Reason, for the terminal states. Empty otherwise.
float lateralError
Lateral miss distance at target range at the transition [mm].
armarx::DateTime reachedTimestamp
armarx::armem::MemoryID gazeTargetID
The gaze target request snapshot this status refers to.
armarx::DateTime preemptedTimestamp
Most recent preemption, if any.
float angularError
Angle between the gaze ray and the direction to the target at the transition [rad].
armarx::DateTime abortedTimestamp
armarx::DateTime creationTimestamp
#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...
@ Scheduled
submitted to the low-level controller
@ Aborted
left the queue without ever being reached, or the target is out of reach
@ Reached
the gaze residual settled below the threshold
@ Released
left the queue having been reached (duration elapsed, or superseded afterwards)
@ Preempted
lost the active slot but stays in the queue and may be scheduled again
@ Requested
admitted to the scheduler's queue, waiting for scheduling
How far the gaze currently is from a target.
float lateralError
Lateral miss distance at target range [mm].
float angularError
Angle between the gaze ray and the direction to the target [rad].