Skip to content

Commit

Permalink
add more debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Dec 31, 2023
1 parent 9b58f84 commit 2d7b98a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions unit-tests/live/options/test-rgb-options-metadata-consistency.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#test:device each(D400*)

import pyrealsense2 as rs
from rspy import test
from rspy import test, log

def close_resources(sensor):
if len(sensor.get_active_streams()) > 0:
Expand Down Expand Up @@ -64,11 +64,12 @@ def check_option_and_metadata_values(option, metadata, value_to_set, frame):
option_index = -1 # running over options
value_index = -1 # 0, 1, 2 for min, max, default
# number of frames to wait between set_option and checking metadata
# is set as 10 - the expected delay is ~120ms for Win and ~80-90ms for Linux
# is set as 15 - the expected delay is ~120ms for Win and ~80-90ms for Linux
num_of_frames_to_wait = 15
while True:
try:
lrs_frame = lrs_queue.wait_for_frame(5000)
log.d("iteration:", iteration)
if iteration == 0:
option_index = option_index + 1
if option_index == len(color_options):
Expand All @@ -87,9 +88,11 @@ def check_option_and_metadata_values(option, metadata, value_to_set, frame):
value_to_set = option_range.max
elif iteration == 2 * (num_of_frames_to_wait + 1):
value_to_set = option_range.default
if iteration % (num_of_frames_to_wait + 1) == 0: # for iterations 0, 11, 22
if iteration % (num_of_frames_to_wait + 1) == 0: # for iterations 0, 16, 32
log.d("setting option:", option, "to", value_to_set)
color_sensor.set_option(option, value_to_set)
if (iteration + 1) % (num_of_frames_to_wait + 1) == 0: # for iterations 10, 21, 32
if (iteration + 1) % (num_of_frames_to_wait + 1) == 0: # for iterations 15, 31, 47
log.d("checking MD:", metadata, "vs option:", option)
check_option_and_metadata_values(option, metadata, value_to_set, lrs_frame)
iteration = (iteration + 1) % (3 * (num_of_frames_to_wait + 1))

Expand Down

0 comments on commit 2d7b98a

Please sign in to comment.