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


Java SmartDashboard.getNumber方法代码示例

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


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

示例1: update

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public void update ()
{
    double P = SmartDashboard.getNumber("DB/Slider 0", 0.0);
    double I = SmartDashboard.getNumber("DB/Slider 1", 0.0);
    double D = SmartDashboard.getNumber("DB/Slider 2", 0.0);
    double setPoint = SmartDashboard.getNumber("DB/Slider 3", 0.0);
    this.tuner.setP(P);
    this.tuner.setI(I);
    this.tuner.setD(D);
    this.tuner.setSetpoint(setPoint);
}
 
开发者ID:FIRST-Team-339,项目名称:2017,代码行数:12,代码来源:SmartDashboardPIDTunerDevice.java

示例2: autonomousInit

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public void autonomousInit() {
	//This sets the command used to begin the autonomous sequence
	int av = (int) SmartDashboard.getNumber("Autonomous Version", 1);//REVERT Auto
	SmartDashboard.putNumber("Autonomous Version", av);

	//This starts the autonomous sequence.
	Autonomous.autonomous[av].start();
}
 
开发者ID:FRC5800,项目名称:FRC-5800-Stronghold,代码行数:9,代码来源:Robot.java

示例3: initialize

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
protected void initialize() {
	Robot.driveTrain.enableGyroPID();
	// Angle from SmartDash, default is the robots current angle
	double targetAngle = SmartDashboard.getNumber("targetAngle", Robot.driveTrain.getCurrentBoundedAngle());
	System.out.println(targetAngle);
	Robot.driveTrain.setTargetAngle(targetAngle);
}
 
开发者ID:1757WestwoodRobotics,项目名称:2017-Steamworks,代码行数:8,代码来源:RotateToAngle.java

示例4: getAutoDelay

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
 * Returns auto delay, in seconds, from SmartDashboard
 */
public static double getAutoDelay() {
	return SmartDashboard.getNumber("Auto delay", 0);
}
 
开发者ID:Team4914,项目名称:2017-emmet,代码行数:7,代码来源:Robot.java

示例5: readTestingEnvironment

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
   * grabs values from testing environment
   */
  public void readTestingEnvironment() {
  	/*RobotConstants.isInverted = SmartDashboard.getBoolean("isInverted", false);
RobotConstants.isTrigger = SmartDashboard.getBoolean("isTrigger", false);*/

RobotConstants.AUTO_SPEED = SmartDashboard.getNumber("AUTO_SPEED", 0);
RobotConstants.AUTO_SPEED = SmartDashboard.getNumber("INCHES_TO_ENCODER", 0);

RobotConstants.AUTO_DRIVE_TOLERANCE = SmartDashboard.getNumber("AUTO_DRIVE_TOLERANCE", 0);
RobotConstants.AUTO_DRIVE_RHOOK_D1 = SmartDashboard.getNumber("AUTO_DRIVE_RHOOK_D1", 0);
RobotConstants.AUTO_DRIVE_RHOOK_D2 = SmartDashboard.getNumber("AUTO_DRIVE_RHOOK_D2", 0);
RobotConstants.AUTO_DRIVE_LHOOK_D1 = SmartDashboard.getNumber("AUTO_DRIVE_LHOOK_D1", 0);
RobotConstants.AUTO_DRIVE_LHOOK_D2 = SmartDashboard.getNumber("AUTO_DRIVE_LHOOK_D2", 0);
RobotConstants.AUTO_DRIVE_MHOOK_D1 = SmartDashboard.getNumber("AUTO_DRIVE_MHOOK_D1", 0);
RobotConstants.AUTO_DRIVE_P = SmartDashboard.getNumber("AUTO_DRIVE_P", 0);
RobotConstants.AUTO_DRIVE_I = SmartDashboard.getNumber("AUTO_DRIVE_I", 0);
RobotConstants.AUTO_DRIVE_D = SmartDashboard.getNumber("AUTO_DRIVE_D", 0);

RobotConstants.AUTO_TURN_TOLERANCE = (int) SmartDashboard.getNumber("AUTO_TURN_TOLERANCE", 0);
RobotConstants.AUTO_TURN_RHOOK_SETPOINT = (int) SmartDashboard.getNumber("AUTO_TURN_RHOOK_SETPOINT", 0);
RobotConstants.AUTO_TURN_LHOOK_SETPOINT = (int) SmartDashboard.getNumber("AUTO_TURN_LHOOK_SETPOINT", 0);
RobotConstants.AUTO_TURN_P = SmartDashboard.getNumber("AUTO_TURN_P", 0);
RobotConstants.AUTO_TURN_I = SmartDashboard.getNumber("AUTO_TURN_I", 0);
RobotConstants.AUTO_TURN_D = SmartDashboard.getNumber("AUTO_TURN_D", 0);

/*RobotConstants.FLYWHEEL_SPEED = SmartDashboard.getNumber("FLYWHEEL_SPEED", 0);

RobotConstants.VISION_TOLERANCE = (int) SmartDashboard.getNumber("VISION_TOLERANCE", 0);
RobotConstants.VISION_X_SETPOINT = (int) SmartDashboard.getNumber("VISION_X_SETPOINT", 0);
RobotConstants.VISION_Y_SETPOINT = (int) SmartDashboard.getNumber("VISION_Y_SETPOINT", 0);
RobotConstants.VISION_P = SmartDashboard.getNumber("VISION_P", 0);
RobotConstants.VISION_I = SmartDashboard.getNumber("VISION_I", 0);
RobotConstants.VISION_D = SmartDashboard.getNumber("VISION_D", 0);

RobotConstants.GEAR_TOLERANCE = SmartDashboard.getNumber("GEAR_TOLERANCE", 0);
RobotConstants.GEAR_INIT_SETPOINT = SmartDashboard.getNumber("GEAR_INIT_SETPOINT", 0);
RobotConstants.GEAR_FINAL_SETPOINT = SmartDashboard.getNumber("GEAR_FINAL_SETPOINT", 0);
RobotConstants.GEAR_P = SmartDashboard.getNumber("GEAR_P", 0);
RobotConstants.GEAR_I = SmartDashboard.getNumber("GEAR_I", 0);
RobotConstants.GEAR_D = SmartDashboard.getNumber("GEAR_D", 0);*/
  }
 
开发者ID:Team4914,项目名称:2017-emmet,代码行数:44,代码来源:Robot.java

示例6: readTestingEnvironment

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
/**
   * grabs values from testing environment
   */
  public void readTestingEnvironment() {
  	RobotConstants.isInverted = SmartDashboard.getBoolean("isInverted", false);
RobotConstants.isTrigger = SmartDashboard.getBoolean("isTrigger", false);

RobotConstants.AUTO_SPEED = SmartDashboard.getNumber("AUTO_SPEED", 0);
RobotConstants.AUTO_SPEED = SmartDashboard.getNumber("INCHES_TO_ENCODER", 0);

RobotConstants.AUTO_DRIVE_TOLERANCE = SmartDashboard.getNumber("AUTO_DRIVE_TOLERANCE", 0);
RobotConstants.AUTO_DRIVE_RHOOK_D1 = SmartDashboard.getNumber("AUTO_DRIVE_RHOOK_D1", 0);
RobotConstants.AUTO_DRIVE_RHOOK_D2 = SmartDashboard.getNumber("AUTO_DRIVE_RHOOK_D2", 0);
RobotConstants.AUTO_DRIVE_LHOOK_D1 = SmartDashboard.getNumber("AUTO_DRIVE_LHOOK_D1", 0);
RobotConstants.AUTO_DRIVE_LHOOK_D2 = SmartDashboard.getNumber("AUTO_DRIVE_LHOOK_D2", 0);
RobotConstants.AUTO_DRIVE_MHOOK_D1 = SmartDashboard.getNumber("AUTO_DRIVE_MHOOK_D1", 0);
RobotConstants.AUTO_DRIVE_P = SmartDashboard.getNumber("AUTO_DRIVE_P", 0);
RobotConstants.AUTO_DRIVE_I = SmartDashboard.getNumber("AUTO_DRIVE_I", 0);
RobotConstants.AUTO_DRIVE_D = SmartDashboard.getNumber("AUTO_DRIVE_D", 0);

RobotConstants.AUTO_TURN_TOLERANCE = (int) SmartDashboard.getNumber("AUTO_TURN_TOLERANCE", 0);
RobotConstants.AUTO_TURN_RHOOK_SETPOINT = (int) SmartDashboard.getNumber("AUTO_TURN_RHOOK_SETPOINT", 0);
RobotConstants.AUTO_TURN_LHOOK_SETPOINT = (int) SmartDashboard.getNumber("AUTO_TURN_LHOOK_SETPOINT", 0);
RobotConstants.AUTO_TURN_P = SmartDashboard.getNumber("AUTO_TURN_P", 0);
RobotConstants.AUTO_TURN_I = SmartDashboard.getNumber("AUTO_TURN_I", 0);
RobotConstants.AUTO_TURN_D = SmartDashboard.getNumber("AUTO_TURN_D", 0);

RobotConstants.FLYWHEEL_SPEED = SmartDashboard.getNumber("FLYWHEEL_SPEED", 0);

RobotConstants.VISION_TOLERANCE = (int) SmartDashboard.getNumber("VISION_TOLERANCE", 0);
RobotConstants.VISION_X_SETPOINT = (int) SmartDashboard.getNumber("VISION_X_SETPOINT", 0);
RobotConstants.VISION_Y_SETPOINT = (int) SmartDashboard.getNumber("VISION_Y_SETPOINT", 0);
RobotConstants.VISION_P = SmartDashboard.getNumber("VISION_P", 0);
RobotConstants.VISION_I = SmartDashboard.getNumber("VISION_I", 0);
RobotConstants.VISION_D = SmartDashboard.getNumber("VISION_D", 0);

RobotConstants.GEAR_TOLERANCE = SmartDashboard.getNumber("GEAR_TOLERANCE", 0);
RobotConstants.GEAR_INIT_SETPOINT = SmartDashboard.getNumber("GEAR_INIT_SETPOINT", 0);
RobotConstants.GEAR_FINAL_SETPOINT = SmartDashboard.getNumber("GEAR_FINAL_SETPOINT", 0);
RobotConstants.GEAR_P = SmartDashboard.getNumber("GEAR_P", 0);
RobotConstants.GEAR_I = SmartDashboard.getNumber("GEAR_I", 0);
RobotConstants.GEAR_D = SmartDashboard.getNumber("GEAR_D", 0);
  }
 
开发者ID:Team4914,项目名称:2017-emmet,代码行数:44,代码来源:Robot.java

示例7: subsystemsListener

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
private void subsystemsListener() {
        shooterSpeed = SmartDashboard.getNumber("Shooter Speed", 0);
        indexerSpeed = SmartDashboard.getNumber("Indexer Speed", 0);
        intakeSpeed = SmartDashboard.getNumber("Intake Speed", 0);
        indexerRollerSpeed = SmartDashboard.getNumber("IntakeRoller Speed", 0);

        // CLIMBER LISTENER
        if (controls.getClimbUp() && !controls.getClimbDown()) {
            System.out.println("CLIMBING UP");
            climberIntake.climbUp();
        } else if (controls.getClimbDown() && !controls.getClimbUp()) {
            System.out.println("CLIMBING DOWN");
            climberIntake.climbDown();
        } else {
            climberIntake.stop();
        }

        // INTAKE LISTENER
        if (controls.getIntakeIn() && !controls.getIntakeOut()) {
            System.out.println("INTAKE");
            climberIntake.intakeIn();
        } else if (controls.getIntakeOut() && !controls.getIntakeIn()) {
            climberIntake.intakeOut();
        }

        // INDEXER LISTENER
        if (controls.getIndexerIn()) {
            System.out.println("INDEXING");
//            indexer.pushIntoShooter(indexerSpeed, indexerRollerSpeed);
            indexer.pushIntoShooter(Constants.INDEXER_BELT_SPEED, Constants.INDEXER_ROLLER_SPEED);
        } else {
            indexer.stop();
        }

        // SHOOTER LISTENER
        if (controls.getShoot()) {
            System.out.println("SHOOTING");
//            shooter.setShooterSpeed(shooterSpeed);
            shooter.setShooterSpeed(Constants.SHOOTER_SPEED + controls.getShooterSpeedAdjustment());
        } else {
            shooter.setShooterSpeed(0);
        }
//
//        // GEAR LISTENER TOGGLE
////        if (controls.getMoveGear()) {
////            System.out.println("GEAR");
////            if (gear.isGearOut()) {
////                gear.resetServos();
////            } else {
////                gear.pushOutGear();
////            }
////        }

        // GEAR LISTENER HOLD
        if (controls.getOutGear()) {
            System.out.println("GEAR");
            gear.pushOutGear();
        } else {
            gear.resetServos();
        }
    }
 
开发者ID:Team334,项目名称:R2017,代码行数:62,代码来源:Robot.java

示例8: getNumber

import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; //导入方法依赖的package包/类
public static double getNumber(String name, double defaultValue) {
	return SmartDashboard.getNumber(name, defaultValue);
}
 
开发者ID:Team997Coders,项目名称:2017SteamBot2,代码行数:4,代码来源:CustomDashboard.java


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