This repository has been archived by the owner on Jan 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
archive.txt
106 lines (70 loc) · 3.14 KB
/
archive.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
public class archive {
// Welcome to the graveyard, here is where we have all the java code that we have deleted
// #--- Warning traveler, here be dragons ---#
// Spline path-- found in autodrive.java
System.out.println("radius: " + radius);
System.out.println("arcLength: " + arcLength);
System.out.println("outerScalar: " + outerScalar);
System.out.println("innerScalar: " + innerScalar);
System.out.println("radius out: " + outerRadius);
System.out.println("radius: " + radius);
System.out.println("radius in: " + innerRadius);
System.out.println("arcLength out: " + outerArcLength);
System.out.println("arcLength: " + arcLength);
System.out.println("arcLength in: " + innerArcLength);
System.out.println("outer chord: " + outerChordLength);
System.out.println("inner chord: " + innerChordLength);
System.out.println("outerScalar: " + outerScalar);
System.out.println("innerScalar: " + innerScalar);
double outerRadius = radius * outerScalar;
double innerRadius = radius * innerScalar;
double outerChordLength = chordLength + Constants.ROBOT_WHEEL_SPACING;
double innerChordLength = chordLength - Constants.ROBOT_WHEEL_SPACING;
double outerArcLength = 2 * outerRadius * Math.asin(outerChordLength / (2 * outerRadius));
double arcLength = 2 * radius * Math.asin(chordLength / (2 * radius));
double innerArcLength = 2 * innerRadius * Math.asin(innerChordLength / (2 * innerRadius));
completePositions[0] += Calc.inchesToDrive(outerArcLength);
completePositions[1] -= Calc.inchesToDrive(innerArcLength);
leftSpeed *= outerArcLength / arcLength;
rightSpeed *= innerArcLength / arcLength;
completePositions[0] += Calc.inchesToDrive(outerArcLength);
completePositions[1] -= Calc.inchesToDrive(innerArcLength);
leftSpeed *= innerArcLength / arcLength;
rightSpeed *= outerArcLength / arcLength;
// "initial comp code" :/ found in autopath.java
double[] commandValues = new double[3];
commandValues[0] = Double.parseDouble(splitCommands[0]);
commandValues[1] = Double.parseDouble(splitCommands[1]);
commandValues[2] = Double.parseDouble(splitCommands[2]);
// robot.java 0.-
Pid values "good pid but storing for now"
P = -0.32
I = 0 lmao
D = oh no lets say 0.12
F = what was f... probobly 1
Comment by Lemmon "Very similar to no pid, can't tell what I like better"
//autonomous--base? why was it commented i have no idea - Alexander
@Override
public void autonomousInit() {
leftMotors.setPID(0.05, 0, 5);
rightMotors.setPID(0.05, 0, 5);
turret.setZero();
auto.reset();
auto.addCommands(new Command(CommandType.MOVE, -120, 0.6));
auto.addCommands(new Command(CommandType.MOVE, 36, 0.6));
//auto.addCommands(new Command(CommandType.ROTATE, 0.25, 0.1));
}
@Override
public void autonomousPeriodic() {
auto.executeQueue();
if (auto.queueIsEmpty()) {
intake.setIntakeSpeed(-1.0);
trigger.setSpeed(0.35);
} else {
intake.putDownIntake();
intake.setIntakeSpeed(-1.0);
trigger.setSpeed(-0.1);
}
bottomMotor.setSpeed(0.6);
}
}