-
Couldn't load subscription status.
- Fork 4.9k
Test timestamp domain #10925
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
Merged
Nir-Az
merged 10 commits into
IntelRealSense:development
from
Tamir91:test-timestamp-domain
Oct 2, 2022
Merged
Test timestamp domain #10925
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
f43330b
test-timestamp-damain file created
Tamir91 bba9950
test completed
Tamir91 7da6029
test added to stage
Tamir91 8d2c7c4
minors changes
Tamir91 ae281dc
new version with queue
Tamir91 a7598f4
test prints removed
Tamir91 b191e67
Excetions was changed
Tamir91 796ec03
test changed second time according instructions #10925
Tamir91 f8c63a1
small changes according Nir
Tamir91 f1de5ac
bug unreacheable last line fixed
Tamir91 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| # License: Apache 2.0. See LICENSE file in root directory. | ||
| # Copyright(c) 2022 Intel Corporation. All Rights Reserved. | ||
|
|
||
| # test: device D400* | ||
|
|
||
| import time | ||
| import pyrealsense2 as rs | ||
| from rspy import test | ||
|
|
||
| # This test checks Timestamp domain toggle option for color and depth sensor | ||
|
|
||
|
|
||
| def frame_callback(frame): | ||
| global expected_time_stamp_domain | ||
| test.check_equal(int(frame.get_frame_timestamp_domain()), expected_time_stamp_domain) | ||
|
|
||
|
|
||
| ################################################################################################ | ||
| test.start("Start test") | ||
Tamir91 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ENABLE = 1 | ||
| DISABLE = 0 | ||
|
|
||
| devices = test.find_first_device_or_exit() | ||
Nir-Az marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| time.sleep(3) # The device starts at D0 (Operational) state, allow time for it to get into idle state | ||
Tamir91 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| depth_sensor = devices.first_depth_sensor() | ||
| color_sensor = devices.first_color_sensor() | ||
|
|
||
| depth_sensor.get_option(rs.option.global_time_enabled) | ||
Tamir91 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| color_sensor.get_option(rs.option.global_time_enabled) | ||
|
|
||
| depth_profile = next(p for p in depth_sensor.profiles if p.fps() == 30 | ||
| and p.stream_type() == rs.stream.depth | ||
| and p.format() == rs.format.z16 | ||
| and p.as_video_stream_profile().width() == 640 | ||
| and p.as_video_stream_profile().height() == 480) | ||
|
|
||
| color_profile = next(p for p in color_sensor.profiles if p.fps() == 30 | ||
| and p.stream_type() == rs.stream.color | ||
| and p.format() == rs.format.yuyv | ||
| and p.as_video_stream_profile().width() == 640 | ||
| and p.as_video_stream_profile().height() == 480) | ||
|
|
||
| depth_sensor.open(depth_profile) | ||
| depth_sensor.start(frame_callback) | ||
|
|
||
Tamir91 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| ############################################################################################# | ||
| # Test #1 | ||
Tamir91 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| expected_time_stamp_domain = 0 | ||
Tamir91 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| depth_sensor.set_option(rs.option.global_time_enabled, DISABLE) | ||
| test.check_equal(DISABLE, depth_sensor.get_option(rs.option.global_time_enabled)) | ||
| time.sleep(0.2) | ||
|
|
||
| ############################################################################################# | ||
| # Test #2 | ||
| expected_time_stamp_domain = 2 | ||
Tamir91 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| depth_sensor.set_option(rs.option.global_time_enabled, ENABLE) | ||
| test.check_equal(ENABLE, depth_sensor.get_option(rs.option.global_time_enabled)) | ||
| time.sleep(0.2) | ||
Tamir91 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ############################################################################################# | ||
|
|
||
| depth_sensor.stop() | ||
| depth_sensor.close() | ||
|
|
||
| color_sensor.open(color_profile) | ||
Tamir91 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| color_sensor.start(frame_callback) | ||
|
|
||
| ############################################################################################# | ||
| # Test #3 | ||
| expected_time_stamp_domain = 0 | ||
| color_sensor.set_option(rs.option.global_time_enabled, DISABLE) | ||
| test.check_equal(DISABLE, color_sensor.get_option(rs.option.global_time_enabled)) | ||
| time.sleep(0.2) | ||
|
|
||
| ############################################################################################# | ||
| # Test #4 | ||
| expected_time_stamp_domain = 2 | ||
| color_sensor.set_option(rs.option.global_time_enabled, ENABLE) | ||
| test.check_equal(ENABLE, color_sensor.get_option(rs.option.global_time_enabled)) | ||
| time.sleep(0.2) | ||
|
|
||
| ############################################################################################# | ||
|
|
||
| color_sensor.stop() | ||
| color_sensor.close() | ||
|
|
||
| test.finish() | ||
| test.print_results_and_exit() | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.