From c345ff05f723f465f90108ce63330aeb4cf74542 Mon Sep 17 00:00:00 2001 From: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Date: Thu, 9 Jan 2025 12:12:38 +0200 Subject: [PATCH 1/2] add more info to logs in fps_helper --- unit-tests/live/frames/fps_helper.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/unit-tests/live/frames/fps_helper.py b/unit-tests/live/frames/fps_helper.py index b24d4064ef..d038e0ece9 100644 --- a/unit-tests/live/frames/fps_helper.py +++ b/unit-tests/live/frames/fps_helper.py @@ -3,6 +3,7 @@ from rspy import test, log import time +import pyrealsense2 as rs # global variable used to count on all the sensors simultaneously count_frames = False @@ -74,11 +75,15 @@ def generate_callbacks(sensor_profiles_dict, profile_name_fps_dict): """ def on_frame_received(frame): global count_frames - log.d(f"frame {frame.profile.stream_name()} #{profile_name_fps_dict[frame.profile.stream_name()] + 1} accepted") # todo remove these + frame_number = frame.get_frame_number() + frame_ts = frame.get_frame_metadata(rs.frame_metadata_value.frame_timestamp) + log.d(f"frame {frame.profile.stream_name()} #{profile_name_fps_dict[frame.profile.stream_name()] + 1} " + f"accepted with frame number {frame_number} and ts {frame_ts}") if count_frames: profile_name = frame.profile.stream_name() profile_name_fps_dict[profile_name] += 1 - log.d(f"frame {frame.profile.stream_name()} #{profile_name_fps_dict[frame.profile.stream_name()] + 1} finished") + log.d(f"frame {frame.profile.stream_name()} #{profile_name_fps_dict[frame.profile.stream_name()]} " + f"callback finished") sensor_function_dict = {sensor_key: on_frame_received for sensor_key in sensor_profiles_dict} return sensor_function_dict From 37af69ecc4ac3894c7b54cb229cd77478a4d8812 Mon Sep 17 00:00:00 2001 From: Avia Avraham <145359432+AviaAv@users.noreply.github.com> Date: Sun, 12 Jan 2025 09:08:42 +0200 Subject: [PATCH 2/2] clarified callback --- unit-tests/live/frames/fps_helper.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/unit-tests/live/frames/fps_helper.py b/unit-tests/live/frames/fps_helper.py index d038e0ece9..b73fc9ddf7 100644 --- a/unit-tests/live/frames/fps_helper.py +++ b/unit-tests/live/frames/fps_helper.py @@ -75,15 +75,15 @@ def generate_callbacks(sensor_profiles_dict, profile_name_fps_dict): """ def on_frame_received(frame): global count_frames - frame_number = frame.get_frame_number() + profile_name = frame.profile.stream_name() + counted_frame_number = profile_name_fps_dict[frame.profile.stream_name()] + 1 # frame number counted in test + frame_number = frame.get_frame_number() # the actual frame number from the metadata frame_ts = frame.get_frame_metadata(rs.frame_metadata_value.frame_timestamp) - log.d(f"frame {frame.profile.stream_name()} #{profile_name_fps_dict[frame.profile.stream_name()] + 1} " + log.d(f"frame {profile_name} #{counted_frame_number} " f"accepted with frame number {frame_number} and ts {frame_ts}") if count_frames: - profile_name = frame.profile.stream_name() profile_name_fps_dict[profile_name] += 1 - log.d(f"frame {frame.profile.stream_name()} #{profile_name_fps_dict[frame.profile.stream_name()]} " - f"callback finished") + log.d(f"frame {profile_name} #{counted_frame_number} callback finished") sensor_function_dict = {sensor_key: on_frame_received for sensor_key in sensor_profiles_dict} return sensor_function_dict