Skip to content

Commit bb60472

Browse files
committed
testing
Signed-off-by: Dasun Abeykoon <[email protected]>
1 parent 187a3ae commit bb60472

File tree

13 files changed

+431
-113
lines changed

13 files changed

+431
-113
lines changed

networktables.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]

simgui-ds.json

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"keyboardJoysticks": [
3+
{
4+
"axisConfig": [
5+
{
6+
"decKey": 65,
7+
"incKey": 68
8+
},
9+
{
10+
"decKey": 87,
11+
"incKey": 83
12+
},
13+
{
14+
"decKey": 69,
15+
"decayRate": 0.0,
16+
"incKey": 82,
17+
"keyRate": 0.009999999776482582
18+
}
19+
],
20+
"axisCount": 3,
21+
"buttonCount": 4,
22+
"buttonKeys": [
23+
90,
24+
88,
25+
67,
26+
86
27+
],
28+
"povConfig": [
29+
{
30+
"key0": 328,
31+
"key135": 323,
32+
"key180": 322,
33+
"key225": 321,
34+
"key270": 324,
35+
"key315": 327,
36+
"key45": 329,
37+
"key90": 326
38+
}
39+
],
40+
"povCount": 1
41+
},
42+
{
43+
"axisConfig": [
44+
{
45+
"decKey": 74,
46+
"incKey": 76
47+
},
48+
{
49+
"decKey": 73,
50+
"incKey": 75
51+
}
52+
],
53+
"axisCount": 2,
54+
"buttonCount": 4,
55+
"buttonKeys": [
56+
77,
57+
44,
58+
46,
59+
47
60+
],
61+
"povCount": 0
62+
},
63+
{
64+
"axisConfig": [
65+
{
66+
"decKey": 263,
67+
"incKey": 262
68+
},
69+
{
70+
"decKey": 265,
71+
"incKey": 264
72+
}
73+
],
74+
"axisCount": 2,
75+
"buttonCount": 6,
76+
"buttonKeys": [
77+
260,
78+
268,
79+
266,
80+
261,
81+
269,
82+
267
83+
],
84+
"povCount": 0
85+
},
86+
{
87+
"axisCount": 0,
88+
"buttonCount": 0,
89+
"povCount": 0
90+
}
91+
],
92+
"robotJoysticks": [
93+
{
94+
"guid": "Keyboard0"
95+
}
96+
]
97+
}

simgui-window.json

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
{
2+
"Docking": {
3+
"Data": [
4+
"DockNode ID=0x00000001 Pos=2562,50 Size=625,1737 Selected=0x19DC5F98",
5+
"DockNode ID=0x00000002 Pos=626,101 Size=1875,888 Selected=0x2D9B9756"
6+
]
7+
},
8+
"MainWindow": {
9+
"GLOBAL": {
10+
"font": "Proggy Dotted",
11+
"fps": "120",
12+
"height": "1984",
13+
"maximized": "1",
14+
"style": "0",
15+
"userScale": "2",
16+
"width": "3840",
17+
"xpos": "0",
18+
"ypos": "56"
19+
}
20+
},
21+
"Window": {
22+
"###/SmartDashboard/GlobalVisualizer": {
23+
"Collapsed": "0",
24+
"DockId": "0x00000001,1",
25+
"Pos": "2562,50",
26+
"Size": "625,1737"
27+
},
28+
"###FMS": {
29+
"Collapsed": "0",
30+
"Pos": "12,1350",
31+
"Size": "368,364"
32+
},
33+
"###Joysticks": {
34+
"Collapsed": "0",
35+
"DockId": "0x00000002,2",
36+
"Pos": "626,101",
37+
"Size": "1875,888"
38+
},
39+
"###NetworkTables": {
40+
"Collapsed": "0",
41+
"DockId": "0x00000002,0",
42+
"Pos": "626,101",
43+
"Size": "1875,888"
44+
},
45+
"###NetworkTables Info": {
46+
"Collapsed": "0",
47+
"DockId": "0x00000002,1",
48+
"Pos": "626,101",
49+
"Size": "1875,888"
50+
},
51+
"###Other Devices": {
52+
"Collapsed": "0",
53+
"DockId": "0x00000001,0",
54+
"Pos": "2562,50",
55+
"Size": "625,1737"
56+
},
57+
"###Plot <0>": {
58+
"Collapsed": "0",
59+
"Pos": "625,1064",
60+
"Size": "1858,876"
61+
},
62+
"###System Joysticks": {
63+
"Collapsed": "0",
64+
"Pos": "12,875",
65+
"Size": "435,434"
66+
},
67+
"###Timing": {
68+
"Collapsed": "0",
69+
"Pos": "12,375",
70+
"Size": "294,217"
71+
},
72+
"Debug##Default": {
73+
"Collapsed": "0",
74+
"Pos": "60,60",
75+
"Size": "400,400"
76+
},
77+
"Robot State": {
78+
"Collapsed": "0",
79+
"Pos": "23,48",
80+
"Size": "213,224"
81+
}
82+
}
83+
}

simgui.json

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"NTProvider": {
3+
"types": {
4+
"/FMSInfo": "FMSInfo",
5+
"/SmartDashboard/Alerts": "Alerts",
6+
"/SmartDashboard/GlobalVisualizer": "Mechanism2d",
7+
"/SmartDashboard/ProfiledPIDController[2]": "ProfiledPIDController"
8+
},
9+
"windows": {
10+
"/SmartDashboard/GlobalVisualizer": {
11+
"window": {
12+
"visible": true
13+
}
14+
}
15+
}
16+
},
17+
"NetworkTables": {
18+
"transitory": {
19+
"Telemetry": {
20+
"arm": {
21+
"Arm Hardware Loggables": {
22+
"open": true
23+
},
24+
"open": true
25+
},
26+
"elevator": {
27+
"Elevator Hardware Loggables": {
28+
"open": true
29+
},
30+
"open": true
31+
},
32+
"open": true
33+
},
34+
"Tunables": {
35+
"arm": {
36+
"open": true
37+
},
38+
"elevator": {
39+
"open": true
40+
},
41+
"open": true
42+
}
43+
}
44+
},
45+
"NetworkTables Info": {
46+
"visible": true
47+
},
48+
"Plot": {
49+
"Plot <0>": {
50+
"plots": [
51+
{
52+
"axis": [
53+
{
54+
"label": "elevator"
55+
},
56+
{
57+
"label": "arm",
58+
"lockMax": true,
59+
"lockMin": true,
60+
"max": -1.6,
61+
"min": 1.6
62+
}
63+
],
64+
"backgroundColor": [
65+
0.0,
66+
0.0,
67+
0.0,
68+
0.8500000238418579
69+
],
70+
"height": 778,
71+
"series": [
72+
{
73+
"color": [
74+
1.0,
75+
0.0,
76+
0.0,
77+
1.0
78+
],
79+
"id": "NT:Telemetry/elevator/Elevator Hardware Loggables/Parent Motor Position (Meters)"
80+
},
81+
{
82+
"color": [
83+
0.13432836532592773,
84+
1.0,
85+
0.0,
86+
1.0
87+
],
88+
"id": "NT:Telemetry/elevator/Elevator Hardware Loggables/Parent and Child Motors Setpoint Position (Meters)"
89+
},
90+
{
91+
"color": [
92+
0.0,
93+
0.34328365325927734,
94+
1.0,
95+
1.0
96+
],
97+
"id": "NT:Telemetry/elevator/Elevator Hardware Loggables/Parent and Child Motors Velocity (Meters Per Second)"
98+
},
99+
{
100+
"color": [
101+
1.0,
102+
0.0,
103+
0.03389883041381836,
104+
1.0
105+
],
106+
"id": "NT:Telemetry/arm/Arm Hardware Loggables/Pivot Motor Angle (Radians)",
107+
"yAxis": 1
108+
},
109+
{
110+
"color": [
111+
0.13333334028720856,
112+
1.0,
113+
0.0,
114+
1.0
115+
],
116+
"id": "NT:Telemetry/arm/Arm Hardware Loggables/Pivot Motor Setpoint Angle (Radians)",
117+
"yAxis": 1
118+
},
119+
{
120+
"color": [
121+
0.0,
122+
0.3450980484485626,
123+
1.0,
124+
1.0
125+
],
126+
"id": "NT:Telemetry/arm/Arm Hardware Loggables/Pivot Motor Velocity (Radians Per Second)",
127+
"yAxis": 1
128+
}
129+
],
130+
"yaxis2": true
131+
}
132+
]
133+
}
134+
}
135+
}

src/main/java/org/frc6423/robot/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class Flags {
2727
@Deprecated public static final boolean debugMode = false;
2828

2929
/** When true, tunable entries will be added to NT for subsystems Should be false by default */
30-
public static final boolean TUNE_MODE = false;
30+
public static final boolean TUNE_MODE = true;
3131
}
3232

3333
/** Constants representing port IDs that devices are connected to */

src/main/java/org/frc6423/robot/Robot.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import edu.wpi.first.wpilibj2.command.button.CommandXboxController;
2626
import org.frc6423.lib.drivers.CommandRobot;
2727
import org.frc6423.robot.Constants.Flags;
28+
import org.frc6423.robot.subsystems.superstructure.arm.Arm;
29+
import org.frc6423.robot.subsystems.superstructure.arm.Arm.ArmAngle;
2830

2931
/**
3032
* Declares the structure of the robot program (subsystems, commands, triggers, etc.).
@@ -39,7 +41,7 @@ public class Robot extends CommandRobot {
3941
private final CommandXboxController operatorController = new CommandXboxController(1);
4042

4143
// * SUBSYSTEM INIT
42-
/** Init subsytems here */
44+
private final Arm arm = Arm.create();
4345

4446
// * ALERT INIT
4547
private final Alert batteryBrownout = new Alert("Battery voltage output low", AlertType.kWarning);
@@ -91,7 +93,6 @@ public Robot() {
9193

9294
// Update drive dashboard periodically
9395
addPeriodic(this::updateDashboard, 0.02);
94-
9596
configureGameBehavior();
9697
configureBindings();
9798
}
@@ -111,10 +112,15 @@ private void updateDashboard() {
111112
}
112113

113114
/** Configure behavior during different match sections */
114-
private void configureGameBehavior() {}
115+
private void configureGameBehavior() {
116+
arm.setDefaultCommand(arm.runAngle(ArmAngle.STOWED));
117+
}
115118

116119
/** Configure all Driver & Operator controller bindings */
117-
private void configureBindings() {}
120+
private void configureBindings() {
121+
driverController.a().whileTrue(arm.runAngle(ArmAngle.L4));
122+
driverController.b().whileTrue(arm.runAngle(ArmAngle.L3));
123+
}
118124

119125
@Override
120126
protected Command getAutonCommand() {

0 commit comments

Comments
 (0)