From e8db00120fd2ac95be0cbb127567f21abc4570f4 Mon Sep 17 00:00:00 2001 From: Sam Hos Date: Wed, 11 Dec 2024 14:46:50 +0100 Subject: [PATCH] update video camera logic --- src/C++/Driver/src/main.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/C++/Driver/src/main.cpp b/src/C++/Driver/src/main.cpp index 4dbd83c..bd3984d 100644 --- a/src/C++/Driver/src/main.cpp +++ b/src/C++/Driver/src/main.cpp @@ -283,8 +283,11 @@ void sendKobukiData(TKobukiData &data) { void CapnSend() { - VideoCapture cap(1); // Open the default camera - if (!cap.isOpened()) { + VideoCapture cap(0); // Open the default camera + if (!cap.isOpened()) { + int i = 0; + VideoCapture cap(i++); // Open the default camera + cerr << "Error: Could not open camera" << endl; return; }