edu.wpi.first.wpilibj.RobotState的实例源码

项目:snobot-2017    文件Command.java   
/**
 * The run method is used internally to actually run the commands.
 *
 * @return whether or not the command should stay within the {@link Scheduler}.
 */
synchronized boolean run() {
  if (!m_runWhendisabled && m_parent == null && RobotState.isdisabled()) {
    cancel();
  }
  if (isCanceled()) {
    return false;
  }
  if (!m_initialized) {
    m_initialized = true;
    startTiming();
    _initialize();
    initialize();
  }
  _execute();
  execute();
  return !isFinished();
}
项目:turtleshell    文件CrossBaseline.java   
/**
 * Runs the autonomous program.
 *
 * This will drive the robot forward 9.5 feet at 0.8 speed and then 2 feet at 0.3 speed
 */
@Override
public void auto(){
    Timer t = new Timer();
    t.start();
    while (t.get() < 2 && RobotState.isAutonomous() && RobotState.isEnabled()) {
        chassis.tankDrive(new MotorValue(-.28),new MotorValue(-.28));
        System.out.println(t.get() + " " + chassis.getLeftdistance().getInches() + " " +
        chassis.getRightdistance().getInches() + " ");
    }
    while (t.get() < 3.5 && RobotState.isAutonomous() && RobotState.isEnabled()) {
        chassis.tankDrive(new MotorValue(-.15),new MotorValue(-.15));
    }
    while (t.get() < 4.0 && RobotState.isAutonomous() && RobotState.isEnabled()) {
        chassis.tankDrive(new MotorValue(0),new MotorValue(0));
    }
    while (t.get() < 4.30 && RobotState.isAutonomous() && RobotState.isEnabled()) {//icnreased from 4.1 to 4.3
        chassis.tankDrive(new MotorValue(.15),new MotorValue(.15));
    }
    chassis.stop();
}
项目:blanket    文件Action.java   
@Override
public final Object call() throws Exception {
    if (isActive) {
        if (RobotState.isdisabled()) cancel();
        if (isCancelled()) return null;
        startTiming();
        initialize();
        while (!isFinished() && !isTimedOut()) {
            if (isCancelled()) {
                interrupted();
                return isCancelled();
            } else execute();
        }
        end();
    } else {
        throw new InactiveActionException();
    }
    return null;
}
项目:CasseroleLib    文件CsvLogger.java   
private static String getopModeName() {
    if(RobotState.isAutonomous()){
        return "Auto";
    } else {
        return "Teleop";
    }
}
项目:turtleshell    文件BlastoiseDataLogger.java   
private static int getRobotState() {
    if(RobotState.isdisabled()){
        return 0;
    } else if (RobotState.isAutonomous()) {
        return 1;
    } else if (RobotState.isOperatorControl()) {
        return 2;
    } else if (RobotState.istest()) {
        return 3;
    }
    return -1;
}
项目:FlashLib    文件FRCHIDInterface.java   
@Override
public double getHIDAxis(int hid,int axis) {
    if(FlashRobotUtil.inEmergencyStop() || RobotState.isdisabled())
        return 0;
    return ds.getStickAxis(hid,axis);
}
项目:FlashLib    文件FRCHIDInterface.java   
@Override
public boolean getHIDButton(int hid,int button) {
    if(FlashRobotUtil.inEmergencyStop() || RobotState.isdisabled())
        return false;
    return ds.getStickButton(hid,(byte)button);
}
项目:FlashLib    文件FRCHIDInterface.java   
@Override
public int getHIDPOV(int hid,int pov) {
    if(FlashRobotUtil.inEmergencyStop() || RobotState.isdisabled())
        return -1;
    return ds.getStickPOV(hid,pov);
}
项目:turtleshell    文件Robot.java   
public void operatorControl() {
    TurtleDashboard.teleop();
    while (RobotState.isOperatorControl() && RobotState.isEnabled()) {
        teleUpdate();
    }
}
项目:turtleshell    文件TankDrive.java   
public static boolean isAutonomous() {
    return RobotState.isAutonomous();
}

相关文章

买水果
比较全面的redis工具类
gson 反序列化到多态子类
java 版本的 mb_strwidth
JAVA 反转字符串的最快方法,大概比StringBuffer.reverse()性...
com.google.gson.internal.bind.ArrayTypeAdapter的实例源码...