Repository navigation
Add Edge Enhancement visual preset for D435/D435I - #15665
Conversation
sysrsbuild-gh-agentic
left a comment
There was a problem hiding this comment.
Auto-generated review by rs-agentic bot. Found 2 bugs and 1 note below.
sysrsbuild-gh-agentic
left a comment
There was a problem hiding this comment.
🤖 [rs-agentic] Reviewed new commit — one new bug noted inline; prior PID-coverage fix approved.
|
The viewer half is handled by skipping null labels in Suggested:
(1) is the blocking one; (2) is hardening. 🤖 Generated by AI |
…y; harden preset validation
|
✅ Fixed in d3a1621, both points.
Verified on the D405: attempting 🤖 Generated by AI |
sysrsbuild-gh-agentic
left a comment
There was a problem hiding this comment.
🤖 [rs-agentic] Reviewed the latest synchronize commit. Two new bugs found in the changes.
| << "apply_preset(...) failed! Given device doesn't support Remove IR Pattern Preset (pid=0x" | ||
| << std::hex << device_pid << ")" ); | ||
| break; | ||
| } |
There was a problem hiding this comment.
🤖 [rs-agentic] BUG: The default: throw was removed from the inner switch(device_pid) inside the REMOVE_IR_PATTERN case. is_preset_supported() and the dispatch switch now maintain two separate PID lists — if a PID is added to is_preset_supported() but omitted from the dispatch switch, the check passes, the switch matches no case, and apply_preset() silently continues with an uninitialised/default preset instead of throwing. Add back default: throw (or a default: assert(false)) to make the mismatch visible at runtime.
| auto label = sensor.get_option_value_description( opt, i ); | ||
| if( ! label ) | ||
| return {}; // Missing value - not an enum | ||
| continue; // Value hidden for this device, not evidence the option isn't an enum |
There was a problem hiding this comment.
🤖 [rs-agentic] BUG: If current_value equals a value whose label is nullptr (hidden for this device), the continue skips the current_index = labels.size() assignment. The caller receives a stale/wrong current_index, misidentifying the currently-active option in the combo box. Consider checking i == current_value before the continue and either logging a warning or falling back to index 0 when the live value has no visible description.
Nir-Az
left a comment
There was a problem hiding this comment.
LGTM. Enum appended before _COUNT so no ABI change, and apply_preset()/get_value_description() share one supported-check instead of duplicating the pid logic.
Checked the relaxed is_enum() against every enum option in the tree — all describe their full range, so nothing else changes between slider and dropdown rendering.
One thing still worth eyeballing before merge: the viewer itself on a device without Remove IR Pattern, that Visual Preset still draws as a dropdown. Verification so far is API-level on a D405.
Overview: Adds a new "Edge Enhancement" visual preset, tuned for stronger edge preservation, available on all D400 devices.
Tracked on [RSDSO-21893]
Why
D400 devices lacked a preset tuned for stronger edge preservation in the depth map.
Summary
RS2_RS400_VISUAL_PRESET_EDGE_ENHANCEMENTtors2_rs400_visual_preset(appended before_COUNT, no existing values changed)edge_enhancement()inpresets.cpp/.h, populated from a validated EdgeMap tuning JSON for D400 devicesapply_preset()inadvanced_mode.cppand into thers2_rs400_visual_preset_to_string()mappingget_preset_max_value()ind400-device.cppnow returnsEDGE_ENHANCEMENTfor all D400 devices (not just D435/D435I) so the preset is reachable viaRS2_OPTION_VISUAL_PRESETeverywhereds_advanced_mode_base::is_preset_supported(), checked against both firmware-registered feature support and device pid, so a preset a device doesn't support (e.g.REMOVE_IR_PATTERNon anything but D400/410/415/460) is no longer listed as a selectable option in the Visual Preset dropdown, instead of only failing at apply timeoption_model::get_combo_labels()now skips option values with no description instead of assuming every value in[min, max]is validTest plan
realsense2core library (Release, x64) — compiles cleanly, no new warningsrealsense-viewerwith the changeREMOVE_IR_PATTERNis correctly hidden from the option's enumerated values, and applyingEDGE_ENHANCEMENT(laser_state=0) succeeds with no exception🤖 Generated by AI