TargetStatus.h
Go to the documentation of this file.
1/*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package view_selection::ArmarXObjects::objects
17 * @author Johann Mantel ( j-mantel at gmx dot net )
18 * @date 2022
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#pragma once
24
25#include <SimoxUtility/meta/enum/EnumNames.hpp>
26
28{
29 /**
30 * @brief The lifecycle state of a gaze target, as observed by the gaze scheduler.
31 *
32 * Requested/Scheduled/Reached/Preempted are transient, Released/Aborted are terminal.
33 *
34 * Released and Aborted are the success/failure split: a target that had been reached before it
35 * left the queue ends as Released -- the caller got what it asked for, even though another
36 * target owns the head now. A target bumped before the gaze ever settled ends as Aborted.
37 */
38 enum class TargetStatus
39 {
40 /// admitted to the scheduler's queue, waiting for scheduling
42 /// submitted to the low-level controller
44 /// the gaze residual settled below the threshold
46 /// lost the active slot but stays in the queue and may be scheduled again
48 /// left the queue having been reached (duration elapsed, or superseded afterwards)
50 /// left the queue without ever being reached, or the target is out of reach
52 };
53
54 inline const simox::meta::EnumNames<TargetStatus> TargetStatusNames{
55 {TargetStatus::Requested, "Requested"},
56 {TargetStatus::Scheduled, "Scheduled"},
57 {TargetStatus::Reached, "Reached"},
58 {TargetStatus::Preempted, "Preempted"},
59 {TargetStatus::Released, "Released"},
60 {TargetStatus::Aborted, "Aborted"}};
61
62 /// Whether the status is terminal, i.e. the target has left the scheduler's queue for good.
63 inline bool
68
69} // namespace armarx::view_selection::gaze_targets
const simox::meta::EnumNames< TargetStatus > TargetStatusNames
TargetStatus
The lifecycle state of a gaze target, as observed by the gaze scheduler.
@ 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
bool isTerminal(const TargetStatus status)
Whether the status is terminal, i.e. the target has left the scheduler's queue for good.