Java 类edu.wpi.first.wpilibj.command.Scheduler 实例源码

项目:Steamworks2017Robot    文件:Robot.java   
@Override
public void robotPeriodic() {
  try {
    // measure total cycle time, time we take during robotPeriodic, and WPIlib overhead
    final long start = System.nanoTime();
    logger.trace("robotPeriodic()");
    Scheduler.getInstance().run();

    long currentNanos = System.nanoTime();

    if (currentNanos - nanosAtLastUpdate > RobotMap.SMARTDASHBOARD_UPDATE_RATE * 1000000000) {
      allSubsystems.forEach(this::tryToSendDataToSmartDashboard);
      nanosAtLastUpdate = currentNanos;
    }

    SmartDashboard.putNumber("cycleMillis", (currentNanos - prevNanos) / 1000000.0);
    SmartDashboard.putNumber("ourTime", (currentNanos - start) / 1000000.0);
    prevNanos = currentNanos;
  } catch (Throwable ex) {
    logger.error("robotPeriodic error", ex);
    ex.printStackTrace();
  }
}
项目:2017-emmet    文件:Robot.java   
/**
 * This function is called periodically during operator control
 */
// @Override
public void teleopPeriodic() {
    Scheduler.getInstance().run();

    // DEBUG \\
    if (RobotConstants.isTestingEnvironment) readTestingEnvironment();
    updateSensorDisplay();

    System.out.println(Robot.drivetrain.getEncoderPosition());

    // drive control
    drive();
    // climb control
    climb();
}
项目:Spartonics-Code    文件:Robot.java   
public void disabledPeriodic() {
    Scheduler.getInstance().run();

    SmartDashboard.putString("Selected Auto", chooser.getSelected().getName());
    publishToSmartDashboard();
    //SmartDashboard.putString("Selected Autonomous", chooser.getSelected().getName());

}
项目:KrunchieBot    文件:Robot.java   
/**
 * This function is called periodically during autonomous
 */
@Override
public void autonomousPeriodic() {
    Scheduler.getInstance().run();

    /* Create an instance of the DriveForwardCommand and
     * start it during autonomous mode. This will make the
     * robot drive forward during autonomous. */
    DriveForwardCommand d = new DriveForwardCommand();
    d.start();
}
项目:2017SteamBot2    文件:Robot.java   
/**
 * This function is called periodically during autonomous
 */
@Override
public void autonomousPeriodic() {
    /*switch (autoSelected) {
    case customAuto:
        // Put custom auto code here
        break;
    case defaultAuto:
    default:
        // Put default auto code here
        break;
    }*/
    log();
    Scheduler.getInstance().run();
}
项目:2017SteamBot2    文件:Robot.java   
@Override
public void teleopPeriodic() {
    log();
    Scheduler.getInstance().run();

    /*
     * CustomDashboard.putNumber("DriveTrain Left Current 1", pdp.getCurrent(RobotMap.PDP.leftDriveMotor[0]));
     * CustomDashboard.putNumber("DriveTrain Left Current 2", pdp.getCurrent(RobotMap.PDP.leftDriveMotor[1]));
     * CustomDashboard.putNumber("DriveTrain Left Current 3", pdp.getCurrent(RobotMap.PDP.leftDriveMotor[2]));
        *       
     * CustomDashboard.putNumber("DriveTrain Right Voltage 1", pdp.getCurrent(RobotMap.PDP.rightDriveMotor[0]));
     * CustomDashboard.putNumber("DriveTrain Right Voltage 2", pdp.getCurrent(RobotMap.PDP.rightDriveMotor[1]));
     * CustomDashboard.putNumber("DriveTrain Right Voltage 3", pdp.getCurrent(RobotMap.PDP.rightDriveMotor[2]));
     */
}
项目:Robot_2017    文件:Robot.java   
/**
 * This function is called periodically during autonomous
 */
public void autonomousPeriodic() {
    Scheduler.getInstance().run();
    if (! Robot.pixyCamera.read(0, 1, buffer))
        pixyValue =  buffer[0] & 0xFF;

    SmartDashboard.putNumber("Pixy X value", pixyValue  );

}
项目:StormRobotics2017    文件:Robot.java   
@Override
public void disabledPeriodic() {
    Scheduler.getInstance().run();
    sendSensorData();
    Robot.leds.update();
    // Robot.vision.addCrosshairs();
}
项目:StormRobotics2017    文件:Robot.java   
@Override
public void teleopPeriodic() {
    Scheduler.getInstance().run();
    sendSensorData();
    Robot.leds.update();
    // Robot.vision.addCrosshairs();
}
项目:SteamWorks    文件:Robot.java   
/**
 * This function is called periodically during operator control
 */
public void teleopPeriodic() {
    Scheduler.getInstance().run();
    SmartDashboard.putNumber("GyroAngle", RobotMap.gyro.getAngle());
    SmartDashboard.putNumber("JoystickX", Robot.oi.getLogitech().getX());
    SmartDashboard.putNumber("JoystickY", Robot.oi.getLogitech().getY());
    SmartDashboard.putNumber("JoystickTwist", Robot.oi.getLogitech().getTwist());
}
项目:Ballbasaur-Code-Rewrite    文件:Robot.java   
/**
 * Run every tick in teleop.
 */
@Override
public void teleopPeriodic() {
    //Refresh the current time.
    Clock.updateTime();
    //Read sensors
    this.robotMap.getUpdater().run();
    //Run all commands. This is a WPILib thing you don't really have to worry about.
    Scheduler.getInstance().run();
}
项目:2017-emmet    文件:Robot.java   
public void disabledPeriodic() {
    Scheduler.getInstance().run();
    // DEBUG CODE HERE \\
    updateSensorDisplay();

    // *************** \\
}
项目:2017-emmet    文件:Robot.java   
public void autonomousPeriodic() {
    Scheduler.getInstance().run();

    // DEBUG \\
    if (RobotConstants.isTestingEnvironment) readTestingEnvironment();
    updateSensorDisplay();
}
项目:2017-emmet    文件:Robot.java   
/**
 * This function is called periodically during autonomous
 */
// @Override
public void autonomousPeriodic() {
    Scheduler.getInstance().run();

    // DEBUG \\
    if (RobotConstants.isTestingEnvironment) updateTestingEnvironment();
}
项目:robot2017    文件:Robot.java   
/**
 * Run every tick in teleop.
 */
@Override
public void teleopPeriodic() {
    //Refresh the current time.
    Clock.updateTime();

    //Read sensors
    this.robotMap.getUpdater().run();

    //Run all commands. This is a WPILib thing you don't really have to worry about.
    Scheduler.getInstance().run();
}
项目:robot2017    文件:Robot.java   
/**
 * Runs every tick in autonomous.
 */
@Override
public void autonomousPeriodic() {
    //Update the current time
    Clock.updateTime();
    //Read sensors
    this.robotMap.getUpdater().run();
    //Run all commands. This is a WPILib thing you don't really have to worry about.
    Scheduler.getInstance().run();
}
项目:RobotCode2018    文件:Robot.java   
/**
 * This autonomous (along with the chooser code above) shows how to select
 * between different autonomous modes using the dashboard. The sendable
 * chooser code works with the Java SmartDashboard. If you prefer the
 * LabVIEW Dashboard, remove all of the chooser code and uncomment the
 * getString code to get the auto name from the text box below the Gyro
 * <p>
 * You can add additional auto modes by adding additional commands to the
 * chooser code above (like the commented example) or additional comparisons
 * to the switch structure below with additional strings and commands.
 */
public void autonomousInit()
{
    DRIVE_TRAIN.setAutonSettings();
    ArrayList<Vector2f> waypoints = new ArrayList<>();

    waypoints.add(new Vector2f(0,0));
    waypoints.add(new Vector2f(5,5));
    waypoints.add(new Vector2f(6,21));
    Scheduler.getInstance().add(new PurePursuitCommand(waypoints, LOOKAHEAD_DISTANCE));
    // Scheduler.getInstance().add(AutoSwitcher.getAutoInstance());
    NAVX.reset();
}
项目:VikingRobot    文件:Robot.java   
@Override
public void autonomousInit() {
    Scheduler.getInstance().removeAll();
    new ShiftDown().start();
    // Attempt to prevent half the talons from cutting out
    new WaitCommand(0.1).start();
    new ConstantDrive(0, 0.1);

    autoSelector.getSelected().start();
}
项目:R2017    文件:Robot.java   
@Override
public void autonomousPeriodic() {
    // RUN COMMANDS IF ANY
    Scheduler.getInstance().run();

    updateSmartDashboard();
}
项目:Spartonics-Code    文件:Robot.java   
@Override
public void disabledPeriodic() {
    Scheduler.getInstance().run();
}
项目:Spartonics-Code    文件:Robot.java   
/**
 * This function is called periodically during autonomous
 */
@Override
public void autonomousPeriodic() {
    Scheduler.getInstance().run();
}
项目:Spartonics-Code    文件:Robot.java   
/**
 * This function is called periodically during operator control
 */
@Override
public void teleopPeriodic() {
    Scheduler.getInstance().run();
    publishToSmartDashboard();
}
项目:Spartonics-Code    文件:Robot.java   
/**
 * This function is called periodically during autonomous
 */
public void autonomousPeriodic() {
    publishToSmartDashboard();
    Scheduler.getInstance().run();
}
项目:Spartonics-Code    文件:Robot.java   
/**
 * This function is called periodically during operator control
 */
public void teleopPeriodic() {
    Scheduler.getInstance().run();
    publishToSmartDashboard();
}
项目:Spartonics-Code    文件:Robot.java   
@Override
public void disabledPeriodic() {
    Scheduler.getInstance().run();
}
项目:DriveStraightBot    文件:Robot.java   
/**
 * This function is called periodically during autonomous
 */
@Override
public void autonomousPeriodic() {
    Scheduler.getInstance().run();
}
项目:Spartonics-Code    文件:Robot.java   
/**
 * This function is called periodically during operator control
 */
@Override
public void teleopPeriodic() {
    Scheduler.getInstance().run();
}
项目:FRC6414program    文件:Robot.java   
@Override
public void disabledPeriodic() {
    Scheduler.getInstance().run();
}
项目:FRC6414program    文件:Robot.java   
/**
 * This function is called periodically during autonomous
 */
@Override
public void autonomousPeriodic() {
    Scheduler.getInstance().run();
}
项目:FRC6414program    文件:Robot.java   
/**
 * This function is called periodically during operator control
 */
@Override
public void teleopPeriodic() {
    Scheduler.getInstance().run();
}
项目:KrunchieBot    文件:Robot.java   
@Override
public void disabledPeriodic() {
    Scheduler.getInstance().run();
}
项目:KrunchieBot    文件:Robot.java   
/**
 * This function is called periodically during operator control
 */
@Override
public void teleopPeriodic() {
    Scheduler.getInstance().run();
}
项目:frc-2017    文件:Robot.java   
@Override
public void disabledPeriodic() {
    Scheduler.getInstance().run();
}
项目:frc-2017    文件:Robot.java   
/**
 * This function is called periodically during autonomous
 */
@Override
public void autonomousPeriodic() {
    Scheduler.getInstance().run();
}
项目:frc-2017    文件:Robot.java   
/**
 * This function is called periodically during operator control
 */
@Override
public void teleopPeriodic() {
    Scheduler.getInstance().run();
}
项目:FRC-2017-Command    文件:Robot.java   
@Override
public void autonomousPeriodic() {
    Scheduler.getInstance().run();
}
项目:FRC-2017-Command    文件:Robot.java   
@Override
public void teleopPeriodic() {
    Scheduler.getInstance().run();
}
项目:FRC-5800-Stronghold    文件:Robot.java   
/**
 * This function is called periodically during autonomous.
 */
public void autonomousPeriodic() {
    Scheduler.getInstance().run();
    isAuto = isAutonomous();
}
项目:DriveStraightBot    文件:Robot.java   
@Override
public void disabledPeriodic() {
    Scheduler.getInstance().run();
}
项目:Robot_2017    文件:Robot.java   
/**
 * This function is called periodically during operator control
 */
public void teleopPeriodic() {
    Scheduler.getInstance().run();
    if (! Robot.pixyCamera.read(0, 1, buffer))
        pixyValue =  buffer[0] & 0xFF;

    lTrigger = oi.getXBoxController().getRawAxis(2);
    rTrigger = oi.getXBoxController().getRawAxis(3);
    pov = oi.getXBoxController().getPOV(0);

    /* Climbing control - variable on Left Trigger */
    if(lTrigger > 0.1)
        new Climb().start();

    /* Shooting Balls - Right Trigger */
    if(rTrigger > 0.1) {
        if(shootMethod1) {
            Shooter.trigger();

        } else {
            //new Shoot();
        }
    } else {
        new ShooterSequenceOff().start();
    }

    if (isIngesting) {
        BallIntake.ballIntakeMotor.set(0.3);
    } else {
        BallIntake.ballIntakeMotor.set(0);
    }

    /* Allow adjusting Speed of Shooter Motor to test distance */
    //if(pov == -1) {
    //  povActivated = false;
    //} else {
        if (pov != -1)
            if(pov > 90 && pov < 270) {
                shootSpeeed--;
            } else {
                shootSpeeed++;
            }

    //}
    SmartDashboard.putNumber("Shooting speeed", shootSpeeed);

}