Skip to content

Commit

Permalink
PR #12466 from Tamir91: Add A module (disparity modulation) set and g…
Browse files Browse the repository at this point in the history
…et test
  • Loading branch information
Nir-Az authored Dec 4, 2023
2 parents 5858a93 + 97d44e7 commit 56309b2
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions unit-tests/live/d400/test-disparity-modulation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2023 Intel Corporation. All Rights Reserved.

# test:device D400*
# This test checks that A Factor of Disparity can be changed

import pyrealsense2 as rs
from rspy import test, log


def test_amp_factor(am_device, input_factor_values: list):
"""
This function set new A Factor value to advance mode device
:am_device: advance mode device
:input_factor_values: list of A Factor values
"""
amp_factor = am_device.get_amp_factor()
output_factor_values = []

for factor_value in input_factor_values:
amp_factor.a_factor = factor_value
am_device.set_amp_factor(amp_factor)
output_factor_values.append(am_device.get_amp_factor().a_factor)

test.check_float_lists(input_factor_values, output_factor_values)


device = test.find_first_device_or_exit()
advance_mode_device = rs.rs400_advanced_mode(device)

with test.closure('Verify set/get of Disparity modulation'):
if advance_mode_device:
a_factor_values = [0.05, 0.01]
test_amp_factor(advance_mode_device, a_factor_values)
else:
log.d('Depth sensor or advanced mode not found.')
test.fail()


test.print_results_and_exit()

0 comments on commit 56309b2

Please sign in to comment.