16 const std::scoped_lock lock(mutex);
18 activeTargetId = targetId;
27 const bool targetReachable)
29 const std::scoped_lock lock(mutex);
32 if (targetId != activeTargetId)
40 residual.angularError <= config.angularTh and
residual.lateralError <= config.lateralTh;
42 reachedCount = onTarget ? reachedCount + 1 : 0;
43 unreachableCount = targetReachable ? 0 : unreachableCount + 1;
49 const std::scoped_lock lock(mutex);
51 return reachedCount >= config.filterCount;
57 const std::scoped_lock lock(mutex);
59 return unreachableCount >= config.filterCount;
65 const std::scoped_lock lock(mutex);
67 return latestResidual;
bool unreachable() const
Whether the controller could not reach the target for filterCount consecutive reports.
bool reached() const
Whether the gaze has been on target for filterCount consecutive reports.
void update(std::int64_t targetId, const gaze_controller::GazeResidual &residual, bool targetReachable)
Feed one controller report. Reports about a different target are ignored.
GazeTargetReachedMonitor(const GazeReachedConfig &config)
void reset(std::int64_t targetId)
Begin monitoring another control target, dropping all state about the previous one.
gaze_controller::GazeResidual residual() const
Residual of the most recently accepted report.
How far the gaze currently is from a target.
Thresholds deciding when the gaze counts as fixed on the active target.