Replies: 2 comments
-
This is the equivalent of the code you posted in Kotlin: private lateinit var Camera0: UsbCamera
private lateinit var Camera1: UsbCamera
private lateinit var Server: VideoSink
override fun robotInit() {
Camera0 = CameraServer.startAutomaticCapture(0)
Camera1 = CameraServer.startAutomaticCapture(1)
Server = CameraServer.addSwitchedCamera("Switch")
Server.source = camera0
} I couldn't tell you for certain why you were getting the error you posted without the code you tried, but I can tell you that it is raised if you try to instantiate the |
Beta Was this translation helpful? Give feedback.
0 replies
-
That worked brilliantly, I was just trying to test example code. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all, I'm moving from C++ and had some troubles porting some camera code. I'm trying to use
addSwitchedCamera(String name)
so I can set that as the camera on the DriverStation and just toggle through my USB cameras throughsetSource()
.The examples for the Java versions show the VideoSink being initialised with an implicitly, but when I try to use it in Kotlin, I get
Cannot access '<init>': it is protected in 'VideoSink'
Here is what I'm trying to do with Java:
Thanks in advanced.
Beta Was this translation helpful? Give feedback.
All reactions