Skip to content

Commit

Permalink
PR #13669 from AviaAv: add more info to logs in fps_helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az authored Jan 12, 2025
2 parents 5f6a4da + 37af69e commit d40c2e2
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions unit-tests/live/frames/fps_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
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 {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()] + 1} 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
Expand Down

0 comments on commit d40c2e2

Please sign in to comment.