当前位置: 首页>>代码示例>>Java>>正文


Java NIVision.IMAQdxOpenCamera方法代码示例

本文整理汇总了Java中com.ni.vision.NIVision.IMAQdxOpenCamera方法的典型用法代码示例。如果您正苦于以下问题:Java NIVision.IMAQdxOpenCamera方法的具体用法?Java NIVision.IMAQdxOpenCamera怎么用?Java NIVision.IMAQdxOpenCamera使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.ni.vision.NIVision的用法示例。


在下文中一共展示了NIVision.IMAQdxOpenCamera方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: openCamera

import com.ni.vision.NIVision; //导入方法依赖的package包/类
public synchronized void openCamera() {
  if (m_id != -1)
    return; // Camera is already open
  for (int i = 0; i < 3; i++) {
    try {
      m_id =
          NIVision.IMAQdxOpenCamera(m_name,
              NIVision.IMAQdxCameraControlMode.CameraControlModeController);
    } catch (VisionException e) {
      if (i == 2)
        throw e;
      delay(2.0);
      continue;
    }
    break;
  }
}
 
开发者ID:trc492,项目名称:Frc2016FirstStronghold,代码行数:18,代码来源:USBCamera.java

示例2: toggle

import com.ni.vision.NIVision; //导入方法依赖的package包/类
public void toggle(){
	if(currentSession == sessionBack){
		NIVision.IMAQdxStopAcquisition(sessionBack);
		NIVision.IMAQdxCloseCamera(sessionBack);
		sessionFront = NIVision.IMAQdxOpenCamera(RobotMap.FRONT_CAMERA, IMAQdxCameraControlMode.CameraControlModeController);
		NIVision.IMAQdxConfigureGrab(sessionFront);
		NIVision.IMAQdxStartAcquisition(sessionFront);
		currentSession = sessionFront;	
	}else if(currentSession == sessionFront){
		NIVision.IMAQdxStopAcquisition(sessionFront);
		NIVision.IMAQdxCloseCamera(sessionFront);
		sessionBack = NIVision.IMAQdxOpenCamera(RobotMap.BACK_CAMERA, IMAQdxCameraControlMode.CameraControlModeController);
		NIVision.IMAQdxConfigureGrab(sessionBack);
		NIVision.IMAQdxStartAcquisition(sessionBack);
		currentSession = sessionBack;
	}	
}
 
开发者ID:FRC4131,项目名称:FRCStronghold2016,代码行数:18,代码来源:Cameras.java

示例3: robotInit

import com.ni.vision.NIVision; //导入方法依赖的package包/类
public void robotInit() {

        frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);

        // the camera name (ex "cam0") can be found through the roborio web interface
        session = NIVision.IMAQdxOpenCamera("cam0",
                NIVision.IMAQdxCameraControlMode.CameraControlModeController);
        NIVision.IMAQdxConfigureGrab(session);
    }
 
开发者ID:wjaneal,项目名称:liastem,代码行数:10,代码来源:Robot.java

示例4: Cameras

import com.ni.vision.NIVision; //导入方法依赖的package包/类
public Cameras() {
	server = CameraServer.getInstance();
	frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);
	sessionFront = NIVision.IMAQdxOpenCamera(RobotMap.FRONT_CAMERA,
			NIVision.IMAQdxCameraControlMode.CameraControlModeController);
	NIVision.IMAQdxConfigureGrab(sessionFront);
	currentSession = sessionFront;
	sessionSet = true;
	
}
 
开发者ID:FRC4131,项目名称:FRCStronghold2016,代码行数:11,代码来源:Cameras.java

示例5: robotInit

import com.ni.vision.NIVision; //导入方法依赖的package包/类
/**
	 * This function is run when the robot is first started up and should be
	 * used for any initialization code.
	 */
	public void robotInit() {
		oi = new OI();
		driveTrainEncoder.initEncoders();
		// autonomous chooser
		chooser = new SendableChooser();
		chooser.addDefault("Position One", "Position One");
		chooser.addObject("Position Two", "Position Two");
		chooser.addObject("Position Three", "Position Three");
		chooser.addObject("Position Four", "Position Four");
		chooser.addObject("Position Five", "Position Five");
		chooser.addObject("Do Nothing", "Do Nothing");
		SmartDashboard.putData("Auto mode", chooser);
		SmartDashboard.putData("LoadPrefNames", new LoadPrefNames());
		// camera chooser
		cameraSelector = new SendableChooser();
		cameraSelector.addDefault("Front View", "Front View");
		cameraSelector.addObject("Back View", "Back View");
		cameraSelector.addObject("Manual Change", "Manual Change");
		SmartDashboard.putData("Camera Selector", cameraSelector);
		
		
		
		try {
			frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);
//			sessionfront = NIVision.IMAQdxOpenCamera("cam3",
//					NIVision.IMAQdxCameraControlMode.CameraControlModeController);
			sessionfront = NIVision.IMAQdxOpenCamera("cam0",
					NIVision.IMAQdxCameraControlMode.CameraControlModeController);
			sessionback = NIVision.IMAQdxOpenCamera("cam2",
					NIVision.IMAQdxCameraControlMode.CameraControlModeController);
			currSession = sessionback;
			NIVision.IMAQdxConfigureGrab(currSession);
		} catch (VisionException v) {
			//do nothing
		} catch (Exception e) {
			
		}
		// drivetrain chooser
		drivetrainSelector = new SendableChooser();
		drivetrainSelector.addDefault("Tank Drive", "Tank Drive");
		drivetrainSelector.addObject("Arcade Drive", "Arcade Drive");
		SmartDashboard.putData("Drivetrain Selector", drivetrainSelector);
		// preferences
		prefs = Preferences.getInstance();
		distanceTarget = prefs.getDouble("DistanceTarget", distanceTarget);
		distanceOffset = prefs.getDouble("DistanceOffset", distanceOffset);
		angleMultiplier = prefs.getDouble("AngleMultipler", angleMultiplier);
		angleAddition = prefs.getDouble("AngleAddition", angleAddition);
		distanceMultiplier = prefs.getDouble("DistanceMultipler",
				distanceMultiplier);
		distanceAddition = prefs
				.getDouble("DistanceAddition", distanceAddition);
		leftInches = prefs.getDouble("lWheelInches", leftInches);
		rightInches = prefs.getDouble("fRightInches", rightInches);
		leftTicks = prefs.getDouble("lWheelTicks", leftTicks);
		rightTicks = prefs.getDouble("rWheelTicks", rightTicks);
		// add sensors
		LiveWindow.addSensor("Sensors", "Gyro", gyro);
	}
 
开发者ID:frc3946,项目名称:Stronghold,代码行数:64,代码来源:Robot.java

示例6: DriveCam

import com.ni.vision.NIVision; //导入方法依赖的package包/类
public DriveCam() {
	
	frame = NIVision.imaqCreateImage(NIVision.ImageType.IMAGE_RGB, 0);

    // the camera name (ex "cam0") can be found through the roborio web interface
    session = NIVision.IMAQdxOpenCamera("cam0",
            NIVision.IMAQdxCameraControlMode.CameraControlModeController);
    NIVision.IMAQdxConfigureGrab(session);
    
}
 
开发者ID:FRC-Team-3140,项目名称:FRC-2016,代码行数:11,代码来源:DriveCam.java


注:本文中的com.ni.vision.NIVision.IMAQdxOpenCamera方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。