Skip to content

Commit 7dc5666

Browse files
committed
support SR306 camera
1 parent fd9eda5 commit 7dc5666

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/ivcam/sr300.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,7 @@ namespace librealsense
514514

515515
auto fw_version = _hw_monitor->get_firmware_version_string(gvd_buff, fw_version_offset);
516516
auto serial = _hw_monitor->get_module_serial_string(gvd_buff, module_serial_offset);
517+
auto pid_hex_str = hexify(depth.pid);
517518

518519
_camer_calib_params = [this]() { return get_calibration(); };
519520
enable_timestamp(true, true);
@@ -525,6 +526,7 @@ namespace librealsense
525526
register_info(RS2_CAMERA_INFO_FIRMWARE_VERSION, fw_version);
526527
register_info(RS2_CAMERA_INFO_PHYSICAL_PORT, depth.device_path);
527528
register_info(RS2_CAMERA_INFO_DEBUG_OP_CODE, std::to_string(static_cast<int>(fw_cmd::GLD)));
529+
register_info(RS2_CAMERA_INFO_PRODUCT_ID, pid_hex_str);
528530
register_info(RS2_CAMERA_INFO_PRODUCT_LINE, "SR300");
529531
register_info(RS2_CAMERA_INFO_CAMERA_LOCKED, _is_locked ? "YES" : "NO");
530532

src/ivcam/sr300.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ namespace librealsense
2727
{
2828
const uint16_t SR300_PID = 0x0aa5;
2929
const uint16_t SR300v2_PID = 0x0B48;
30-
const uint16_t SR306_PID = 0x0B48;
31-
//const uint16_t SR306_PID = 0x0aa3;
30+
//const uint16_t SR306_PID = 0x0B48;
31+
const uint16_t SR306_PID = 0x0aa3;
3232
const uint16_t SR300_RECOVERY = 0x0ab3;
3333

3434
const double TIMESTAMP_10NSEC_TO_MSEC = 0.00001;

tools/benchmark/rs-benchmark.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ using namespace std;
2222
using namespace chrono;
2323
using namespace TCLAP;
2424
using namespace rs2;
25-
//using namespace librealsense;
2625

2726
#if (defined(_WIN32) || defined(_WIN64))
2827
#include <intrin.h>
@@ -235,13 +234,15 @@ int main(int argc, char** argv) try
235234
suites.push_back(make_shared<gl_blocks>());
236235
#endif
237236

237+
rs2::context ctx;
238+
auto list = ctx.query_devices();
239+
auto dev = list.front();
238240
pipeline p;
239241
config cfg;
240242
cfg.enable_stream(RS2_STREAM_DEPTH);
241-
242-
//cfg.enable_stream(RS2_STREAM_COLOR, RS2_FORMAT_YUYV, 30); // TODO :: remove it when running sr306
243+
if (std::string(dev.get_info(RS2_CAMERA_INFO_PRODUCT_ID)) != "0AA3") // pid of sr306
244+
cfg.enable_stream(RS2_STREAM_COLOR, RS2_FORMAT_YUYV, 30);
243245
auto prof = p.start(cfg);
244-
auto dev = prof.get_device();
245246
auto name = dev.get_info(RS2_CAMERA_INFO_NAME);
246247
cout << "|**Device Name** |" << name << " |" << endl << endl;
247248
cout.precision(3);

0 commit comments

Comments
 (0)