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


Java Robot类代码示例

本文整理汇总了Java中org.usfirst.frc.team166.robot.Robot的典型用法代码示例。如果您正苦于以下问题:Java Robot类的具体用法?Java Robot怎么用?Java Robot使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Robot类属于org.usfirst.frc.team166.robot包,在下文中一共展示了Robot类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: UberAuto

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
public UberAuto() {

		// sick 2 ball autonomous that still needs testing

		addSequential(new LowerAManipulators());
		addSequential(new LoadingProcess());
		addSequential(new TurnAngle(-30.0));
		addSequential(new DriveDistance(.9, 29)); // real distance is 37
		addSequential(new TurnAngle(30.0));
		addSequential(new LowerRake());
		addSequential(new DriveDistance(.9, 126)); // real distance is 162
		addSequential(new RaiseRake());
		addSequential(new TurnAngle(45.0));
		addSequential(new MediumRangeShot());
		addSequential(new TurnAngle(-45.0 - Robot.drive.turnToGoalAngle));
		addSequential(new LowerRake());
		addSequential(new DriveDistance(-.9, -141)); // real distance is 141
		addSequential(new AutoLoadingProcess());
		addSequential(new DriveDistance(.9, 141));
		addSequential(new RaiseRake());
		addSequential(new TurnAngle(45.0));
		addSequential(new MediumRangeShot());

	}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:25,代码来源:UberAuto.java

示例2: ManipulateBall

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
public ManipulateBall() {
	// Add Commands here:
	// e.g. addSequential(new Command1());
	// addSequential(new Command2());
	// these will run in order.

	// To run multiple commands at the same time,
	// use addParallel()
	// e.g. addParallel(new Command1());
	// addSequential(new Command2());
	// Command1 and Command2 will run in parallel.

	if (Robot.intakeRoller.isBallLoaded()) {
		addSequential(new EjectBall());
	} else {
		addSequential(new LoadingProcess());
	}
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:19,代码来源:ManipulateBall.java

示例3: execute

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void execute() {
	xOffset = Robot.vision.getXOffset(); // Obtain offset from dataTables

	if (Math.abs(xOffset) > .8) { // If more than 30% away, drive fast
		// spinSpeed = .18;
	} else {
		// spinSpeed = .16;
	}

	if (xOffset > shotZone) { // If the target is to the right, spin right
		if (!Robot.drive.isRobotSpinning()) {
			Robot.drive.spinRight(fastSpinSpeed); // If we are stuck, give it a little more power
		} else {
			Robot.drive.spinRight(spinSpeed);
		}
	} else if (xOffset < -shotZone) { // If the target is to the left, spin left
		if (!Robot.drive.isRobotSpinning()) {
			Robot.drive.spinLeft(fastSpinSpeed);
		} else {
			Robot.drive.spinLeft(spinSpeed);
		}
	} else {
		Robot.drive.brake(); // See Robot.drive.brake();
	}
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:27,代码来源:TurnToGoalWithGyroSlow.java

示例4: execute

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void execute() {
	if (angle < 0) {
		Robot.drive.turnRight(.5);
	} else {
		Robot.drive.turnLeft(.5);
	}
}
 
开发者ID:chopshop-166,项目名称:frc-2017,代码行数:9,代码来源:TurnAngle.java

示例5: initialize

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void initialize() {
	Robot.drive.resetGyro();
	timer = new Timer();
	timer.reset();
	timer.start();
}
 
开发者ID:chopshop-166,项目名称:frc-2017,代码行数:8,代码来源:DriveTime.java

示例6: Disable

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
public Disable() {
	requires(Robot.intake);
	requires(Robot.gearManipulator);
	requires(Robot.storage);
	requires(Robot.elevator);
	requires(Robot.drive);
	requires(Robot.climber);
	requires(Robot.elevator);
	requires(Robot.shooter);
}
 
开发者ID:chopshop-166,项目名称:frc-2017,代码行数:11,代码来源:Disable.java

示例7: execute

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void execute() {
	// if (Math.abs(Robot.vision.getXOffset()) > .035) {
	// Robot.drive.turnToGoalParallel(Robot.vision.getXOffset());
	// } else {
	// Robot.drive.stop();
	// }
	Robot.drive.turnToGoalParallel(Robot.vision.getXOffset());
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:10,代码来源:TurnToGoalSlow.java

示例8: initialize

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void initialize() {
	Robot.aimShooter.stop();
	Robot.intakeRoller.stopRoller();
	Robot.shooter.setSpeedOpenLoop(0.0);
	Robot.intake.intakeMotorStop();
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:8,代码来源:CancelShot.java

示例9: execute

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void execute() {
	Robot.drive.driveWithJoysticks(Robot.oi.getLeftYAxis(), Robot.oi.getRightYAxis());

	SmartDashboard.putNumber("POT Angle", Robot.aimShooter.getShooterAngle());
	SmartDashboard.putNumber("Pot Voltage", Robot.aimShooter.getPotVoltage());
	SmartDashboard.putNumber("X Offset", Robot.vision.getXOffset());
	SmartDashboard.putNumber("X Position", Robot.vision.getXPos());
	Robot.drive.printGyroRate();
	SmartDashboard.putNumber("Front Ultrasonic Distance", Robot.drive.getFrontUltrasonicVoltage());
	SmartDashboard.putNumber("Distance Traveled", Robot.drive.getEncoderDistance());

}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:14,代码来源:DriveWithJoysticks.java

示例10: execute

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void execute() {
	if (Robot.vision.getDesiredShooterAngle() >= 45.0) {
		// Robot.intake.lowerRake();
	}
	SmartDashboard.putNumber("Desired Angle", Robot.vision.getDesiredShooterAngle());
	SmartDashboard.putNumber("POT Angle", Robot.aimShooter.getShooterAngle());
	Robot.aimShooter.moveToAngle(Robot.vision.getDesiredShooterAngle());
	// Robot.aimShooter.moveToAngle(desiredAngle);
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:11,代码来源:Aim.java

示例11: execute

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void execute() {
	// Robot.aimShooter.moveToAngle(desiredAngle);
	if (!((Math.abs(Robot.vision.getDesiredShooterAngle() - Robot.aimShooter.getShooterAngle())) < .4)) {
		Robot.aimShooter.moveToAngleParallel(Robot.vision.getDesiredShooterAngle());
	}
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:8,代码来源:AimParallel.java

示例12: correctForLag

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
public double correctForLag(double offset) {
	double lagAngle = 0.0;
	double offsetAngle = 0.0;
	double realAngle = 0.0;
	double correctedAngle = 0.0;
	lagAngle = cameraLag * Robot.drive.getGyroRate();
	SmartDashboard.putNumber("Correction Angle", lagAngle);
	offsetAngle = offset * 160 * (45.0 / 320.0);
	realAngle = offsetAngle - lagAngle;
	correctedAngle = (realAngle * (320.0 / 45.0) * xOffsetMultiplier);
	return correctedAngle;
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:13,代码来源:Vision.java

示例13: getGyroOffset

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
public double getGyroOffset() {
	gyroVal = Robot.drive.getGyro() * gyroConstant;
	if (Math.abs(gyroVal) > (1.0 - driveSpeedModifierConstant)) {
		gyroVal = (1.0 - driveSpeedModifierConstant) * Math.abs(gyroVal) / gyroVal; // sets gyroVal to either 1 or
		// -1
	}
	return gyroVal;
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:9,代码来源:Drive.java

示例14: execute

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void execute() {
	if (desiredAngle > 0) {
		Robot.drive.spinLeft(.3);
	} else {
		Robot.drive.spinRight(.3);
	}
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:9,代码来源:TurnAngle.java

示例15: initialize

import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void initialize() {
	if (Robot.drive.isReversed == true) {
		Robot.drive.isReversed = false;
	} else {
		Robot.drive.isReversed = true;
	}
}
 
开发者ID:chopshop-166,项目名称:frc-2016,代码行数:9,代码来源:ToggleDriveDirection.java


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