Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more info to logs in fps_helper #13669

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 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
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")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain this change? +1 dropped

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to show the correct frame number, since we've just increased it inside the 'if', but I noticed it's still wrong when we don't count frames.

I just fixed it now, so the two logs make sense now, whether or not we count frames.


sensor_function_dict = {sensor_key: on_frame_received for sensor_key in sensor_profiles_dict}
return sensor_function_dict
Expand Down
Loading