diff options
author | Théo de la Hogue | 2024-02-29 16:09:50 +0100 |
---|---|---|
committer | Théo de la Hogue | 2024-02-29 16:09:50 +0100 |
commit | 74fb292fd3fd8012dcf82f1d62a03ac738424b58 (patch) | |
tree | 791f65521edaa4c1a644d5a03dd7105698cab5d6 /src/argaze | |
parent | cd601be0b9366a9bd1554523319e57801440ed64 (diff) | |
download | argaze-74fb292fd3fd8012dcf82f1d62a03ac738424b58.zip argaze-74fb292fd3fd8012dcf82f1d62a03ac738424b58.tar.gz argaze-74fb292fd3fd8012dcf82f1d62a03ac738424b58.tar.bz2 argaze-74fb292fd3fd8012dcf82f1d62a03ac738424b58.tar.xz |
Updating more test.
Diffstat (limited to 'src/argaze')
-rw-r--r-- | src/argaze/ArFeatures.py | 6 | ||||
-rw-r--r-- | src/argaze/ArUcoMarkers/ArUcoCamera.py | 4 | ||||
-rw-r--r-- | src/argaze/DataFeatures.py | 4 | ||||
-rw-r--r-- | src/argaze/GazeFeatures.py | 3 |
4 files changed, 14 insertions, 3 deletions
diff --git a/src/argaze/ArFeatures.py b/src/argaze/ArFeatures.py index 8005d48..95d89d9 100644 --- a/src/argaze/ArFeatures.py +++ b/src/argaze/ArFeatures.py @@ -882,11 +882,17 @@ class ArFrame(DataFeatures.SharedObject, DataFeatures.PipelineStepObject): !!! warning Be aware that gaze positions are in the same range of value than size attribute. + !!! note + This method timestamps incoming gaze position. + Parameters: timestamp: method call timestamp (unit does'nt matter) gaze_position: gaze position to project """ + # Timestamp gaze position + gaze_position.timestamp = timestamp + # Use frame lock feature with self._lock: diff --git a/src/argaze/ArUcoMarkers/ArUcoCamera.py b/src/argaze/ArUcoMarkers/ArUcoCamera.py index 7f30252..f6297a8 100644 --- a/src/argaze/ArUcoMarkers/ArUcoCamera.py +++ b/src/argaze/ArUcoMarkers/ArUcoCamera.py @@ -187,8 +187,8 @@ class ArUcoCamera(ArFeatures.ArCamera): pass - # Timestamp camera frame - self.timestamp = timestamp + # Timestamp camera frame + self.timestamp = timestamp def __image(self, draw_detected_markers: dict = None, draw_scenes: dict = None, draw_optic_parameters_grid: dict = None, **kwargs: dict) -> numpy.array: """Get frame image with ArUco detection visualisation. diff --git a/src/argaze/DataFeatures.py b/src/argaze/DataFeatures.py index 8df991b..849601f 100644 --- a/src/argaze/DataFeatures.py +++ b/src/argaze/DataFeatures.py @@ -196,8 +196,10 @@ class TimestampedObjectsList(list): raise TypeError(f'{type(ts_object)} object is not {self.__object_type} instance') - assert(ts_object.is_timestamped()) + if not ts_object.is_timestamped(): + raise ValueError(f'object is not timestamped') + super().append(ts_object) def look_for(self, timestamp: TimeStampType) -> TimestampedObjectType: diff --git a/src/argaze/GazeFeatures.py b/src/argaze/GazeFeatures.py index 6a02142..263f793 100644 --- a/src/argaze/GazeFeatures.py +++ b/src/argaze/GazeFeatures.py @@ -363,6 +363,9 @@ GazeMovementType = TypeVar('GazeMovement', bound="GazeMovement") class GazeMovement(TimeStampedGazePositions, DataFeatures.TimestampedObject): """Define abstract gaze movement class as timestamped gaze positions list. + !!! note + Gaze movement timestamp is always equal to its first position timestamp. + Parameters: positions: timestamp gaze positions. finished: is the movement finished? |