diff --git a/unit-tests/live/frames/test-fps.py b/unit-tests/live/frames/test-fps.py index c163856059..90ff4a6cc0 100644 --- a/unit-tests/live/frames/test-fps.py +++ b/unit-tests/live/frames/test-fps.py @@ -1,7 +1,8 @@ # License: Apache 2.0. See LICENSE file in root directory. # Copyright(c) 2022 Intel Corporation. All Rights Reserved. -# test:device D400* +# test:device L500* +# test:device each(D400*) # test:donotrun:!nightly # test:timeout 250 # timeout = (seconds_till_steady_state + seconds_to_count_frames) * tested_fps.size() * 2 + 10. (2 because depth + color, 10 spare) @@ -22,8 +23,8 @@ def measure_fps(sensor, profile): Wait a few seconds to be sure that frames are at steady state after start Count number of received frames for seconds_to_count_frames seconds and compare actual fps to requested fps """ - seconds_till_steady_state = 1 - seconds_to_count_frames = 5 + seconds_till_steady_state = 4 + seconds_to_count_frames = 20 steady_state = False first_frame_received = False @@ -65,32 +66,33 @@ def frame_cb(frame): delta_Hz = 1 -tested_fps = [60] +tested_fps = [6, 15, 30, 60, 90] dev = test.find_first_device_or_exit() product_line = dev.get_info(rs.camera_info.product_line) ##################################################################################################### -# test.start("Testing depth fps " + product_line + " device - "+ platform.system() + " OS") - -# for requested_fps in tested_fps: - # ds = dev.first_depth_sensor() - # #Set auto-exposure option as it might take precedence over requested FPS - # if product_line == "D400": - # ds.set_option(rs.option.enable_auto_exposure, 1) - - # try: - # dp = next(p for p in ds.profiles - # if p.fps() == requested_fps - # and p.stream_type() == rs.stream.depth - # and p.format() == rs.format.z16) - # except StopIteration: - # print("Requested fps: {:.1f} [Hz], not supported".format(requested_fps)) - # else: - # fps = measure_fps(ds, dp) - # print("Requested fps: {:.1f} [Hz], actual fps: {:.1f} [Hz]. Time to first frame {:.6f}".format(requested_fps, fps, first_frame_seconds)) - # test.check(fps <= (requested_fps + delta_Hz) and fps >= (requested_fps - delta_Hz)) -# test.finish() +test.start("Testing depth fps " + product_line + " device - "+ platform.system() + " OS") + +for requested_fps in tested_fps: + ds = dev.first_depth_sensor() + # Set auto-exposure option as it might take precedence over requested FPS + if product_line == "D400": + ds.set_option(rs.option.enable_auto_exposure, 1) + + try: + dp = next(p for p in ds.profiles + if p.fps() == requested_fps + and p.stream_type() == rs.stream.depth + and p.format() == rs.format.z16) + except StopIteration: + print("Requested fps: {:.1f} [Hz], not supported".format(requested_fps)) + else: + fps = measure_fps(ds, dp) + print("Requested fps: {:.1f} [Hz], actual fps: {:.1f} [Hz]. Time to first frame {:.6f}".format(requested_fps, fps, first_frame_seconds)) + delta_Hz = requested_fps * 0.05 # Validation KPI is 5% + test.check(fps <= (requested_fps + delta_Hz) and fps >= (requested_fps - delta_Hz)) +test.finish() ##################################################################################################### @@ -98,7 +100,7 @@ def frame_cb(frame): for requested_fps in tested_fps: cs = dev.first_color_sensor() - #Set auto-exposure option as it might take precedence over requested FPS + # Set auto-exposure option as it might take precedence over requested FPS if product_line == "D400": cs.set_option(rs.option.enable_auto_exposure, 1) cs.set_option(rs.option.auto_exposure_priority, 0) # AE priority should be 0 for constant FPS @@ -115,6 +117,7 @@ def frame_cb(frame): else: fps = measure_fps(cs, cp) print("Requested fps: {:.1f} [Hz], actual fps: {:.1f} [Hz]. Time to first frame {:.6f}".format(requested_fps, fps, first_frame_seconds)) + delta_Hz = requested_fps * 0.05 # Validation KPI is 5% test.check(fps <= (requested_fps + delta_Hz) and fps >= (requested_fps - delta_Hz)) test.finish()