GazeTarget.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 armarx_control::ArmarXObjects::object
17  * @author Johann Mantel
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 <iosfwd>
26 
27 #include <ArmarXCore/core/time.h>
28 
30 
33 
35 {
36  /**
37  * @brief Business Object (BO) class of GazeTarget.
38  */
39  class GazeTarget
40  {
41  public:
42  // General properties
43  std::string name = "";
45  // Scheduler values
48  bool keepInQueue = false;
49  // Event logging
56 
57  GazeTarget();
58 
59  explicit GazeTarget(std::string targetName,
60  const FramedPosition& targetPosition,
61  const TargetPriority& priority,
63  bool keepInQueue);
64 
65  bool isActive() const;
66  bool isReached() const;
67  bool isReleased() const;
68  bool isAborted() const;
69 
70  inline bool
71  operator<(const GazeTarget& rhs) const
72  {
73  return priority < rhs.priority;
74  };
75 
76  inline bool
77  operator<=(const GazeTarget& rhs) const
78  {
79  return priority <= rhs.priority;
80  };
81 
82  inline bool
83  operator==(const GazeTarget& rhs) const
84  {
85  return priority == rhs.priority;
86  };
87 
88  inline bool
89  operator!=(const GazeTarget& rhs) const
90  {
91  return priority != rhs.priority;
92  };
93 
94  inline bool
95  operator>=(const GazeTarget& rhs) const
96  {
97  return priority >= rhs.priority;
98  };
99 
100  inline bool
101  operator>(const GazeTarget& rhs) const
102  {
103  return priority > rhs.priority;
104  };
105  };
106 
107  ::std::ostream& operator<<(::std::ostream& os, const GazeTarget& target);
108 
109 } // namespace armarx::view_selection::gaze_targets
armarx::view_selection::gaze_targets::GazeTarget::isReached
bool isReached() const
Definition: GazeTarget.cpp:57
armarx::view_selection::gaze_targets::GazeTarget::operator>=
bool operator>=(const GazeTarget &rhs) const
Definition: GazeTarget.h:95
armarx::view_selection::gaze_targets::GazeTarget::keepInQueue
bool keepInQueue
Definition: GazeTarget.h:48
armarx::view_selection::gaze_targets::GazeTarget::releasedTimestamp
armarx::DateTime releasedTimestamp
Definition: GazeTarget.h:54
boost::target
Vertex target(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:668
armarx::view_selection::gaze_targets::TargetStatus
TargetStatus
Describes the type of attention.
Definition: TargetStatus.h:32
armarx::view_selection::gaze_targets::GazeTarget::priority
TargetPriority priority
Definition: GazeTarget.h:46
armarx::view_selection::gaze_targets::GazeTarget
Business Object (BO) class of GazeTarget.
Definition: GazeTarget.h:39
armarx::view_selection::gaze_targets::GazeTarget::isReleased
bool isReleased() const
Definition: GazeTarget.cpp:63
armarx::view_selection::gaze_targets::GazeTarget::reachedTimestamp
armarx::DateTime reachedTimestamp
Definition: GazeTarget.h:53
armarx::view_selection::gaze_targets::GazeTarget::operator<=
bool operator<=(const GazeTarget &rhs) const
Definition: GazeTarget.h:77
armarx::status
status
Definition: FiniteStateMachine.h:244
armarx::view_selection::gaze_targets::GazeTarget::operator<
bool operator<(const GazeTarget &rhs) const
Definition: GazeTarget.h:71
armarx::view_selection::gaze_targets::operator<<
::std::ostream & operator<<(::std::ostream &os, const GazeTarget &target)
Definition: GazeTarget.cpp:75
FramedPose.h
armarx::FramedPosition
The FramedPosition class.
Definition: FramedPose.h:157
armarx::view_selection::gaze_targets::AttentionType::RandomEvent
@ RandomEvent
Random Targets with lowest priority.
armarx::view_selection::gaze_targets
Definition: aron_conversions.cpp:25
armarx::view_selection::gaze_targets::GazeTarget::operator==
bool operator==(const GazeTarget &rhs) const
Definition: GazeTarget.h:83
armarx::view_selection::gaze_targets::GazeTarget::operator>
bool operator>(const GazeTarget &rhs) const
Definition: GazeTarget.h:101
armarx::view_selection::gaze_targets::GazeTarget::name
std::string name
Definition: GazeTarget.h:43
armarx::view_selection::gaze_targets::GazeTarget::isActive
bool isActive() const
Definition: GazeTarget.cpp:51
armarx::view_selection::gaze_targets::GazeTarget::GazeTarget
GazeTarget()
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::view_selection::gaze_targets::GazeTarget::creationTimestamp
armarx::DateTime creationTimestamp
Definition: GazeTarget.h:51
armarx::view_selection::gaze_targets::GazeTarget::abortedTimestamp
armarx::DateTime abortedTimestamp
Definition: GazeTarget.h:55
armarx::core::time::Duration
Represents a duration.
Definition: Duration.h:16
time.h
armarx::view_selection::gaze_targets::TargetStatus::Requested
@ Requested
commited to memory, waiting for scheduling
TargetPriority.h
armarx::view_selection::gaze_targets::GazeTarget::position
FramedPosition position
Definition: GazeTarget.h:44
armarx::view_selection::gaze_targets::GazeTarget::activationTimestamp
armarx::DateTime activationTimestamp
Definition: GazeTarget.h:52
armarx::core::time::Duration::MicroSeconds
static Duration MicroSeconds(std::int64_t microSeconds)
Constructs a duration in microseconds.
Definition: Duration.cpp:24
armarx::view_selection::gaze_targets::TargetPriority
The Priority of a GazeTarget.
Definition: TargetPriority.h:39
armarx::view_selection::gaze_targets::GazeTarget::isAborted
bool isAborted() const
Definition: GazeTarget.cpp:69
armarx::view_selection::gaze_targets::GazeTarget::duration
armarx::core::time::Duration duration
Definition: GazeTarget.h:47
armarx::view_selection::gaze_targets::GazeTarget::operator!=
bool operator!=(const GazeTarget &rhs) const
Definition: GazeTarget.h:89
TargetStatus.h