unit-tests
live
presets
regular-preset
move-custom
current.cpp
Go to the documentation of this file.
1
// License: Apache 2.0. See LICENSE file in root directory.
2
// Copyright(c) 2020 Intel Corporation. All Rights Reserved.
3
4
//#cmake: static!
5
6
#include "../presets-common.h"
7
#include <
l500/l500-options.h
>
8
9
using namespace
rs2
;
10
11
TEST_CASE
(
"move to custom after gain changed"
,
"[l500][live]"
)
12
{
13
auto
devices
=
find_devices_by_product_line_or_exit
(
RS2_PRODUCT_LINE_L500
);
14
auto
dev
=
devices
[0];
15
16
exit_if_fw_version_is_under
(
dev
,
MIN_GET_DEFAULT_FW_VERSION
);
17
18
auto
depth_sens =
dev
.first<
rs2::depth_sensor
>();
19
20
for
(
auto
preset = (
float
)
RS2_L500_VISUAL_PRESET_NO_AMBIENT
;
21
preset < (float)
RS2_L500_VISUAL_PRESET_AUTOMATIC
;
22
preset++ )
23
{
24
REQUIRE_NOTHROW
( depth_sens.set_option(
RS2_OPTION_VISUAL_PRESET
, preset ) );
25
26
option_range
range
;
27
REQUIRE_NOTHROW
( range
28
= depth_sens.get_option_range(
RS2_OPTION_POST_PROCESSING_SHARPENING
) );
29
30
REQUIRE_NOTHROW
(
31
depth_sens.set_option(
RS2_OPTION_POST_PROCESSING_SHARPENING
, range.max ) );
32
33
CAPTURE
( preset );
34
35
36
rs2_l500_visual_preset
curr_preset;
37
REQUIRE_NOTHROW
( curr_preset = (
rs2_l500_visual_preset
)(
int
)depth_sens.get_option(
38
RS2_OPTION_VISUAL_PRESET
) );
39
40
REQUIRE
( curr_preset ==
RS2_L500_VISUAL_PRESET_CUSTOM
);
41
42
REQUIRE_NOTHROW
( depth_sens.set_option(
RS2_OPTION_VISUAL_PRESET
, preset ) );
43
}
44
}
MIN_GET_DEFAULT_FW_VERSION
const std::string MIN_GET_DEFAULT_FW_VERSION("1.5.4.0")
exit_if_fw_version_is_under
void exit_if_fw_version_is_under(rs2::device &dev, librealsense::firmware_version version)
Definition:
live-common.h:79
test-d405-calibration-stream.dev
dev
Definition:
test-d405-calibration-stream.py:11
RS2_L500_VISUAL_PRESET_AUTOMATIC
Definition:
rs_option.h:166
rs2::depth_sensor
Definition:
rs_sensor.hpp:454
TEST_CASE
TEST_CASE("move to custom after gain changed", "[l500][live]")
Definition:
current.cpp:11
RS2_L500_VISUAL_PRESET_CUSTOM
Definition:
rs_option.h:160
rs2
Definition:
animated.h:9
l500-options.h
REQUIRE
#define REQUIRE(...)
Definition:
catch.hpp:17398
CAPTURE
#define CAPTURE(...)
Definition:
catch.hpp:17432
find_devices_by_product_line_or_exit
rs2::device_list find_devices_by_product_line_or_exit(int product)
Definition:
live-common.h:65
rs2::option_range
Definition:
rs_types.hpp:176
test-fg.devices
devices
Definition:
test-fg.py:9
REQUIRE_NOTHROW
REQUIRE_NOTHROW(rs2_log(RS2_LOG_SEVERITY_INFO, "Log message using rs2_log()", nullptr))
RS2_PRODUCT_LINE_L500
#define RS2_PRODUCT_LINE_L500
Definition:
rs_context.h:96
RS2_OPTION_POST_PROCESSING_SHARPENING
Definition:
rs_option.h:89
RS2_L500_VISUAL_PRESET_NO_AMBIENT
Definition:
rs_option.h:162
range
GLsizei range
Definition:
glad/glad/glad.h:1535
RS2_OPTION_VISUAL_PRESET
Definition:
rs_option.h:36
rs2_l500_visual_preset
rs2_l500_visual_preset
For L500 devices: provides optimized settings (presets) for specific types of usage.
Definition:
rs_option.h:158
librealsense2
Author(s): LibRealSense ROS Team
autogenerated on Thu Dec 22 2022 03:43:16