Repository navigation
Drop 'Intel' prefix from camera visible names - #15178
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates librealsense device naming by removing the "Intel " prefix from RS2_CAMERA_INFO_NAME (e.g., "Intel RealSense D455" → "RealSense D455") and adjusts downstream consumers (viewer logic, DDS adapter, Python bindings, ROS playback, and tests/fixtures) that depend on the literal name prefix.
Changes:
- Updated D400/D500 SKU name maps to emit
"RealSense ..."visible names. - Updated multiple prefix consumers (regex/prefix stripping/mesh selection/legacy ROS reader) to use the new prefix.
- Updated unit tests, examples, and preset fixtures to match the new visible device names.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| wrappers/python/pyrs_device.cpp | Updates Python device __repr__ prefix stripping to the new "RealSense " prefix |
| wrappers/python/examples/d500_triggered_calibration.py | Updates D585S safety-camera name check to "RealSense D585S" |
| unit-tests/live/calib/calibrations_common.py | Updates D415 name check used for emitter behavior |
| unit-tests/infra-tests/test_iq_snapshot_dedup.py | Updates mocked pipeline device names used for snapshot dedup tests |
| unit-tests/dds/d455.py | Updates DDS fixture device name |
| unit-tests/dds/d435i.py | Updates DDS fixture device name |
| unit-tests/dds/d405.py | Updates DDS fixture device name |
| tools/realsense-viewer/presets/sample.preset | Updates sample preset device name |
| tools/dds/dds-adapter/rs-dds-adapter.cpp | Updates ROS2 node-name prefix stripping to new "RealSense " prefix |
| src/media/ros/ros_reader.cpp | Updates legacy TM2 playback name to "RealSense TM2" |
| src/gl/camera-shader.cpp | Updates viewer camera-mesh selection string matching to new "RealSense ..." names |
| src/ds/d500/d500-private.h | Removes "Intel " prefix from D500 SKU name map entries |
| src/ds/d400/d400-private.h | Removes "Intel " prefix from D400 SKU name map entries |
| common/on-chip-calib.cpp | Updates D415 special-case name string |
| common/device-model.cpp | Updates preset-file lookup regex to parse "RealSense ..." names |
Comments suppressed due to low confidence (1)
tools/dds/dds-adapter/rs-dds-adapter.cpp:49
build_node_name()strips only the new "RealSense " prefix. If a device name still starts with "Intel RealSense " (e.g., playback from older recordings), node names/topic-roots will change unexpectedly (e.g.Intel_RealSense_D455_<sn>). Consider stripping both prefixes to keep node names stable across device sources.
constexpr char const * DEVICE_NAME_PREFIX = "RealSense ";
constexpr size_t DEVICE_NAME_PREFIX_CCH = 10;
// We don't need the prefix in the path
std::string model_name = rs2_camera_name;
if( model_name.length() > DEVICE_NAME_PREFIX_CCH
&& 0 == strncmp( model_name.data(), DEVICE_NAME_PREFIX, DEVICE_NAME_PREFIX_CCH ) )
|
Overall lookd good, I triggered a nightly CI to see all cases runs, |
|
Found as breaking change for ROS, we need to align it too Opened a matching PR here for your review, should be merged together: |
|
Pushed review fixes (commit Addressed
Dismissed (with rationale in threads)
Cross-repo coordination
Local build (realsense-viewer) green after the changes. |
|
@Nir-Az - i will follow-up on D500 names change as well. |
|
Noticed another miss librealsense/src/gl/camera-shader.cpp Line 166 in 09937b5 I suggest changing all line to find instead of start with and drop Intel |
Nir-Az
left a comment
There was a problem hiding this comment.
fix needed in camera shader
|
@Nir-Az done (commit std::string dev_name = dev.get_info(RS2_CAMERA_INFO_NAME);
if (dev_name.find("D415") != std::string::npos) index = 0;
if (dev_name.find("D435") != std::string::npos ||
dev_name.find("D436") != std::string::npos) index = 1;
if (dev_name.find("D45") != std::string::npos) index = 2;Local viewer build green. |
| if (starts_with(dev_name, "Intel RealSense D435") || | ||
| starts_with(dev_name, "Intel RealSense D436")) index = 1; | ||
| if (starts_with(dev_name, "Intel RealSense D45")) index = 2; | ||
| std::string dev_name = dev.get_info(RS2_CAMERA_INFO_NAME); |
There was a problem hiding this comment.
camera_renderer::process_frame mixes device-name parsing, index selection, and full GL rendering logic; split responsibilities into helpers to reduce cognitive complexity
Details
✨ AI Reasoning
1. What is this code trying to accomplish? It identifies a camera model index from the device name and then performs GL rendering of a selected mesh. 2. Does this harm maintainability? Combining parsing logic and full rendering flow in one function increases cognitive load. 3. Is this appropriate? The method orchestrates diverse responsibilities (device name parsing, index selection, shader setup, fixed-function rendering), so it's harder to reason about at a glance. 4. Would fixing meaningfully improve the codebase? Yes — separating name-matching and rendering paths would localize concerns and simplify testing. 5. Is this a common pattern? Renderers often separate resource selection and draw calls; here they're combined. 6. Fixable in PR scope? The PR introduced a small change inside the function; refactoring into helper functions is reasonable but beyond this tiny change. Conclusion: the modified function remains a medium-length, multi-responsibility function that is more complex than desirable.
🔧 How do I fix it?
Break down long functions into smaller helper functions. Aim for functions under 60 lines with fewer than 10 local variables.
Reply @AikidoSec feedback: [FEEDBACK] to get better review comments in the future.
Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info
There was a problem hiding this comment.
Makes sense but not related to this PR. Can be handled seperately.
b1ab176 to
6b7ebc5
Compare
|
Rebased on latest |
|
RetriggerGated |
Summary
Removes the
Intelprefix from camera visible names exposed viaRS2_CAMERA_INFO_NAME. E.g.Intel RealSense D455->RealSense D455. Rest of the name string is unchanged.Changes
Name source (single source of truth):
src/ds/d400/d400-private.hrs400_sku_namesandsrc/ds/d500/d500-private.hrs500_sku_names- droppedIntelfrom every entry (D4xx/D5xx, F416, Recovery, IMU, USB2, DS5U, Tracking variants).src/media/ros/ros_reader.cpp- legacy TM2 playback name.Prefix consumers updated (read the name, depend on the literal prefix):
src/gl/camera-shader.cpp- 3D camera mesh selection (starts_with).common/device-model.cpp- preset-file lookup regex.common/on-chip-calib.cpp- D415 emitter special-case.wrappers/python/pyrs_device.cppandtools/dds/dds-adapter/rs-dds-adapter.cpp- prefix strip (length 16 -> 10).Tests / fixtures / examples:
unit-tests/dds/{d455,d435i,d405}.py,unit-tests/live/calib/calibrations_common.py,unit-tests/infra-tests/test_iq_snapshot_dedup.py,wrappers/python/examples/d500_triggered_calibration.py,tools/realsense-viewer/presets/sample.preset.unit-tests/py/rspy/devices.pyalready handles bothIntel RealSenseandRealSenseprefixes (kept).Out of scope (not the camera visible name)
OS USB descriptors, metadata field names, GPU vendor checks, L500/L515 (Unity) matching, C# assembly/window-title branding, docs.
Notes
Safety Camerasensor name never had anIntelprefix.