本文整理汇总了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());
}
示例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());
}
}
示例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();
}
}
示例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);
}
}
示例5: initialize
import org.usfirst.frc.team166.robot.Robot; //导入依赖的package包/类
@Override
protected void initialize() {
Robot.drive.resetGyro();
timer = new Timer();
timer.reset();
timer.start();
}
示例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);
}
示例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());
}
示例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();
}
示例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());
}
示例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);
}
示例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());
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
}