Created
February 8, 2016 18:27
-
-
Save ArchdukeTim/09a53e728896716512e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def initialize(self): | |
from autonomous import SimpleAutonomous | |
self.obstacles = { | |
'LowGoal': SimpleAutonomous.LowGoal(), | |
'A0': SimpleAutonomous.DirectPortcullis(), | |
'A1': SimpleAutonomous.ChevalDeFrise() | |
} | |
@state(first = True) | |
def main_autonomous(self, initial_call): | |
if initial_call: | |
self.obstacles['A1'].on_enable() | |
self.obstacles['A1'].on_iteration() | |
if self.obstacles['A1'].isFinished: | |
self.next_state('finished') | |
@state | |
def finished(self): | |
raise |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##THIS LINE BREAKS @timed_state(duration = 2, next_state='lower_arms', first = False if isinstance(self, ModularAutonomous.ModularAutonomous) else True) | |
def drive_to(self, initial_call): | |
if initial_call: | |
self.drive.reset_drive_encoders() | |
if self.drive.drive_distance(self.Drive_to_distance*12): | |
self.next_state('lower_arms') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment