本文整理匯總了Java中edu.wpi.first.wpilibj.CameraServer.startAutomaticCapture方法的典型用法代碼示例。如果您正苦於以下問題:Java CameraServer.startAutomaticCapture方法的具體用法?Java CameraServer.startAutomaticCapture怎麽用?Java CameraServer.startAutomaticCapture使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類edu.wpi.first.wpilibj.CameraServer
的用法示例。
在下文中一共展示了CameraServer.startAutomaticCapture方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: robotInit
import edu.wpi.first.wpilibj.CameraServer; //導入方法依賴的package包/類
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
RobotMap.init();
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
driveTrain = new DriveTrain();
shooter = new Shooter();
lift = new Lift();
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
// OI must be constructed after subsystems. If the OI creates Commands
//(which it very likely will), subsystems are not guaranteed to be
// constructed yet. Thus, their requires() statements may grab null
// pointers. Bad news. Don't move it.
oi = new OI();
// instantiate the command used for the autonomous period
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS
autonomousCommand = new AutonomousCommand();
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS
CameraServer cameraServer = CameraServer.getInstance();
System.out.println("Camera sources:" + VideoSource.enumerateSources().length);
for (VideoSource videoSource : VideoSource.enumerateSources()) {
System.out.println("Camera: " + videoSource.getName());
}
UsbCamera camera= cameraServer.startAutomaticCapture();
System.out.println("Started camera capture.");
// Hard coded camera address
cameraServer.addAxisCamera("AxisCam ye", "10.26.67.42");
// visionThread = new VisionThread(camera,new GripPipeline());
driveTrainChooser = new SendableChooser();
driveTrainChooser.addDefault("default PWM", DriveTrain.DriveMode.PWM);
for (DriveTrain.DriveMode driveMode : DriveTrain.DriveMode.values()) {
driveTrainChooser.addObject(driveMode.name(), driveMode);
}
}
示例2: robotInit
import edu.wpi.first.wpilibj.CameraServer; //導入方法依賴的package包/類
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
RobotMap.init();
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
driveTrain = new DriveTrain();
shooter = new Shooter();
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
// OI must be constructed after subsystems. If the OI creates Commands
//(which it very likely will), subsystems are not guaranteed to be
// constructed yet. Thus, their requires() statements may grab null
// pointers. Bad news. Don't move it.
oi = new OI();
// instantiate the command used for the autonomous period
// BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS
autonomousCommand = new AutonomousCommand();
// END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS
CameraServer cameraServer = CameraServer.getInstance();
System.out.println("Camera sources:" + VideoSource.enumerateSources().length);
for (VideoSource videoSource : VideoSource.enumerateSources()) {
System.out.println("Camera: " + videoSource.getName());
}
UsbCamera camera= cameraServer.startAutomaticCapture();
System.out.println("Started camera capture.");
// Hard coded camera address
cameraServer.addAxisCamera("AxisCam ye", "10.26.67.42");
// visionThread = new VisionThread(camera,new GripPipeline());
}
示例3: robotInit
import edu.wpi.first.wpilibj.CameraServer; //導入方法依賴的package包/類
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*/
public void robotInit() {
NetworkTable.globalDeleteAll();
oi = new OI();
teleop = new Teleop();
uHGSD = new UpdateHighGoalShooterDashboard();
autonomousCommand = new Autonomous(2, 2);
CameraServer server = CameraServer.getInstance();
server.startAutomaticCapture("cam0");
hood.resetEncoder(hood.HOOD_START);
}