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


Java Preferences.getInstance方法代码示例

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


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

示例1: robotInit

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
/**
 * Called when the robot first starts, (only once at power-up).
 */
public void robotInit() {
    //NetworkTable.setTeam(1259); adding the setTeam() method will cause the robot to encounter a thread error
    //NetworkTable.setIPAddress("10.12.59.2");
    operatorInputs = new OperatorInputs();
    drive = new DriveTrain(operatorInputs);
    prefs = Preferences.getInstance();
    pickerPID = new PickerPID();
    shoot = new Shooter(operatorInputs);
    pick = new Picker(operatorInputs, pickerPID, shoot);
    compressor = new Compressor(PRESSURE_SWITCH_CHANNEL, COMPRESSOR_RELAY_CHANNEL);
    colwellContraption1 = new Solenoid(1, 3);
    colwellContraption2 = new Solenoid(1, 4);
    colwellContraption2.set(true);

    this.autoTimer = new Timer();
    drive.leftEncoder.start();
    drive.rightEncoder.start();
    drive.timer.start();
    autoTimer.start();
}
 
开发者ID:pewaukeerobotics,项目名称:ParadigmShift-2014,代码行数:24,代码来源:Rafiki_Atlas.java

示例2: robotInit

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的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();
       autoChooser = new SendableChooser();
       autoChooser.addDefault("Simple Autonomous", new SimpleAutonomous());
       //autoChooser.addObject("name", );
       //autoChooser.addObject("name", );
       SmartDashboard.putData("Autonomous Chooser", autoChooser);
       shooterFan = new ShooterFan();
       eightBallGrabber = new EightBallGrabber();
       prefs = Preferences.getInstance();

       // BEGIN AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
   // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=CONSTRUCTORS
       // This MUST be here. If the OI creates Commands (which it very likely
       // will), constructing it during the construction of CommandBase (from
       // which commands extend), subsystems are not guaranteed to be
       // yet. Thus, their requires() statements may grab null pointers. Bad
       // news. Don't move it.
       oi = new OI();
       
   // END AUTOGENERATED CODE, SOURCE=ROBOTBUILDER ID=AUTONOMOUS
       
       // Setup compass to stream data
   }
 
开发者ID:Tmm2471,项目名称:Swerve,代码行数:30,代码来源:Robot.java

示例3: zeroAzimuthEncoders

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
/**
 * Set wheels' azimuth relative offset from zero based on the current absolute position. This uses
 * the physical zero position as read by the absolute encoder and saved during the wheel alignment
 * process.
 *
 * @see #saveAzimuthPositions()
 */
public void zeroAzimuthEncoders() {
  Preferences prefs = Preferences.getInstance();
  for (int i = 0; i < WHEEL_COUNT; i++) {
    int position = prefs.getInt(getPreferenceKeyForWheel(i), 0);
    wheels[i].setAzimuthZero(position);
    logger.info("azimuth {}: loaded zero = {}", i, position);
  }
}
 
开发者ID:strykeforce,项目名称:thirdcoast,代码行数:16,代码来源:SwerveDrive.java

示例4: holdElbowPosition

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static int holdElbowPosition() {
	Preferences prefs = Preferences.getInstance();
	if (!prefs.containsKey("holdElbowPosition")) {
		prefs.putInt("holdElbowPosition", 3589);
	}
	return prefs.getInt("holdElbowPosition", 3589);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例5: holdWristPosition

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static int holdWristPosition() {
	Preferences prefs = Preferences.getInstance();
	if (!prefs.containsKey("holdWristPosition")) {
		prefs.putInt("holdWristPosition", 2027);
	}
	return prefs.getInt("holdWristPosition", 2027);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例6: latchReadyPosition

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double latchReadyPosition() {
	Preferences prefs = Preferences.getInstance();
	if (!prefs.containsKey("latchReadyPostion")) {
		prefs.putDouble("latchReadyPostion", 0.32);
	}
	return prefs.getDouble("latchReadyPostion", 0.32);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例7: latchShootPosition

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double latchShootPosition() {
	Preferences prefs = Preferences.getInstance();
	if (!prefs.containsKey("latchShootPosition")) {
		prefs.putDouble("latchShootPosition", 1.0);
	}
	return prefs.getDouble("latchShootPosition", 1.0);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例8: latchLockPosition

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double latchLockPosition() { //position to lower server after latch to ensure it doesn't launch prematurely
	Preferences prefs = Preferences.getInstance();
	if (!prefs.containsKey("latchLockPosition")) {
		prefs.putDouble("latchLockPosition", 0.01);
	}
	return prefs.getDouble("latchLockPosition", 0.01);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例9: winchPower

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double winchPower() {
	Preferences prefs = Preferences.getInstance();
	if (!prefs.containsKey("winchPower")) {
		prefs.putDouble("winchPower", 1.0);
	}
	return prefs.getDouble("winchPower", 1.0);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例10: winchWoundDistance

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double winchWoundDistance() {
	Preferences prefs = Preferences.getInstance();
	if (!prefs.containsKey("winchWoundDistance")) {
		prefs.putDouble("winchWoundDistance", 1);
	}
	return prefs.getDouble("winchWoundDistance", 1);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例11: winchUnwoundDistance

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double winchUnwoundDistance() {
	Preferences prefs = Preferences.getInstance();
	if (!prefs.containsKey("winchUnwoundDistance")) {
		prefs.putDouble("winchUnwoundDistance", 4.6);
	}
	return prefs.getDouble("winchUnwoundDistance", 4.6);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例12: pickupWheelsPower

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double pickupWheelsPower() {
	Preferences prefs = Preferences.getInstance();
	if (!prefs.containsKey("pickupWheelsPower")) {
		prefs.putDouble("pickupWheelsPower", -12);
	}
	return prefs.getDouble("pickupWheelsPower", -12);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例13: pixelsPerEncoderChange

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static double pixelsPerEncoderChange() {
   	Preferences prefs = Preferences.getInstance();
       if (!prefs.containsKey("pixelsPerEncoderChange")) {
           prefs.putDouble("pixelsPerEncoderChange", 0.735);
       }
       return prefs.getDouble("pixelsPerEncoderChange", 0.735);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例14: manipulatorWristRestPosition

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static int manipulatorWristRestPosition() {
    Preferences prefs = Preferences.getInstance();
    if (!prefs.containsKey("manipulatorWristRestPosition")) {
        prefs.putInt("manipulatorWristRestPosition", 2100);
    }
    return prefs.getInt("manipulatorWristRestPosition", 2100);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java

示例15: manipulatorElbowRestPosition

import edu.wpi.first.wpilibj.Preferences; //导入方法依赖的package包/类
public static int manipulatorElbowRestPosition() {
    Preferences prefs = Preferences.getInstance();
    if (!prefs.containsKey("manipulatorElbowRestPosition")) {
        prefs.putInt("manipulatorElbowRestPosition", 1900);
    }
    return prefs.getInt("manipulatorElbowRestPosition", 1900);
}
 
开发者ID:Woodland4678,项目名称:Cybercavs2016Code,代码行数:8,代码来源:Robot.java


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