<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Enumerate/list all RealSense D4xx devices in Items with no label</title>
    <link>https://community.intel.com/t5/Items-with-no-label/Enumerate-list-all-RealSense-D4xx-devices/m-p/621657#M13445</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question about the query_devices function in the librealsense 2.0 SDK:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rs2::context oContext;&lt;/P&gt;&lt;P&gt;listDevices = oContext.query_devices();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will enumerate devices, which are not devices supported by the Librealsense 2.0 SDK. This is very unfortunate. In my case a Logitech 920C Webcam and a ZED stereo cam will also be listed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My work around is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rs2::context oContext;&lt;/P&gt;&lt;P&gt;listDevices.clear();&lt;/P&gt;&lt;P&gt;std::vector listDevicesTmp;&lt;/P&gt;&lt;P&gt;listDevicesTmp = oContext.query_devices(); // Get a snapshot of currently connected devices&lt;/P&gt;&lt;P&gt;if (listDevicesTmp.size() == 0)&lt;/P&gt;&lt;P&gt;     return 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (int nI = 0; nI &amp;lt; listDevicesTmp.size(); ++nI)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;     rs2::device oCurrentDevice = listDevicesTmp[nI];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     if (oCurrentDevice.supports(RS2_CAMERA_INFO_NAME))&lt;/P&gt;&lt;P&gt;     {&lt;/P&gt;&lt;P&gt;          const char * szCameraName = oCurrentDevice.get_info(RS2_CAMERA_INFO_NAME);&lt;/P&gt;&lt;P&gt;          std::string sName(szCameraName, strlen(szCameraName));&lt;/P&gt;&lt;P&gt;          if (sName.find("RealSense") != std::string::npos &amp;amp;&amp;amp; (sName.find("435") != std::string::npos || sName.find("415") != std::string::npos))&lt;/P&gt;&lt;P&gt;          {&lt;/P&gt;&lt;P&gt;               listDevices.push_back(oCurrentDevice);&lt;/P&gt;&lt;P&gt;          }&lt;/P&gt;&lt;P&gt;     }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there something more elegant available? Now, I have to adjust the string.find part of the code whenever the librealsense SDK 2.0 supports more cameras.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Mar 2018 18:36:11 GMT</pubDate>
    <dc:creator>SEber3</dc:creator>
    <dc:date>2018-03-19T18:36:11Z</dc:date>
    <item>
      <title>Enumerate/list all RealSense D4xx devices</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Enumerate-list-all-RealSense-D4xx-devices/m-p/621657#M13445</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question about the query_devices function in the librealsense 2.0 SDK:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rs2::context oContext;&lt;/P&gt;&lt;P&gt;listDevices = oContext.query_devices();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;will enumerate devices, which are not devices supported by the Librealsense 2.0 SDK. This is very unfortunate. In my case a Logitech 920C Webcam and a ZED stereo cam will also be listed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My work around is the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rs2::context oContext;&lt;/P&gt;&lt;P&gt;listDevices.clear();&lt;/P&gt;&lt;P&gt;std::vector listDevicesTmp;&lt;/P&gt;&lt;P&gt;listDevicesTmp = oContext.query_devices(); // Get a snapshot of currently connected devices&lt;/P&gt;&lt;P&gt;if (listDevicesTmp.size() == 0)&lt;/P&gt;&lt;P&gt;     return 0;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for (int nI = 0; nI &amp;lt; listDevicesTmp.size(); ++nI)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;     rs2::device oCurrentDevice = listDevicesTmp[nI];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     if (oCurrentDevice.supports(RS2_CAMERA_INFO_NAME))&lt;/P&gt;&lt;P&gt;     {&lt;/P&gt;&lt;P&gt;          const char * szCameraName = oCurrentDevice.get_info(RS2_CAMERA_INFO_NAME);&lt;/P&gt;&lt;P&gt;          std::string sName(szCameraName, strlen(szCameraName));&lt;/P&gt;&lt;P&gt;          if (sName.find("RealSense") != std::string::npos &amp;amp;&amp;amp; (sName.find("435") != std::string::npos || sName.find("415") != std::string::npos))&lt;/P&gt;&lt;P&gt;          {&lt;/P&gt;&lt;P&gt;               listDevices.push_back(oCurrentDevice);&lt;/P&gt;&lt;P&gt;          }&lt;/P&gt;&lt;P&gt;     }&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is there something more elegant available? Now, I have to adjust the string.find part of the code whenever the librealsense SDK 2.0 supports more cameras.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Mar 2018 18:36:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Enumerate-list-all-RealSense-D4xx-devices/m-p/621657#M13445</guid>
      <dc:creator>SEber3</dc:creator>
      <dc:date>2018-03-19T18:36:11Z</dc:date>
    </item>
    <item>
      <title>Re: Enumerate/list all RealSense D4xx devices</title>
      <link>https://community.intel.com/t5/Items-with-no-label/Enumerate-list-all-RealSense-D4xx-devices/m-p/621658#M13446</link>
      <description>&lt;P&gt;Hello Svebert, &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Thanks for posting in the Intel RealSense community. &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;LibrealSense 2.0 was created for the D400 cameras and the SR300. Intel has not tested or validated any other camera from other manufacturers with the Librealsense software. &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;There is no solution or code available from Intel that would help you achieving the Librealsense detecting other cameras. &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Thanks for your understanding. &lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;Best Regards, &lt;P&gt;&amp;nbsp;&lt;/P&gt;Juan N.</description>
      <pubDate>Mon, 19 Mar 2018 23:47:26 GMT</pubDate>
      <guid>https://community.intel.com/t5/Items-with-no-label/Enumerate-list-all-RealSense-D4xx-devices/m-p/621658#M13446</guid>
      <dc:creator>idata</dc:creator>
      <dc:date>2018-03-19T23:47:26Z</dc:date>
    </item>
  </channel>
</rss>

