I am sorry for posting another two camera post, but we are close to figuring out what we want to accomplish, however, we hit a snag translating the ideas put forth on other posts here and on wpilib to python.
We have cameras working on our robot currently, but want to be able to use our joystick to switch between the two on the robot before sending the signal out.
We have the example vision.py working.
from cscore import CameraServer def main(): cs1 = CameraServer.getInstance() cs1.enableLogging() cs2 = CameraServer.getInstance() cs2.enableLogging() usb1 = cs1.startAutomaticCapture(dev=0) usb2 = cs2.startAutomaticCapture(dev=1) cs1.waitForever() cs2.waitForever()
This is run from our robot.py file using…
The issue is, we are confused as to how to limit the output stream to one camera, and in which file (robot.py or vision.py)
to implement the chooser.
server = frc::CameraServer::GetInstance()->GetServer();
does not seem to be implemented in robotpy (at least not in the same way).