-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
hdr test converted to python and stabilized #12670
Conversation
unit-tests/live/d400/test-hdr.py
Outdated
ctx = rs.context() | ||
device = test.find_first_device_or_exit() | ||
if ctx is not None: | ||
devices_list = ctx.query_devices() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original test used to perform a HW reset between each test, using restart_first_device_and_return_depth_sensor
This was removed, is this not required for this test suite?
@remibettan ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to perform HW reset between the tests, if they are changing some parameters, as the exposure for ID sequence 1/2.
Not needed for other tests.
unit-tests/live/d400/test-hdr.py
Outdated
min_counter_set = False | ||
|
||
if not min_counter_set: | ||
min_counter = int(depth_counter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this casting needed in python?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original file had a static cast there, so i thought to do it like that.
but I'll just remove it, it's not really needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still exist, let's please handle and answer all comments and than re-ask for a review from @remibettan
unit-tests/live/d400/test-hdr.py
Outdated
test.check(depth_sensor.get_option(rs.option.hdr_enabled) == 1) | ||
|
||
sequence_id = -1 | ||
iterations_for_preparation = 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the increase from 6 to 30?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
interesting...?
unit-tests/live/d400/test-hdr.py
Outdated
|
||
# emitter on/off works with PWM (pulse with modulation) in the hardware | ||
# this takes some time to configure it | ||
iterations_for_preparation = 30 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 10 --> 30?
750d293
to
94ce367
Compare
c3a48e2
to
74e36a8
Compare
unit-tests/live/d400/test-hdr.py
Outdated
device = test.find_first_device_or_exit() | ||
depth_sensor = device.first_depth_sensor() | ||
|
||
if depth_sensor and depth_sensor.supports(rs.option.hdr_enabled): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test will not fail if this if statement is not filled, but the test itself will not be checked - please add else statement with failure of the test, with relevant message.
This comment is relevant for all below tests.
unit-tests/live/d400/test-hdr.py
Outdated
depth_sensor.set_option(rs.option.sequence_id, 1) | ||
test.check(depth_sensor.get_option(rs.option.sequence_id) == 1) | ||
exp = depth_sensor.get_option(rs.option.exposure) | ||
test.check(depth_sensor.get_option(rs.option.exposure) == exposure_range.default - 1000) # w/a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comment to explain this w/a
unit-tests/live/d400/test-hdr.py
Outdated
depth_sensor.set_option(rs.option.hdr_enabled, 1) | ||
test.check(depth_sensor.get_option(rs.option.hdr_enabled) == 1) | ||
|
||
depth_sensor.set_option(rs.option.sequence_id, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comment to explain that seq id 1 should be with default values
unit-tests/live/d400/test-hdr.py
Outdated
test.check(depth_sensor.get_option(rs.option.exposure) == exposure_range.default - 1000) # w/a | ||
test.check(depth_sensor.get_option(rs.option.gain) == gain_range.default) | ||
|
||
depth_sensor.set_option(rs.option.sequence_id, 2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some comment to explain that seq id 2 should be with min values
unit-tests/live/d400/test-hdr.py
Outdated
test.check(depth_sensor.get_option(rs.option.hdr_enabled) == 0) | ||
|
||
device.hardware_reset() | ||
time.sleep(5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- isn't it long? 5 seconds.
- I see these lines are between each test, please make a function for it
unit-tests/live/d400/test-hdr.py
Outdated
""" | ||
helper method | ||
checks that the frames resulting from the hdr_merge processing block are generated | ||
from frames streamed within this method (and not using old frames) - see RSDSO-17341. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would change "within this method" to "within this streaming session" - only if you agree
unit-tests/live/d400/test-hdr.py
Outdated
5 3 (no frame to merge with 5 as 6 didn't arrive yet) | ||
6 5 (merged frames 5+6) | ||
... (more frames, until a frame counter reset) | ||
1 1 (hdr # should like the value we reset to) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean "hdr # should be around the value we reset to"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not around, should be that value exactly... I'll fix that typo
unit-tests/live/d400/test-hdr.py
Outdated
pipe.stop() | ||
depth_sensor.set_option(rs.option.hdr_enabled, 0) # disable hdr before next tests | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it's on purpose, by your comment I figured it's not needed here?
unit-tests/live/d400/test-hdr.py
Outdated
# get depth frame data | ||
depth_frame = data.get_depth_frame() | ||
if not test.check(depth_frame.supports_frame_metadata(rs.frame_metadata_value.sequence_id)): | ||
return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add here some log reading the fact that this metadata could not be read?
Do you think it should fail the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on a second look... I dont think we need sequence id here, right? just the frame counter, what if we just remove it and remove also test.check(merged_frame.supports_frame_metadata(rs.frame_metadata_value.sequence_id))
?
unit-tests/live/d400/test-hdr.py
Outdated
frame_counter = frame.get_frame_metadata(rs.frame_metadata_value.frame_counter) | ||
frame_seq_id = frame.get_frame_metadata(rs.frame_metadata_value.sequence_id) | ||
if frame_counter != prev_frame_counter + 1: # can only compare sequential frames | ||
sequence_id = frame_seq_id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change this param name from sequence_id to expected_sequence_id.
unit-tests/live/d400/test-hdr.py
Outdated
depth_sensor.set_option(rs.option.emitter_on_off, 1) | ||
test.check(depth_sensor.get_option(rs.option.emitter_on_off) == 0) | ||
|
||
# Control's presence verified in the beginning of the block |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand this comment - could you rephrase it, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few comments - but really great work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great task!
Tracked on: [LRS-1000]