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

Y16 calibration format test #12234

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
57 changes: 57 additions & 0 deletions unit-tests/live/streaming/test-y16-calibration-format.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2023 Intel Corporation. All Rights Reserved.

# test:device D400*
# This test checks streaming y16 profile

import time
import pyrealsense2 as rs
from rspy import test, log
from rspy.timer import Timer


y16_streamed = False


def close_resources(sensor):
"""
Stop and Close sensor.
:sensor: sensor of device
"""
if len(sensor.get_active_streams()) > 0:
sensor.stop()
sensor.close()


def frame_callback(frame):
global y16_streamed
y16_streamed = True


timer = Timer(5)

device = test.find_first_device_or_exit()
depth_sensor = device.first_depth_sensor()

test.start('Check that y16 is streaming:')

profile_y16 = next(p for p in depth_sensor.profiles if p.format() == rs.format.y16)
test.check(profile_y16)
log.d(str(profile_y16))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed

Copy link
Collaborator

Choose a reason for hiding this comment

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

What is removed? :)

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 removed lines were returned back in the end ;)


if profile_y16:
depth_sensor.open(profile_y16)
depth_sensor.start(frame_callback)

timer.start()
while not timer.has_expired():
if y16_streamed:
break
time.sleep(0.1)

test.check(not timer.has_expired())


close_resources(depth_sensor)
test.finish()
test.print_results_and_exit()
52 changes: 0 additions & 52 deletions unit-tests/live/streaming/test-y16.cpp

This file was deleted.