@@ -162,8 +162,11 @@ def robotPeriodic(self):
162
162
This function gets called last in each mode.
163
163
You may use it for any code you need to run
164
164
during all modes of the robot (e.g NetworkTables updates)
165
+
166
+ The default implementation will update SmartDashboard and LiveWindow.
165
167
"""
166
- pass
168
+ wpilib .SmartDashboard .updateValues ()
169
+ wpilib .LiveWindow .updateValues ()
167
170
168
171
def onException (self , forceReport = False ):
169
172
'''
@@ -256,6 +259,7 @@ def autonomous(self):
256
259
257
260
self .__nt .putString ('mode' , 'auto' )
258
261
self .__nt .putBoolean ('is_ds_attached' , self .ds .isDSAttached ())
262
+ wpilib .LiveWindow .setEnabled (False )
259
263
260
264
self ._on_mode_enable_components ()
261
265
@@ -277,6 +281,7 @@ def disabled(self):
277
281
278
282
self .__nt .putString ('mode' , 'disabled' )
279
283
ds_attached = None
284
+ wpilib .LiveWindow .setEnabled (False )
280
285
281
286
delay = PreciseDelay (self .control_loop_wait_time )
282
287
@@ -314,6 +319,7 @@ def operatorControl(self):
314
319
# don't need to update this during teleop -- presumably will switch
315
320
# modes when ds is no longer attached
316
321
self .__nt .putBoolean ('is_ds_attached' , self .ds .isDSAttached ())
322
+ wpilib .LiveWindow .setEnabled (False )
317
323
318
324
delay = PreciseDelay (self .control_loop_wait_time )
319
325
@@ -345,10 +351,12 @@ def test(self):
345
351
346
352
self .__nt .putString ('mode' , 'test' )
347
353
self .__nt .putBoolean ('is_ds_attached' , self .ds .isDSAttached ())
354
+ wpilib .LiveWindow .setEnabled (True )
348
355
349
356
while self .isTest () and self .isEnabled ():
350
- wpilib .LiveWindow .run ()
351
- wpilib .Timer .delay (.01 )
357
+ self ._update_feedback ()
358
+ self .robotPeriodic ()
359
+ wpilib .Timer .delay (self .control_loop_wait_time )
352
360
353
361
def _on_mode_enable_components (self ):
354
362
# initialize things
0 commit comments