package org.usfirst.frc.team3501.robot;
+import org.usfirst.frc.team3501.robot.commands.auton.CompactRobot;
import org.usfirst.frc.team3501.robot.commands.auton.PassChevalDeFrise;
import org.usfirst.frc.team3501.robot.commands.auton.PassDrawBridge;
import org.usfirst.frc.team3501.robot.commands.auton.PassPortcullis;
import org.usfirst.frc.team3501.robot.commands.auton.PassSallyPort;
+import org.usfirst.frc.team3501.robot.commands.driving.Turn180;
import org.usfirst.frc.team3501.robot.commands.intakearm.IntakeBall;
+import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArmToAngle;
import org.usfirst.frc.team3501.robot.commands.scaler.ExtendLift;
import org.usfirst.frc.team3501.robot.commands.scaler.RetractLift;
import org.usfirst.frc.team3501.robot.commands.scaler.RunWinchContinuous;
import org.usfirst.frc.team3501.robot.commands.scaler.StopWinch;
import org.usfirst.frc.team3501.robot.commands.shooter.Shoot;
import org.usfirst.frc.team3501.robot.commands.shooter.runShooter;
+import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.Joystick;
passDrawbridge.whenPressed(new PassDrawBridge());
passSallyPort.whenPressed(new PassSallyPort());
- lowerChevalDeFrise
- .whenPressed(/* TO DO: define this, and fill in commands */);
+ lowerChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
+ IntakeArm.potAngles[0], IntakeArm.moveIntakeArmSpeed));
+ moveToIntakeBoulder.whenPressed(new MoveIntakeArmToAngle(
+ IntakeArm.potAngles[1], IntakeArm.moveIntakeArmSpeed));
+ poiseAboveChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
+ IntakeArm.potAngles[2], IntakeArm.moveIntakeArmSpeed));
+ moveIntakeArmInsideRobot.whenPressed(new MoveIntakeArmToAngle(
+ IntakeArm.potAngles[3], IntakeArm.moveIntakeArmSpeed));
if (toggleScalingMode.get()) {
if (!isScalingMode) {
if (!isScalingMode) {
toggleShooter.toggleWhenPressed(new runShooter());
compactRobot_1.whenPressed(new CompactRobot());
+ compactRobot_2.whenPressed(new CompactRobot());
intakeBoulder.whenPressed(new IntakeBall());
shootBoulder.whenPressed(new Shoot());
toggleShooter.whenPressed(new RunWinchContinuous(
Constants.Scaler.WINCH_IN_SPEED));
compactRobot_1.whenPressed(new RetractLift());
+ compactRobot_2.whenPressed(new RetractLift());
intakeBoulder.whenReleased(new StopWinch());
shootBoulder.whenPressed(new ExtendLift());
}
- SpinRobot180_1
- .whenPressed(/* rotate robot 180, reorient joystick controls */);
-
+ SpinRobot180_1.whenPressed(new Turn180());
+ SpinRobot180_2.whenPressed(new Turn180());
}
}
// Drivetrain specific constants that relate to the PID controllers
private final static double Kp = 1.0, Ki = 0.0,
Kd = 0.0 * (OUTPUT_SPROCKET_DIAMETER / PULSES_PER_ROTATION)
- / (WHEEL_SPROCKET_DIAMETER) * WHEEL_DIAMETER;
+ / (WHEEL_SPROCKET_DIAMETER) * WHEEL_DIAMETER;
public DriveTrain() {
super(kp, ki, kd);
+Constants.DriveTrain.LEFT_REVERSE);
rightGearPiston = new DoubleSolenoid(Constants.DriveTrain.RIGHT_FORWARD,
Constants.DriveTrain.RIGHT_REVERSE);
+ Constants.DriveTrain.inverted = false;
}
@Override
}
public void drive(double left, double right) {
- robotDrive.tankDrive(-left, -right);
// dunno why but inverted drive (- values is forward)
+ if (!Constants.DriveTrain.inverted)
+ robotDrive.tankDrive(-left,
+ -right);
+ else
+ robotDrive.tankDrive(right, left);
}
public void driveDistance(double dist, double maxTimeOut) {