···136136 dai::CameraImageOrientation image_orientation;
137137 uint32_t fps;
138138 bool interleaved;
139139+ bool oak_d_lite;
139140};
140141141142···248249}
249250250251static void
251251-depthai_print_connected_cameras(struct depthai_fs *depthai)
252252+depthai_guess_camera_type(struct depthai_fs *depthai)
252253{
254254+ // We could be a lot more pedantic here, but let's just not.
255255+ // For now, ov7251 == oak-d lite, and ov9282 == oak-d/oak-d S2/oak-d pro
253256 std::ostringstream oss = {};
254254- for (const auto &cam : depthai->device->getConnectedCameras()) {
255255- oss << "'" << static_cast<int>(cam) << "' ";
257257+ std::vector<dai::CameraBoardSocket> sockets = depthai->device->getConnectedCameras();
258258+ std::unordered_map<dai::CameraBoardSocket, std::string> sensornames = depthai->device->getCameraSensorNames();
259259+260260+ bool ov9282 = false;
261261+262262+ bool ov7251 = false;
263263+264264+265265+266266+ for (size_t i = 0; i < sockets.size(); i++) {
267267+ dai::CameraBoardSocket sock = sockets[i];
268268+ std::string sensorname = sensornames.at(sock);
269269+ if (sensorname == "OV9282" || sensorname == "OV9*82") {
270270+ ov9282 = true;
271271+ } else if (sensorname == "OV7251") {
272272+ ov7251 = true;
273273+ }
274274+ oss << "'" << static_cast<int>(sock) << "': " << sensorname << ", ";
256275 }
276276+277277+257278 std::string str = oss.str();
258279259280 DEPTHAI_DEBUG(depthai, "DepthAI: Connected cameras: %s", str.c_str());
281281+282282+ if (ov9282 && !ov7251) {
283283+ // OAK-D
284284+ DEPTHAI_DEBUG(depthai, "DepthAI: Found an OAK-D!");
285285+ depthai->oak_d_lite = false;
286286+ } else if (ov7251 && !ov9282) {
287287+ // OAK-D Lite
288288+ DEPTHAI_DEBUG(depthai, "DepthAI: Found and OAK-D Lite!");
289289+ depthai->oak_d_lite = true;
290290+ } else {
291291+ DEPTHAI_WARN(depthai,
292292+ "DepthAI: Not sure what kind of device this is - going to pretend this is an OAK-D.");
293293+ depthai->oak_d_lite = false;
294294+ }
260295}
261296262297static void
···473508static void
474509depthai_setup_stereo_grayscale_pipeline(struct depthai_fs *depthai)
475510{
511511+512512+ // Get the camera calibration
513513+ struct t_stereo_camera_calibration *calib = NULL;
514514+ depthai_get_gray_cameras_calibration(depthai, &calib);
515515+476516 // Hardcoded to OV_9282 L/R
477477- if (true) {
517517+ if (!depthai->oak_d_lite) {
478518 // OV_9282 L/R
479519 depthai->width = 1280;
480520 depthai->height = 800;
···737777 depthai->device = d;
738778739779 // Some debug printing.
740740- depthai_print_connected_cameras(depthai);
780780+ depthai_guess_camera_type(depthai);
741781 depthai_print_calib(depthai);
742782743783 // Make sure that the thread helper is initialised.
+1
src/xrt/drivers/depthai/depthai_interface.h
···39394040/*!
4141 * Create a DepthAI frameserver using two gray cameras.
4242+ * Either OAK-D or OAK-D Lite. Custom FFC setups may or may not work.
4243 *
4344 * @ingroup drv_depthai
4445 */