Repository navigation
Remove PID whitelist in startDevice (let librealsense gate which cameras are supported) - #3532
Merged
Nir-Az merged 1 commit intoJun 30, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the hard-coded PID whitelist (and the D555-over-DDS special case) inside
RealSenseNodeFactory::startDevice(). The wrapper now instantiatesBaseRealSenseNodefor any device that reachesstartDevice(), deferring the "is this a RealSense camera I support?" question to the installed librealsense2.Why
Every path that reaches
startDevice()is already gated by librealsense itself:_device_query_thread)RSContextSingletonWrapper::getInstance().query_devices()changeDeviceCallback)rs2::event_information::get_new_devices()RSContextSingletonWrapper::getInstance().load_device(rosbag_filename)None of these can produce a non-RealSense device. So the wrapper's switch-over-PID was a redundant second filter — but a fragile one: every new camera model required adding its PID to the wrapper before it would work, even if the librealsense version on the machine already supported it. This was the motivation for the D555/DDS special case (DDS devices report
PRODUCT_IDas the literal string\"DDS\"rather than a hex PID, so the whitelist couldn't match by PID and had to fall through a name-based override).What changes
switch(pid) { case RS400_PID: ... default: ROS_FATAL_STREAM(\"Unsupported device!\") }block.connection_type == \"DDS\" && device_name.find(\"D555\")special case.ROS_INFO_STREAMannouncing the device that's starting.No public API change. Net diff is +7 / -43 in one file (
realsense_node_factory.cpp).Effects
startDevice(), so the old\"Unsupported device!\"fatal path is unreachable by construction.BaseRealSenseNodetruly can't drive, the failure now surfaces from theBaseRealSenseNodeconstructor /publishTopics()path (already wrapped in the existingtry/catch (rs2::backend_error&)below) rather than from a wrapper-side fatal.🤖 Generated with Claude Code