package org.usfirst.frc.team3501.robot.commands.auton;
import org.usfirst.frc.team3501.robot.Robot;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
+import org.usfirst.frc.team3501.robot.commands.driving.TurnForAngle;
import edu.wpi.first.wpilibj.command.CommandGroup;
private final static double DIST_CASTLE_WALL_TO_FRONT_GOAL = 0;
private final double DEFAULT_SPEED = 0.5;
+ private final double maxTimeout = 5;
// in inches
// assuming that positive angle means turning right
// position 1 is always the low bar
- addSequential(new DriveForDistance(POS1_DIST1, DEFAULT_SPEED));
- addSequential(new TurnForAngle(POS1_TURN1));
- addSequential(new DriveForDistance(POS1_DIST2, DEFAULT_SPEED));
+ addSequential(new DriveDistance(POS1_DIST1, DEFAULT_SPEED));
+ addSequential(new TurnForAngle(POS1_TURN1, maxTimeout));
+ addSequential(new DriveDistance(POS1_DIST2, DEFAULT_SPEED));
horizontalDistToGoal = 0;
} else if (position == 2) {
- addSequential(new DriveForDistance(POS2_DIST1, DEFAULT_SPEED));
- addSequential(new TurnForAngle(POS2_TURN1));
- addSequential(new DriveForDistance(POS2_DIST2, DEFAULT_SPEED));
+ addSequential(new DriveDistance(POS2_DIST1, DEFAULT_SPEED));
+ addSequential(new TurnForAngle(POS2_TURN1, maxTimeout));
+ addSequential(new DriveDistance(POS2_DIST2, DEFAULT_SPEED));
horizontalDistToGoal = 0;
} else if (position == 3) {
- addSequential(new DriveForDistance(POS3_DIST1, DEFAULT_SPEED));
- addSequential(new TurnForAngle(POS3_TURN1));
- addSequential(new DriveForDistance(POS3_DIST2, DEFAULT_SPEED));
- addSequential(new TurnForAngle(POS3_TURN2));
- addSequential(new DriveForDistance(POS3_DIST3, DEFAULT_SPEED));
+ addSequential(new DriveDistance(POS3_DIST1, DEFAULT_SPEED));
+ addSequential(new TurnForAngle(POS3_TURN1, maxTimeout));
+ addSequential(new DriveDistance(POS3_DIST2, DEFAULT_SPEED));
+ addSequential(new TurnForAngle(POS3_TURN2, maxTimeout));
+ addSequential(new DriveDistance(POS3_DIST3, DEFAULT_SPEED));
horizontalDistToGoal = 0;
} else if (position == 4) {
- addSequential(new DriveForDistance(POS4_DIST1, DEFAULT_SPEED));
- addSequential(new TurnForAngle(POS4_TURN1));
- addSequential(new DriveForDistance(POS4_DIST2, DEFAULT_SPEED));
- addSequential(new TurnForAngle(POS4_TURN2));
- addSequential(new DriveForDistance(POS4_DIST3, DEFAULT_SPEED));
+ addSequential(new DriveDistance(POS4_DIST1, DEFAULT_SPEED));
+ addSequential(new TurnForAngle(POS4_TURN1, maxTimeout));
+ addSequential(new DriveDistance(POS4_DIST2, DEFAULT_SPEED));
+ addSequential(new TurnForAngle(POS4_TURN2, maxTimeout));
+ addSequential(new DriveDistance(POS4_DIST3, DEFAULT_SPEED));
horizontalDistToGoal = 0;
} else if (position == 5) {
- addSequential(new DriveForDistance(POS5_DIST1, DEFAULT_SPEED));
- addSequential(new TurnForAngle(POS5_TURN1));
- addSequential(new DriveForDistance(POS5_DIST2, DEFAULT_SPEED));
- addSequential(new TurnForAngle(POS5_TURN2));
- addSequential(new DriveForDistance(POS5_DIST3, DEFAULT_SPEED));
+ addSequential(new DriveDistance(POS5_DIST1, DEFAULT_SPEED));
+ addSequential(new TurnForAngle(POS5_TURN1, maxTimeout));
+ addSequential(new DriveDistance(POS5_DIST2, DEFAULT_SPEED));
+ addSequential(new TurnForAngle(POS5_TURN2, maxTimeout));
+ addSequential(new DriveDistance(POS5_DIST3, DEFAULT_SPEED));
horizontalDistToGoal = 0;
}
package org.usfirst.frc.team3501.robot.commands.auton;
+import org.usfirst.frc.team3501.robot.commands.driving.DriveDistance;
+
import edu.wpi.first.wpilibj.command.CommandGroup;
/***
* dependency on sensors: encoders
* dependency on subsystems: drivetrain
* dependency on other commands: DriveForDist
- *
+ *
* pre-condition: robot is flush against the ramp of the outerworks in front of
* the low bar
*
private final double DEFAULT_SPEED = 0.5;
public PassLowBar() {
- // TODO: need to add sequential for retracting the arms and shooting hood once those commands are made
- addSequential(new DriveForDistance(DISTANCE, DEFAULT_SPEED));
+ // TODO: need to add sequential for retracting the arms and shooting hood
+ // once those commands are made
+ addSequential(new DriveDistance(DISTANCE, DEFAULT_SPEED));
}
public PassLowBar(double speed) {
- addSequential(new DriveForDistance(DISTANCE, speed));
+ addSequential(new DriveDistance(DISTANCE, speed));
}
}