From 0ee4cadca01e7ae2a738762ddffae49224583cb3 Mon Sep 17 00:00:00 2001 From: Peter Johnson Date: Sun, 18 Dec 2016 13:36:44 -0800 Subject: [PATCH] CameraServer: Workaround LabVIEW dashboard OpenCV compatibility. (#406) The current LabVIEW dashboard (Beta 4) requires the source type to be either "usb:" or "ip:" and does not support "cv:". To work around this, use a source type of "usb:" for OpenCV sources as well. Workaround for #407. --- wpilibc/athena/src/CameraServer.cpp | 4 +++- .../src/athena/java/edu/wpi/first/wpilibj/CameraServer.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/wpilibc/athena/src/CameraServer.cpp b/wpilibc/athena/src/CameraServer.cpp index 5ffae00a3f..02539781bf 100644 --- a/wpilibc/athena/src/CameraServer.cpp +++ b/wpilibc/athena/src/CameraServer.cpp @@ -38,7 +38,9 @@ static llvm::StringRef MakeSourceValue(CS_Source source, break; } case cs::VideoSource::kCv: - return "cv:"; + // FIXME: Should be "cv:", but LabVIEW dashboard requires "usb:". + // https://github.com/wpilibsuite/allwpilib/issues/407 + return "usb:"; default: return "unknown:"; } diff --git a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java index 773d08eaab..561c515000 100644 --- a/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java +++ b/wpilibj/src/athena/java/edu/wpi/first/wpilibj/CameraServer.java @@ -69,7 +69,9 @@ public class CameraServer { // TODO return "ip:"; case kCv: - return "cv:"; + // FIXME: Should be "cv:", but LabVIEW dashboard requires "usb:". + // https://github.com/wpilibsuite/allwpilib/issues/407 + return "usb:"; default: return "unknown:"; }