當前位置: 首頁>>代碼示例>>Java>>正文


Java CameraServer.startAutomaticCapture方法代碼示例

本文整理匯總了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);
    }
}
 
開發者ID:Team2667,項目名稱:SteamWorks,代碼行數:43,代碼來源:Robot.java

示例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());    
}
 
開發者ID:Team2667,項目名稱:SteamWorks,代碼行數:36,代碼來源:Robot.java

示例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);
}
 
開發者ID:Team4761,項目名稱:2016-Robot-Code,代碼行數:17,代碼來源:Robot.java


注:本文中的edu.wpi.first.wpilibj.CameraServer.startAutomaticCapture方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。