Skip to content

Commit

Permalink
Verify support for options before setting them
Browse files Browse the repository at this point in the history
  • Loading branch information
OhadMeir committed Apr 20, 2023
1 parent eb19f75 commit bff285f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions unit-tests/live/frames/test-fps.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def frame_cb(frame):
ds = dev.first_depth_sensor()
# Set auto-exposure option as it might take precedence over requested FPS
if product_line == "D400":
ds.set_option(rs.option.enable_auto_exposure, 1)
if ds.supports(rs.option.enable_auto_exposure):
ds.set_option(rs.option.enable_auto_exposure, 1)

try:
dp = next(p for p in ds.profiles
Expand All @@ -102,10 +103,13 @@ def frame_cb(frame):
cs = dev.first_color_sensor()
# Set auto-exposure option as it might take precedence over requested FPS
if product_line == "D400":
cs.set_option(rs.option.enable_auto_exposure, 1)
cs.set_option(rs.option.auto_exposure_priority, 0) # AE priority should be 0 for constant FPS
if cs.supports(rs.option.enable_auto_exposure):
cs.set_option(rs.option.enable_auto_exposure, 1)
if cs.supports(rs.option.auto_exposure_priority):
cs.set_option(rs.option.auto_exposure_priority, 0) # AE priority should be 0 for constant FPS
elif product_line == "L500":
cs.set_option(rs.option.enable_auto_exposure, 0)
if cs.supports(rs.option.enable_auto_exposure):
cs.set_option(rs.option.enable_auto_exposure, 0)

try:
cp = next(p for p in cs.profiles
Expand Down

0 comments on commit bff285f

Please sign in to comment.