test-fg.py
Go to the documentation of this file.
1 # License: Apache 2.0. See LICENSE file in root directory.
2 # Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3 
4 #test:device L500*
5 
6 import pyrealsense2 as rs
7 from rspy import test,ac
8 
9 devices = test.find_devices_by_product_line_or_exit(rs.product_line.L500)
10 depth_sensor = devices[0].first_depth_sensor()
11 
12 debug_sensor = rs.debug_stream_sensor(depth_sensor)
13 debug_profiles = debug_sensor.get_debug_stream_profiles()
14 
15 
16 #############################################################################################
17 test.start("FG isn't exposed by get_stream_profiles")
18 
19 matches = list(p for p in depth_sensor.profiles if p.format() == rs.format.fg)
20 test.check(len(matches) == 0 )
22 
23 #############################################################################################
24 test.start("FG exposed by debug_stream_sensor")
25 
26 matches = list(p for p in debug_profiles if p.format() == rs.format.fg)
27 test.check(len(matches) > 0 )
29 
30 #############################################################################################
31 test.start("streaming FG 800x600")
32 
33 dp = next(p for p in debug_profiles if p.fps() == 30
34  and p.stream_type() == rs.stream.depth
35  and p.format() == rs.format.fg
36  and p.as_video_stream_profile().width() == 800
37  and p.as_video_stream_profile().height() == 600)
38 depth_sensor.open( dp )
39 lrs_queue = rs.frame_queue(capacity=10, keep_frames=False)
40 depth_sensor.start( lrs_queue )
41 
42 try:
43  lrs_frame = lrs_queue.wait_for_frame(5000)
44  test.check_equal(lrs_frame.profile.format(), rs.format.fg)
45 except:
46  test.unexpected_exception()
47 finally:
48  debug_sensor.stop()
49  debug_sensor.close()
51 
52 #############################################################################################
53 
54 test.print_results_and_exit()
virtual frame finish(frame f)
void next(auto_any_t cur, type2type< T, C > *)
Definition: foreach.hpp:757


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:11