Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit 9772cbc

Browse files
committed
auto working changes
1 parent c80e519 commit 9772cbc

9 files changed

Lines changed: 40 additions & 39 deletions

File tree

AAAScripts/scripts.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ moveto (0,120) #Drive past auto line
88
#Switch
99
RRxx:
1010
moveto (0,148) -90
11-
switch 19
11+
switch 17
1212

1313
RLxx:
1414
move 56
@@ -76,7 +76,7 @@ moveto (0, 120) #Drive past auto line
7676
#Switch
7777
LLxx:
7878
moveto (0,148) 90
79-
switch 19
79+
switch 17
8080

8181
LRxx:
8282
move 56
@@ -141,12 +141,12 @@ moveto (0, 12) (40, 88)
141141

142142
# Switch
143143
CRxx:
144-
moveto (0,15) (50,85) 0
145-
switch 15
144+
moveto (0,15) (50,80) 0
145+
switch 18
146146

147147
CLxx:
148-
moveto (0,15) (-60,85) 0
149-
switch 15
148+
moveto (0,15) (-60,80) 0
149+
switch 18
150150

151151

152152
# Switch and Exchange

CompSD.xml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,25 @@
11
<xml version="1.0">
22
<dashboard>
3+
<static-widget class="edu.wpi.first.smartdashboard.gui.elements.CameraServerViewer">
4+
<location x="260" y="17"/>
5+
<width>552</width>
6+
<height>403</height>
7+
<property name="Degrees Rotation" value="180"/>
8+
<property name="Camera Choice" value=""/>
9+
</static-widget>
10+
<widget field="Right Intake Open" type="Boolean" class="edu.wpi.first.smartdashboard.gui.elements.TextBox">
11+
<location x="37" y="250"/>
12+
</widget>
13+
<widget field="Left Intake Open" type="Boolean" class="edu.wpi.first.smartdashboard.gui.elements.TextBox">
14+
<location x="37" y="229"/>
15+
</widget>
316
<widget field="DT is Inverted" type="Boolean" class="edu.wpi.first.smartdashboard.gui.elements.BooleanBox">
417
<location x="11" y="110"/>
518
<width>118</width>
619
<height>59</height>
720
</widget>
821
<widget field="Has Cube" type="Boolean" class="edu.wpi.first.smartdashboard.gui.elements.BooleanBox">
9-
<location x="697" y="463"/>
22+
<location x="1182" y="402"/>
1023
<width>96</width>
1124
<height>30</height>
1225
</widget>
@@ -15,19 +28,6 @@
1528
<width>113</width>
1629
<height>44</height>
1730
</widget>
18-
<static-widget class="edu.wpi.first.smartdashboard.gui.elements.CameraServerViewer">
19-
<location x="783" y="0"/>
20-
<width>571</width>
21-
<height>448</height>
22-
<property name="Camera Choice" value="USB Camera 1"/>
23-
</static-widget>
24-
<static-widget class="edu.wpi.first.smartdashboard.gui.elements.CameraServerViewer">
25-
<location x="191" y="7"/>
26-
<width>586</width>
27-
<height>438</height>
28-
<property name="Degrees Rotation" value="180"/>
29-
<property name="Camera Choice" value=""/>
30-
</static-widget>
3131
<widget field="Move PID Error" type="Number" class="edu.wpi.first.smartdashboard.gui.elements.TextBox">
3232
<location x="173" y="661"/>
3333
</widget>
@@ -129,13 +129,13 @@
129129
</dashboard>
130130
<live-window>
131131
<widget field="Drivetrain" type="LW Subsystem" class="edu.wpi.first.smartdashboard.livewindow.elements.LWSubsystem">
132-
<location x="7" y="6"/>
132+
<location x="3" y="14"/>
133133
</widget>
134134
<widget field="ClimberAssist" type="LW Subsystem" class="edu.wpi.first.smartdashboard.livewindow.elements.LWSubsystem">
135-
<location x="21" y="22"/>
135+
<location x="9" y="11"/>
136136
</widget>
137137
<widget field="IntakeEject" type="LW Subsystem" class="edu.wpi.first.smartdashboard.livewindow.elements.LWSubsystem">
138-
<location x="18" y="28"/>
138+
<location x="30" y="22"/>
139139
</widget>
140140
<widget field="Lift" type="LW Subsystem" class="edu.wpi.first.smartdashboard.livewindow.elements.LWSubsystem">
141141
<widget field="PIDController" type="PIDController" class="edu.wpi.first.smartdashboard.gui.elements.PIDEditor">
@@ -153,12 +153,12 @@
153153
<height>46</height>
154154
<width>293</width>
155155
</widget>
156-
<location x="24" y="18"/>
156+
<location x="31" y="11"/>
157157
<width>305</width>
158158
<height>323</height>
159159
</widget>
160160
<widget field="Climber" type="LW Subsystem" class="edu.wpi.first.smartdashboard.livewindow.elements.LWSubsystem">
161-
<location x="5" y="16"/>
161+
<location x="23" y="3"/>
162162
</widget>
163163
<widget field="Ungrouped" type="LW Subsystem" class="edu.wpi.first.smartdashboard.livewindow.elements.LWSubsystem">
164164
<widget field="Encoder[1]" type="Quadrature Encoder" class="edu.wpi.first.smartdashboard.livewindow.elements.EncoderDisplay">
@@ -251,7 +251,7 @@
251251
<height>20</height>
252252
<width>326</width>
253253
</widget>
254-
<location x="6" y="24"/>
254+
<location x="8" y="22"/>
255255
<width>338</width>
256256
<height>974</height>
257257
</widget>

Robot2018/src/org/usfirst/frc/team199/Robot2018/OI.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import org.usfirst.frc.team199.Robot2018.commands.PIDTurn;
1919
import org.usfirst.frc.team199.Robot2018.commands.ResetEncoders;
2020
import org.usfirst.frc.team199.Robot2018.commands.SetDistancePerPulse;
21-
import org.usfirst.frc.team199.Robot2018.commands.ShiftDriveType;
2221
import org.usfirst.frc.team199.Robot2018.commands.ShiftHighGear;
2322
import org.usfirst.frc.team199.Robot2018.commands.ShiftLowGear;
2423
import org.usfirst.frc.team199.Robot2018.commands.StopIntake;
@@ -44,7 +43,7 @@ public class OI {
4443
public Joystick rightJoy;
4544
private JoystickButton shiftLowGearButton;
4645
private JoystickButton shiftHighGearButton;
47-
private JoystickButton shiftDriveTypeButton;
46+
// private JoystickButton shiftDriveTypeButton;
4847
private JoystickButton pIDMoveButton;
4948
private JoystickButton pIDTurnButton;
5049
private JoystickButton resetEncButton;
@@ -82,8 +81,9 @@ public int getButton(String key, int def) {
8281

8382
public OI(Robot robot) {
8483
leftJoy = new Joystick(0);
85-
shiftDriveTypeButton = new JoystickButton(leftJoy, getButton("Shift Drive Type", 2));
86-
shiftDriveTypeButton.whenPressed(new ShiftDriveType());
84+
// shiftDriveTypeButton = new JoystickButton(leftJoy, getButton("Shift Drive
85+
// Type", 2));
86+
// shiftDriveTypeButton.whenPressed(new ShiftDriveType());
8787

8888
invertDTButton = new JoystickButton(leftJoy, getButton("Invert Drivetrain", 3));
8989
invertDTButton.whenPressed(new InvertDrivetrain());

Robot2018/src/org/usfirst/frc/team199/Robot2018/Robot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ public void robotInit() {
183183

184184
listen = new Listener();
185185
lift.resetEnc();
186-
CameraServer.getInstance().startAutomaticCapture(0);
187-
CameraServer.getInstance().startAutomaticCapture(1);
186+
// CameraServer.getInstance().startAutomaticCapture(0);
187+
CameraServer.getInstance().startAutomaticCapture((int) Robot.getConst("Camera Port", 1));
188188
}
189189

190190
/**

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/AutoLift.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ public class AutoLift extends CommandGroup {
1313
public AutoLift(Lift lift, String height) {
1414
if (height.equals("GROUND")) {
1515
addSequential(new LiftToPosition(lift, LiftHeight.toLH("HOLD_CUBE")));
16-
addSequential(new LiftToPosition(lift, LiftHeight.toLH(height)));
17-
} else {
18-
addSequential(new LiftToPosition(lift, LiftHeight.toLH(height)));
1916
}
17+
addSequential(new LiftToPosition(lift, LiftHeight.toLH(height)));
2018
}
2119
}

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/LiftToPosition.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ public LiftToPosition(Lift lift, LiftHeight goal) {
2424
// Called just before this Command runs the first time
2525
@Override
2626
protected void initialize() {
27-
lift.getPIDController().setPID(Robot.getConst("LiftkP", 0.1), Robot.getConst("LiftkI", 0),
28-
Robot.getConst("LiftkD", 0), Robot.getConst("LiftkF", 0.1));
27+
// lift.getPIDController().setPID(Robot.getConst("LiftkP", 0.1),
28+
// Robot.getConst("LiftkI", 0),
29+
// Robot.getConst("LiftkD", 0), Robot.getConst("LiftkF", 0.1));
2930
double setpoint = lift.getDesiredDistFromPos(pos);
3031
lift.setSetpoint(setpoint);
3132
System.out.println("Target Height: " + setpoint);

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/UpdateLiftPosition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ protected void execute() {
5454
goToGround = false;
5555
}
5656

57-
if (goToGround || angle != -1) {
57+
if (/* goToGround || */ angle != -1) {
5858
desiredDist = lift.getDesiredDistFromPos(desiredPos);
5959
lift.setSetpoint(desiredDist);
6060
}

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/IntakeEject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ public void runIntake(double speed) {
127127
public void toggleIntake() {
128128
toggleLeftIntake();
129129
toggleRightIntake();
130+
SmartDashboard.putBoolean("Left Intake Open", leftOpen);
131+
SmartDashboard.putBoolean("Right Intake Open", rightOpen);
130132
}
131133

132134
/**

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/Lift.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public Lift() {
6161
WIGGLE_ROOM = (int) Robot.getConst("Lift wiggle room", 3.0); // inches
6262

6363
// calculate constant measurements
64-
GROUND_DIST = 0;
64+
GROUND_DIST = 0.7;
6565
HOLD_CUBE_DIST = 4;
6666
// distance to switch 18.75 inches in starting position
6767
SWITCH_DIST = (18.75 + WIGGLE_ROOM) / NUM_STAGES;

0 commit comments

Comments
 (0)