Changes between Version 4 and Version 5 of ControlSystems/SoftwareTeam/Training/GettingStarted/CameraSwitching


Ignore:
Timestamp:
Feb 14, 2020, 9:57:48 AM (5 years ago)
Author:
David Albert
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • ControlSystems/SoftwareTeam/Training/GettingStarted/CameraSwitching

    v4 v5  
    1 Often it's desirable to have more than one camera on a robot, for example to provide front and back views.  As always, camera code should run in its own thread to prevent camera errors from taking down the main robot thread.  The example below shows how to create a new thread class called Cameras that creates two cameras and lets you switch between them using an Xbox controller.
     1Often it's desirable to have more than one camera on a robot, for example to provide front and back views.  As always, camera code should run in its own thread to prevent a camera exception (e.g. if a camera fails or gets unplugged) from taking down the main robot thread.  The example below shows how to create a new thread class called Cameras that creates two cameras and lets you switch between them using an Xbox controller.
    22
    33WPILib provides a great helper class called [https://first.wpi.edu/FRC/roborio/release/docs/java/edu/wpi/first/cameraserver/CameraServer.html CameraServer] that does most of the heavy lifting.  You can read about it [https://docs.wpilib.org/en/latest/docs/software/vision-processing/introduction/cameraserver-class.html here] and [https://s3.amazonaws.com/screensteps_live/exported/Wpilib/2078/6264/Read_and_process_video_CameraServer_class.pdf?1483739157 here]