7 import pyrealsense2
as rs
9 from rspy
import test, log
20 dev = test.find_first_device_or_exit()
25 product_line = dev.get_info(rs.camera_info.product_line)
26 if product_line ==
"D400":
27 max_delay_for_depth_frame = 2
28 max_delay_for_color_frame = 2
29 elif product_line ==
"L500":
30 max_delay_for_depth_frame = 3
31 max_delay_for_color_frame = 1.5
33 log.f(
"This test support only D400 + L515 devices")
40 pipe.wait_for_frames()
41 delay = start_call_stopwatch.get_elapsed()
47 test.start(
"Testing pipeline first depth frame delay on " + product_line +
" device - " + platform.system() +
" OS")
48 depth_cfg = rs.config()
49 depth_cfg.enable_stream(rs.stream.depth, rs.format.z16, 30)
51 print(
"Delay from pipeline.start() until first depth frame is: {:.3f} [sec] max allowed is: {:.1f} [sec] ".format(frame_delay, max_delay_for_depth_frame))
52 test.check(frame_delay < max_delay_for_depth_frame)
57 test.start(
"Testing pipeline first color frame delay on " + product_line +
" device - " + platform.system() +
" OS")
58 color_cfg = rs.config()
59 color_cfg.enable_stream(rs.stream.color, rs.format.rgb8, 30)
61 print(
"Delay from pipeline.start() until first color frame is: {:.3f} [sec] max allowed is: {:.1f} [sec] ".format(frame_delay, max_delay_for_color_frame))
62 test.check(frame_delay < max_delay_for_color_frame)
67 test.print_results_and_exit()
def time_to_first_frame(config)
static std::string print(const transformation &tf)
virtual frame finish(frame f)