當前位置: 首頁>>代碼示例>>Java>>正文


Java Scheduler類代碼示例

本文整理匯總了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();
  }
}
 
開發者ID:ligerbots,項目名稱:Steamworks2017Robot,代碼行數:24,代碼來源:Robot.java

示例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();
}
 
開發者ID:Team4914,項目名稱:2017-emmet,代碼行數:19,代碼來源:Robot.java

示例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());
	
}
 
開發者ID:2141-Spartonics,項目名稱:Spartonics-Code,代碼行數:9,代碼來源:Robot.java

示例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();
}
 
開發者ID:aryker,項目名稱:KrunchieBot,代碼行數:14,代碼來源:Robot.java

示例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();
}
 
開發者ID:Team997Coders,項目名稱:2017SteamBot2,代碼行數:18,代碼來源:Robot.java

示例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]));
   	 */
}
 
開發者ID:Team997Coders,項目名稱:2017SteamBot2,代碼行數:16,代碼來源:Robot.java

示例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  );

}
 
開發者ID:FRC2832,項目名稱:Robot_2017,代碼行數:12,代碼來源:Robot.java

示例8: disabledPeriodic

import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
@Override
public void disabledPeriodic() {
	Scheduler.getInstance().run();
	sendSensorData();
	Robot.leds.update();
	// Robot.vision.addCrosshairs();
}
 
開發者ID:2729StormRobotics,項目名稱:StormRobotics2017,代碼行數:8,代碼來源:Robot.java

示例9: teleopPeriodic

import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
@Override
public void teleopPeriodic() {
	Scheduler.getInstance().run();
	sendSensorData();
	Robot.leds.update();
	// Robot.vision.addCrosshairs();
}
 
開發者ID:2729StormRobotics,項目名稱:StormRobotics2017,代碼行數:8,代碼來源:Robot.java

示例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());
}
 
開發者ID:Team2667,項目名稱:SteamWorks,代碼行數:11,代碼來源:Robot.java

示例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();
}
 
開發者ID:PB020,項目名稱:Ballbasaur-Code-Rewrite,代碼行數:13,代碼來源:Robot.java

示例12: disabledPeriodic

import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
public void disabledPeriodic() {
	Scheduler.getInstance().run();
	// DEBUG CODE HERE \\
	updateSensorDisplay();
	
	// *************** \\
}
 
開發者ID:Team4914,項目名稱:2017-emmet,代碼行數:8,代碼來源:Robot.java

示例13: autonomousPeriodic

import edu.wpi.first.wpilibj.command.Scheduler; //導入依賴的package包/類
public void autonomousPeriodic() {
	Scheduler.getInstance().run();
	
	// DEBUG \\
	if (RobotConstants.isTestingEnvironment) readTestingEnvironment();
	updateSensorDisplay();
}
 
開發者ID:Team4914,項目名稱:2017-emmet,代碼行數:8,代碼來源:Robot.java

示例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();
}
 
開發者ID:Team4914,項目名稱:2017-emmet,代碼行數:11,代碼來源:Robot.java

示例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();
}
 
開發者ID:blair-robot-project,項目名稱:robot2017,代碼行數:15,代碼來源:Robot.java


注:本文中的edu.wpi.first.wpilibj.command.Scheduler類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。