本文整理匯總了Java中edu.wpi.first.wpilibj.command.Scheduler類的典型用法代碼示例。如果您正苦於以下問題:Java Scheduler類的具體用法?Java Scheduler怎麽用?Java Scheduler使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Scheduler類屬於edu.wpi.first.wpilibj.command包,在下文中一共展示了Scheduler類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: robotPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
@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();
}
}
示例2: teleopPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
/**
* 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();
}
示例3: disabledPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
public void disabledPeriodic() {
Scheduler.getInstance().run();
SmartDashboard.putString("Selected Auto", chooser.getSelected().getName());
publishToSmartDashboard();
//SmartDashboard.putString("Selected Autonomous", chooser.getSelected().getName());
}
示例4: autonomousPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
/**
* 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();
}
示例5: autonomousPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
/**
* 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();
}
示例6: teleopPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
@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]));
*/
}
示例7: autonomousPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
/**
* 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 );
}
示例8: disabledPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
@Override
public void disabledPeriodic() {
Scheduler.getInstance().run();
sendSensorData();
Robot.leds.update();
// Robot.vision.addCrosshairs();
}
示例9: teleopPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
@Override
public void teleopPeriodic() {
Scheduler.getInstance().run();
sendSensorData();
Robot.leds.update();
// Robot.vision.addCrosshairs();
}
示例10: teleopPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
/**
* 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());
}
示例11: teleopPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
/**
* 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();
}
示例12: disabledPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
public void disabledPeriodic() {
Scheduler.getInstance().run();
// DEBUG CODE HERE \\
updateSensorDisplay();
// *************** \\
}
示例13: autonomousPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
public void autonomousPeriodic() {
Scheduler.getInstance().run();
// DEBUG \\
if (RobotConstants.isTestingEnvironment) readTestingEnvironment();
updateSensorDisplay();
}
示例14: autonomousPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
/**
* This function is called periodically during autonomous
*/
// @Override
public void autonomousPeriodic() {
Scheduler.getInstance().run();
// DEBUG \\
if (RobotConstants.isTestingEnvironment) updateTestingEnvironment();
}
示例15: teleopPeriodic
import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
/**
* 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();
}