Skip to content
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

Added option to enable/disable alternate_ir. #7672

Merged
merged 3 commits into from
Nov 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/librealsense2/h/rs_option.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ extern "C" {
RS2_OPTION_SEQUENCE_ID, /**< HDR Sequence ID - 0 is not HDR; sequence ID for HDR configuration starts from 1 */
RS2_OPTION_HUMIDITY_TEMPERATURE, /**< Humidity temperature [Deg Celsius]*/
RS2_OPTION_ENABLE_MAX_USABLE_RANGE, /**< Turn on/off the maximum usable depth sensor range given the amount of ambient light in the scene */
RS2_OPTION_ALTERNATE_IR, /**< Turn on/off the alternate IR, When enabling alternate IR, the IR image is holding the amplitude of the depth correlation. */
RS2_OPTION_COUNT /**< Number of enumeration values. Not a valid input: intended to be used in for-loops. */
} rs2_option;

Expand Down
10 changes: 10 additions & 0 deletions src/l500/l500-options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,16 @@ namespace librealsense

depth_sensor.register_option(RS2_OPTION_SENSOR_MODE, resolution_option);

if( _fw_version >= firmware_version( "1.5.2.0" ) )
{
auto alt_ir = std::make_shared< l500_hw_options >( _hw_monitor.get(),
alternate_ir,
resolution_option.get(),
"Enable/Disable alternate IR" );

depth_sensor.register_option( RS2_OPTION_ALTERNATE_IR, alt_ir );
}

_hw_options[RS2_OPTION_POST_PROCESSING_SHARPENING] = register_option< l500_hw_options,
hw_monitor *,
l500_control,
Expand Down
3 changes: 2 additions & 1 deletion src/l500/l500-options.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ namespace librealsense
apd = 4,
laser_gain = 5,
min_distance = 6,
invalidation_bypass = 7
invalidation_bypass = 7,
alternate_ir = 8
};

enum l500_command
Expand Down
1 change: 1 addition & 0 deletions src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ namespace librealsense
CASE(SEQUENCE_ID)
CASE(HUMIDITY_TEMPERATURE)
CASE(ENABLE_MAX_USABLE_RANGE)
case RS2_OPTION_ALTERNATE_IR: return "Alternate IR";
default: assert(!is_valid(value)); return UNKNOWN_VALUE;
}
#undef CASE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ public enum Option {
SEQUENCE_SIZE(78),
SEQUENCE_ID(79),
HUMIDITY_TEMPERATURE(80),
ENABLE_MAX_USABLE_RANGE(81);
ENABLE_MAX_USABLE_RANGE(81),
ALTERNATE_IR(82),

private final int mValue;

private Option(int value) { mValue = value; }
Expand Down
7 changes: 5 additions & 2 deletions wrappers/csharp/Intel.RealSense/Types/Enums/Option.cs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ public enum Option
HumidityTemperature = 80,

/// <summary>Turn on/off the maximum usable range who calculates the maximum range of the camera given the amount of ambient light in the scene </summary>
EnableMaxUsableRange = 81
}
EnableMaxUsableRange = 81,

/// <summary>Turn on/off the alternate IR, When enabling alternate IR, the IR image is holding the amplitude of the depth correlation. </summary>
AlternateIR = 82
}
}
3 changes: 2 additions & 1 deletion wrappers/matlab/option.m
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
sequence_id (79)
humidity_temperature (80)
max_usable_range (81)
count (82)
alternate_IR (82)
count (83)
end
end
3 changes: 3 additions & 0 deletions wrappers/nodejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4943,6 +4943,7 @@ const option = {
OPTION_SEQUENCE_ID: RS2.RS2_OPTION_SEQUENCE_ID,
OPTION_HUMIDITY_TEMPERATURE: RS2.RS2_OPTION_HUMIDITY_TEMPERATURE,
OPTION_ENABLE_MAX_USABLE_RANGE: RS2.RS2_OPTION_ENABLE_MAX_USABLE_RANGE,
OPTION_ALTERNATE_IR: RS2.RS2_OPTION_ALTERNATE_IR,
/**
* Number of enumeration values. Not a valid input: intended to be used in for-loops.
* @type {Integer}
Expand Down Expand Up @@ -5097,6 +5098,8 @@ const option = {
return this.option_humidity_temperature;
case this.OPTION_ENABLE_MAX_USABLE_RANGE:
return this.option_enable_max_usable_range;
case this.OPTION_ALTERNATE_IR:
return this.option_alternate_ir;
default:
throw new TypeError(
'option.optionToString(option) expects a valid value as the 1st argument');
Expand Down
1 change: 1 addition & 0 deletions wrappers/nodejs/src/addon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4762,6 +4762,7 @@ void InitModule(v8::Local<v8::Object> exports) {
_FORCE_SET_ENUM(RS2_OPTION_SEQUENCE_ID);
_FORCE_SET_ENUM(RS2_OPTION_HUMIDITY_TEMPERATURE);
_FORCE_SET_ENUM(RS2_OPTION_ENABLE_MAX_USABLE_RANGE);
_FORCE_SET_ENUM(RS2_OPTION_ALTERNATE_IR);
_FORCE_SET_ENUM(RS2_OPTION_COUNT);

// rs2_camera_info
Expand Down
1 change: 1 addition & 0 deletions wrappers/python/pybackend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ PYBIND11_MODULE(NAME, m) {
.value("sequence_id", RS2_OPTION_SEQUENCE_ID)
.value("humidity_temperature", RS2_OPTION_HUMIDITY_TEMPERATURE)
.value("enable_max_usable_range", RS2_OPTION_ENABLE_MAX_USABLE_RANGE)
.value("alternate_ir", RS2_OPTION_ALTERNATE_IR)
.value("count", RS2_OPTION_COUNT);

py::enum_<platform::power_state> power_state(m, "power_state");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ enum class ERealSenseOptionType : uint8
SEQUENCE_ID , /**< HDR Sequence ID - 0 is not HDR; sequence ID for HDR configuration starts from 1 */
HUMIDITY_TEMPERATURE , /**< Humidity temperature [Deg Celsius]*/
ENABLE_MAX_USABLE_RANGE , /**< Turn on/off the maximum usable range who calculates the maximum range of the camera given the amount of ambient light in the scene */
ALTERNATE_IR , /**< Turn on/off the alternate IR, When enabling alternate IR, the IR image is holding the amplitude of the depth correlation. */
};

UENUM(Blueprintable)
Expand Down