本文整理汇总了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();
}
示例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
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}