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

Commit 01fa85b

Browse files
committed
Merge remote-tracking branch 'blue/master'
2 parents d6bfa17 + bff95a8 commit 01fa85b

8 files changed

Lines changed: 101 additions & 108 deletions

File tree

Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Sun Feb 18 11:01:27 PST 2018
1+
#Sun Feb 18 15:40:25 PST 2018
22
C\:\\Users\\dean\\git\\RobotCode2018\\Robot2018\\lib\\libpathfinderjava.so=4087ee38c338446b8305f67716260df4

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

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,8 @@
77

88
package org.usfirst.frc.team199.Robot2018;
99

10-
import org.usfirst.frc.team199.Robot2018.commands.CloseIntake;
11-
import org.usfirst.frc.team199.Robot2018.commands.IntakeCube;
12-
import org.usfirst.frc.team199.Robot2018.commands.LowerIntake;
13-
import org.usfirst.frc.team199.Robot2018.commands.OpenIntake;
14-
import org.usfirst.frc.team199.Robot2018.commands.OutakeCube;
1510
import org.usfirst.frc.team199.Robot2018.commands.PIDMove;
1611
import org.usfirst.frc.team199.Robot2018.commands.PIDTurn;
17-
import org.usfirst.frc.team199.Robot2018.commands.RaiseIntake;
1812
import org.usfirst.frc.team199.Robot2018.commands.ResetEncoders;
1913
import org.usfirst.frc.team199.Robot2018.commands.RunLift;
2014
import org.usfirst.frc.team199.Robot2018.commands.SetDistancePerPulse;
@@ -32,6 +26,10 @@
3226
* interface to the commands and command groups that allow control of the robot.
3327
*/
3428
public class OI {
29+
/*
30+
* WHENEVER YOU ADD OR CHANGE WHAT A BUTTON OR JOYSTICK DOES, indicate in
31+
* /docs/controllers.txt to keep that reference up to date.
32+
*/
3533

3634
public Joystick leftJoy;
3735
private JoystickButton shiftLowGearButton;
@@ -92,18 +90,22 @@ public OI() {
9290
MoveLiftUpButton.whileHeld(new RunLift(Robot.lift, true));
9391
MoveLiftDownButton.whileHeld(new RunLift(Robot.lift, false));
9492

95-
manipulator = new Joystick(2);
96-
closeIntake = new JoystickButton(manipulator, getButton("Close Intake Button", 1));
97-
closeIntake.whenPressed(new CloseIntake());
98-
openIntake = new JoystickButton(manipulator, getButton("Open Intake Button", 2));
99-
openIntake.whenPressed(new OpenIntake());
100-
raiseIntake = new JoystickButton(manipulator, getButton("Raise Intake Button", 3));
101-
raiseIntake.whenPressed(new RaiseIntake());
102-
lowerIntake = new JoystickButton(manipulator, getButton("Lower Intake Button", 4));
103-
lowerIntake.whenPressed(new LowerIntake());
104-
intake = new JoystickButton(manipulator, getButton("Intake Button", 5));
105-
intake.whenPressed(new IntakeCube());
106-
outake = new JoystickButton(manipulator, getButton("Outake Button", 6));
107-
outake.whenPressed(new OutakeCube());
93+
// manipulator = new Joystick(2);
94+
// closeIntake = new JoystickButton(manipulator, getButton("Close Intake
95+
// Button", 1));
96+
// closeIntake.whenPressed(new CloseIntake());
97+
// openIntake = new JoystickButton(manipulator, getButton("Open Intake Button",
98+
// 2));
99+
// openIntake.whenPressed(new OpenIntake());
100+
// raiseIntake = new JoystickButton(manipulator, getButton("Raise Intake
101+
// Button", 3));
102+
// raiseIntake.whenPressed(new RaiseIntake());
103+
// lowerIntake = new JoystickButton(manipulator, getButton("Lower Intake
104+
// Button", 4));
105+
// lowerIntake.whenPressed(new LowerIntake());
106+
// intake = new JoystickButton(manipulator, getButton("Intake Button", 5));
107+
// intake.whenPressed(new IntakeCube());
108+
// outake = new JoystickButton(manipulator, getButton("Outake Button", 6));
109+
// outake.whenPressed(new OutakeCube());
108110
}
109111
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public void teleopPeriodic() {
212212
// SmartDashboard.putNumber("Right Enc Dist", dt.getRightDist());
213213
// SmartDashboard.putNumber("Avg Enc Dist", dt.getEncAvgDist());
214214
//
215-
// SmartDashboard.putNumber("Angle", dt.getAHRSAngle());
215+
SmartDashboard.putNumber("Angle", dt.getAHRSAngle());
216216
}
217217

218218
boolean firstTime = true;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ public PIDMove(double targ, DrivetrainInterface dt, SmartDashboardInterface sd,
4646
double kf = 1 / (dt.getCurrentMaxSpeed() * sd.getConst("Default PID Update Time", 0.05));
4747
moveController = new PIDController(sd.getConst("MovekP", 0.1), sd.getConst("MovekI", 0),
4848
sd.getConst("MovekD", 0), kf, avg, this);
49+
SmartDashboard.putData("Move PID", moveController);
4950
}
5051

5152
/**
@@ -64,8 +65,6 @@ public void initialize() {
6465
moveController.setAbsoluteTolerance(Robot.getConst("MoveTolerance", 0.1));
6566
moveController.setSetpoint(Robot.getConst("Move Targ", 24));
6667

67-
SmartDashboard.putData("Move PID", moveController);
68-
6968
moveController.enable();
7069
// dt.enableVelocityPIDs();
7170
}

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public PIDTurn(double targ, DrivetrainInterface dt, SmartDashboardInterface sd,
5858
turnController = new PIDController(sd.getConst("TurnkP", 1), sd.getConst("TurnkI", 0), sd.getConst("TurnkD", 0),
5959
kf, ahrs, this);
6060
// tim = new Timer();
61+
SmartDashboard.putData("Turn PID", turnController);
6162
}
6263

6364
/**
@@ -69,23 +70,21 @@ protected void initialize() {
6970
turnController.disable();
7071
// dt.enableVelocityPIDs();
7172
System.out.println("initialize2s");
72-
dt.resetAHRS();
73+
// dt.resetAHRS();
7374
System.out.println("after reset");
7475
System.out.println("after disabling");
7576
// input is in degrees
7677
turnController.setInputRange(-180, 180);
7778
// output in "motor units" (arcade and tank only accept values [-1, 1]
78-
turnController.setOutputRange(-1.0, 1.0);
79+
turnController.setOutputRange(Robot.getConst("Output", 0.5) * -1, Robot.getConst("Output", 0.5));
7980
turnController.setContinuous(true);
8081
turnController.setAbsoluteTolerance(Robot.getConst("TurnTolerance", 1));
81-
double newSetPoint = Robot.getConst("Turn Targ", 90);
82+
double newSetPoint = Robot.getConst("Turn Targ", 90) + dt.getAHRSAngle();
8283
while (Math.abs(newSetPoint) > 180) {
8384
newSetPoint = newSetPoint - Math.signum(newSetPoint) * 360;
8485
}
8586
turnController.setSetpoint(newSetPoint);
8687

87-
SmartDashboard.putData("Turn PID", turnController);
88-
8988
turnController.enable();
9089
System.out.println("initialize finished");
9190
// tim.start();

docs/controllers.txt

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
controller indices
2+
manipulator
3+
buttons
4+
1 A
5+
2 B
6+
3 X
7+
4 Y
8+
5 LB
9+
6 RB
10+
7 back
11+
8 start
12+
9 N/a
13+
10 N/a
14+
press mode to toggle mode light
15+
axes
16+
0 left thumbstick X axis (D-pad if mode light on)
17+
1 left thumbstick Y axis (D-pad if mode light on)
18+
2 left trigger
19+
3 right trigger
20+
4 right thumbstick X axis
21+
5 right thumbstick Y axis
22+
mode light off:
23+
POV
24+
D-pad (left joystick if mode light on)
25+
rumble
26+
fake news
27+
left joystick
28+
buttons
29+
1
30+
2
31+
3
32+
4
33+
5
34+
6
35+
7
36+
8
37+
9
38+
10
39+
11
40+
axes
41+
0 X axis
42+
1 Y axis (forward is negative)
43+
2 Z axis (knob at base)
44+
right joystick
45+
buttons
46+
1
47+
2
48+
3
49+
4
50+
5
51+
6
52+
7
53+
8
54+
9
55+
10
56+
11
57+
axes
58+
0 X axis
59+
1 Y axis (forward is negative)
60+
2 Z axis (knob at base)

shuffleboard.json

Lines changed: 13 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"dividerPosition": 0.2218100890207715,
2+
"dividerPosition": 0.45185185185185184,
33
"tabPane": [
44
{
55
"title": "PID Testing",
@@ -41,9 +41,8 @@
4141
"content": {
4242
"_type": "Graph",
4343
"_source0": "network_table:///SmartDashboard/Left Enc Rate",
44-
"_title": "SmartDashboard/Left Enc Rate",
45-
"Visible time": 30.0,
46-
"SmartDashboard/Left Enc Rate visible": true
44+
"_title": "/SmartDashboard/Left Enc Rate",
45+
"Visible time": 30.0
4746
}
4847
},
4948
"5,2": {
@@ -65,9 +64,8 @@
6564
"content": {
6665
"_type": "Graph",
6766
"_source0": "network_table:///SmartDashboard/Right Enc Rate",
68-
"_title": "SmartDashboard/Right Enc Rate",
69-
"Visible time": 30.0,
70-
"SmartDashboard/Right Enc Rate visible": true
67+
"_title": "/SmartDashboard/Right Enc Rate",
68+
"Visible time": 30.0
7169
}
7270
},
7371
"5,3": {
@@ -242,17 +240,6 @@
242240
"colorWhenTrue": "#7CFC00FF",
243241
"colorWhenFalse": "#8B0000FF"
244242
}
245-
},
246-
"2,1": {
247-
"size": [
248-
2,
249-
1
250-
],
251-
"content": {
252-
"_type": "Text View",
253-
"_source0": "network_table:///SmartDashboard/Const/DPP",
254-
"_title": "SmartDashboard/Const/DPP"
255-
}
256243
}
257244
}
258245
}
@@ -297,9 +284,8 @@
297284
"content": {
298285
"_type": "Graph",
299286
"_source0": "network_table:///SmartDashboard/Right Enc Dist",
300-
"_title": "SmartDashboard/Right Enc Dist",
301-
"Visible time": 10.0,
302-
"SmartDashboard/Right Enc Dist visible": true
287+
"_title": "/SmartDashboard/Right Enc Dist",
288+
"Visible time": 10.0
303289
}
304290
},
305291
"1,0": {
@@ -310,14 +296,13 @@
310296
"content": {
311297
"_type": "Graph",
312298
"_source0": "network_table:///SmartDashboard/Left Enc Dist",
313-
"_title": "SmartDashboard/Left Enc Dist",
314-
"Visible time": 10.0,
315-
"SmartDashboard/Left Enc Dist visible": true
299+
"_title": "/SmartDashboard/Left Enc Dist",
300+
"Visible time": 10.0
316301
}
317302
},
318303
"5,0": {
319304
"size": [
320-
2,
305+
1,
321306
1
322307
],
323308
"content": {
@@ -431,7 +416,7 @@
431416
"hgap": 16.0,
432417
"vgap": 16.0,
433418
"tiles": {
434-
"5,0": {
419+
"1,0": {
435420
"size": [
436421
2,
437422
1
@@ -475,7 +460,7 @@
475460
"_title": "SmartDashboard/Turn PID Result"
476461
}
477462
},
478-
"5,1": {
463+
"2,1": {
479464
"size": [
480465
1,
481466
1
@@ -519,32 +504,6 @@
519504
"_title": "SmartDashboard/Right VPID Error"
520505
}
521506
},
522-
"3,2": {
523-
"size": [
524-
2,
525-
2
526-
],
527-
"content": {
528-
"_type": "Graph",
529-
"_source0": "network_table:///SmartDashboard/Drivetrain/Left VPID Targ",
530-
"_title": "SmartDashboard/Drivetrain/Left VPID Targ",
531-
"Visible time": 30.0,
532-
"SmartDashboard/Drivetrain/Left VPID Targ visible": true
533-
}
534-
},
535-
"5,2": {
536-
"size": [
537-
2,
538-
2
539-
],
540-
"content": {
541-
"_type": "Graph",
542-
"_source0": "network_table:///SmartDashboard/Drivetrain/Right VPID Targ",
543-
"_title": "SmartDashboard/Drivetrain/Right VPID Targ",
544-
"Visible time": 30.0,
545-
"SmartDashboard/Drivetrain/Right VPID Targ visible": true
546-
}
547-
},
548507
"0,2": {
549508
"size": [
550509
1,
@@ -556,7 +515,7 @@
556515
"_title": "SmartDashboard/Const/Turn Targ"
557516
}
558517
},
559-
"6,1": {
518+
"1,1": {
560519
"size": [
561520
1,
562521
1
@@ -566,32 +525,6 @@
566525
"_source0": "network_table:///SmartDashboard/Const/TurnTolerance",
567526
"_title": "SmartDashboard/Const/TurnTolerance"
568527
}
569-
},
570-
"3,0": {
571-
"size": [
572-
2,
573-
2
574-
],
575-
"content": {
576-
"_type": "Graph",
577-
"_source0": "network_table:///SmartDashboard/Drivetrain/Right Enc Dist",
578-
"_title": "SmartDashboard/Drivetrain/Right Enc Dist",
579-
"Visible time": 30.0,
580-
"SmartDashboard/Drivetrain/Right Enc Dist visible": true
581-
}
582-
},
583-
"1,0": {
584-
"size": [
585-
2,
586-
2
587-
],
588-
"content": {
589-
"_type": "Graph",
590-
"_source0": "network_table:///SmartDashboard/Drivetrain/Left Enc Dist",
591-
"_title": "SmartDashboard/Drivetrain/Left Enc Dist",
592-
"Visible time": 30.0,
593-
"SmartDashboard/Drivetrain/Left Enc Dist visible": true
594-
}
595528
}
596529
}
597530
}

0 commit comments

Comments
 (0)