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

Update tests to use default profiles #12836

Merged
merged 2 commits into from
Apr 8, 2024
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
8 changes: 4 additions & 4 deletions unit-tests/live/frames/test-fps.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ def frame_cb(frame):
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))
log.i("Requested fps: {:.1f} [Hz], not supported".format(requested_fps))
else:
fps = measure_fps(ds, dp, time_to_test_fps[i])
print("Requested fps: {:.1f} [Hz], actual fps: {:.1f} [Hz]. Time to first frame {:.6f}".format(requested_fps, fps, first_frame_seconds))
log.i("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()
Expand All @@ -114,10 +114,10 @@ def frame_cb(frame):
and p.stream_type() == rs.stream.color
and p.format() == rs.format.rgb8)
except StopIteration:
print("Requested fps: {:.1f} [Hz], not supported".format(requested_fps))
log.i("Requested fps: {:.1f} [Hz], not supported".format(requested_fps))
else:
fps = measure_fps(cs, cp, time_to_test_fps[i])
print("Requested fps: {:.1f} [Hz], actual fps: {:.1f} [Hz]. Time to first frame {:.6f}".format(requested_fps, fps, first_frame_seconds))
log.i("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))

Expand Down
15 changes: 6 additions & 9 deletions unit-tests/live/frames/test-t2ff-sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,9 @@ def frame_cb(frame):
test.check(device_creation_time < max_time_for_device_creation)
test.finish()


# Set maximum delay for first frame according to product line
product_line = dev.get_info(rs.camera_info.product_line)
if product_line == "D400":
max_delay_for_depth_frame = 1
max_delay_for_color_frame = 1
else:
log.f( "This test support only D400 devices" )
max_delay_for_depth_frame = 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Notice, the test is still enabled only for D400 devices

max_delay_for_color_frame = 1


ds = dev.first_depth_sensor()
Expand All @@ -74,12 +69,14 @@ def frame_cb(frame):
dp = next(p for p in
ds.profiles if p.fps() == 30
and p.stream_type() == rs.stream.depth
and p.format() == rs.format.z16)
and p.format() == rs.format.z16
and p.is_default())

cp = next(p for p in
cs.profiles if p.fps() == 30
and p.stream_type() == rs.stream.color
and p.format() == rs.format.rgb8)
and p.format() == rs.format.rgb8
and p.is_default())


#####################################################################################################
Expand Down
4 changes: 2 additions & 2 deletions unit-tests/live/options/test-timestamp-domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def set_and_verify_timestamp_domain(sensor, frame_queue, global_time_enabled: bo
depth_frame_queue = rs.frame_queue(queue_capacity, keep_frames=False)

depth_sensor = device.first_depth_sensor()
depth_profile = next(p for p in depth_sensor.profiles if p.stream_type() == rs.stream.depth)
depth_profile = next(p for p in depth_sensor.profiles if p.stream_type() == rs.stream.depth and p.is_default())
depth_sensor.open(depth_profile)
depth_sensor.start(depth_frame_queue)

Expand All @@ -69,7 +69,7 @@ def set_and_verify_timestamp_domain(sensor, frame_queue, global_time_enabled: bo
color_frame_queue = rs.frame_queue(queue_capacity, keep_frames=False)

color_sensor = device.first_color_sensor()
color_profile = next(p for p in color_sensor.profiles if p.stream_type() == rs.stream.color)
color_profile = next(p for p in color_sensor.profiles if p.stream_type() == rs.stream.color and p.is_default())
color_sensor.open(color_profile)
color_sensor.start(color_frame_queue)

Expand Down
Loading