add skeleton code for calculating angle to turn for shooting
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / commands / AlignToScore.java
CommitLineData
ff5c6dcc
ME
1package org.usfirst.frc.team3501.robot.commands;
2
1696ae28
ME
3import org.usfirst.frc.team3501.robot.Robot;
4
ff5c6dcc
ME
5import edu.wpi.first.wpilibj.command.CommandGroup;
6
7/**
8 * This command group will be used in autonomous. Based on what position the
9 * robot is in, the robot will align with the goal
10 *
11 * pre-condition: robot is flush against a defense at the specified position in
12 * the opponent's courtyard
13 *
14 * post-condition: the robot is parallel to one of the three goals and the
15 * shooter is facing that goal
16 *
17 */
18public class AlignToScore extends CommandGroup {
1696ae28
ME
19 private final double DIST_CENTER_OF_MASS_TO_FRONT_OF_ROBOT = 0;
20
5e1e9b1e 21 private final double DEFAULT_SPEED = 0.5;
5e1e9b1e 22
1696ae28 23 // constants for position 1: low bar
5e1e9b1e
ME
24 private final double POS1_DIST1 = 0;
25 private final double POS1_TURN1 = 0;
26 private final double POS1_DIST2 = 0;
27
28 // constants for position 2
4347c80d
ME
29 private final double POS2_DIST1 = 0;
30 private final double POS2_TURN1 = 0;
31 private final double POS2_DIST2 = 0;
32
5e1e9b1e 33 // constants for position 3
a2b9c4a9
ME
34 private final double POS3_DIST1 = 0;
35 private final double POS3_TURN1 = 0;
36 private final double POS3_DIST2 = 0;
37 private final double POS3_TURN2 = 0;
38 private final double POS3_DIST3 = 0;
5e1e9b1e
ME
39
40 // constants for position 4
1696ae28
ME
41 private final double POS4_DIST1 = 0;
42 private final double POS4_TURN1 = 0;
43 private final double POS4_DIST2 = 0;
44 private final double POS4_TURN2 = 0;
45 private final double POS4_DIST3 = 0;
5e1e9b1e
ME
46
47 // constants for position 5
1696ae28
ME
48 private final double POS5_DIST1 = 0;
49 private final double POS5_TURN1 = 0;
50 private final double POS5_DIST2 = 0;
ff5c6dcc
ME
51
52 public AlignToScore(int position) {
53
54 switch (position) {
5e1e9b1e
ME
55
56 // position 1 is always the low bar
ff5c6dcc
ME
57 case 1:
58
4347c80d
ME
59 addSequential(new DriveForDistance(POS1_DIST1, DEFAULT_SPEED));
60 addSequential(new TurnForAngle(POS1_TURN1));
61 addSequential(new DriveForDistance(POS1_DIST2, DEFAULT_SPEED));
ff5c6dcc 62
a2b9c4a9
ME
63 case 2:
64
65 addSequential(new DriveForDistance(POS2_DIST1, DEFAULT_SPEED));
66 addSequential(new TurnForAngle(POS2_TURN1));
67 addSequential(new DriveForDistance(POS2_DIST2, DEFAULT_SPEED));
68
ff5c6dcc
ME
69 case 3:
70
a2b9c4a9
ME
71 addSequential(new DriveForDistance(POS3_DIST1, DEFAULT_SPEED));
72 addSequential(new TurnForAngle(POS3_TURN1));
73 addSequential(new DriveForDistance(POS3_DIST2, DEFAULT_SPEED));
74 addSequential(new TurnForAngle(POS3_TURN2));
75 addSequential(new DriveForDistance(POS3_DIST3, DEFAULT_SPEED));
ff5c6dcc
ME
76
77 case 4:
78
1696ae28
ME
79 addSequential(new DriveForDistance(POS4_DIST1, DEFAULT_SPEED));
80 addSequential(new TurnForAngle(POS4_TURN1));
81 addSequential(new DriveForDistance(POS4_DIST2, DEFAULT_SPEED));
82 addSequential(new TurnForAngle(POS4_TURN2));
83 addSequential(new DriveForDistance(POS4_DIST3, DEFAULT_SPEED));
ff5c6dcc
ME
84
85 case 5:
86
1696ae28
ME
87 addSequential(new DriveForDistance(POS5_DIST1, DEFAULT_SPEED));
88 addSequential(new TurnForAngle(POS5_TURN1));
89 addSequential(new DriveForDistance(POS5_DIST2, DEFAULT_SPEED));
ff5c6dcc
ME
90 }
91 }
1696ae28
ME
92
93 public static void calculatePath() {
94 double leftDistance = Robot.shooter.getLeftDistanceToTower();
95 double rightDistance = Robot.shooter.getRightDistanceToTower();
96 }
ff5c6dcc 97}