File tree 2 files changed +15
-4
lines changed
RobotDemo/src/org/usfirst/frc/team5518
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import com .ni .vision .NIVision ;
8
8
import com .ni .vision .NIVision .Image ;
9
+ import com .ni .vision .VisionException ;
9
10
10
11
import edu .wpi .first .wpilibj .CameraServer ;
11
12
@@ -20,10 +21,14 @@ public VisionTrack(String name) {
20
21
21
22
@ Override
22
23
public void initialize () {
23
- frame = NIVision .imaqCreateImage (NIVision .ImageType .IMAGE_RGB , 0 ); // create the image frame for cam
24
- session = NIVision .IMAQdxOpenCamera ("cam0" ,
25
- NIVision .IMAQdxCameraControlMode .CameraControlModeController ); // get reference to camera
26
- NIVision .IMAQdxConfigureGrab (session ); // grab current streaming session
24
+ try {
25
+ frame = NIVision .imaqCreateImage (NIVision .ImageType .IMAGE_RGB , 0 ); // create the image frame for cam
26
+ session = NIVision .IMAQdxOpenCamera ("cam0" ,
27
+ NIVision .IMAQdxCameraControlMode .CameraControlModeController ); // get reference to camera
28
+ NIVision .IMAQdxConfigureGrab (session ); // grab current streaming session
29
+ } catch (VisionException e ) {
30
+ e .printStackTrace ();
31
+ }
27
32
}
28
33
29
34
@ Override
Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ public void robotInit() {
67
67
new AutonomousChooser (3 ));
68
68
autoChooser .addObject ("Autonomous 4: Pull w/ Hill" ,
69
69
new AutonomousChooser (4 ));
70
+ autoChooser .addObject ("Autonomous 0: Do Nothing" ,
71
+ new AutonomousChooser (0 ));
70
72
SmartDashboard .putData ("Autonomous Chooser" , autoChooser );
71
73
72
74
armElevator .initialize ();
@@ -106,6 +108,8 @@ public void autonomousInit() {
106
108
autonomous_number = ((AutonomousChooser ) autoChooser .getSelected ()).getNumber ();
107
109
108
110
switch (autonomous_number ) {
111
+ case 0 :
112
+ break ;
109
113
case 1 :
110
114
case 3 :
111
115
autonomousSetup (false );
@@ -126,6 +130,8 @@ public void autonomousPeriodic() {
126
130
double seconds = Timer .getFPGATimestamp ();
127
131
128
132
switch (autonomous_number ) {
133
+ case 0 :
134
+ break ;
129
135
case 1 :
130
136
autonomousPush (seconds , 2.0 );
131
137
break ;
You can’t perform that action at this time.
0 commit comments