コード例 #1
0
ファイル: robot.py プロジェクト: rzayevan/robotpy-wpilib
class MyRobot(wpilib.IterativeRobot):

    def robotInit(self):
        """
        This function is called upon program startup and
        should be used for any initialization code.
        """
        # Create operator interface
        self.oi = OI(self)
        # Create subsystems
        self.example_subsystem = ExampleSubsystem(self)
        #Create the command used for the autonomous period
        self.autonomous_command = ExampleCommand(self)

    def autonomousInit(self):
        #Schedule the autonomous command
        self.autonomous_command.start()

    def autonomousPeriodic(self):
        """This function is called periodically during autonomous."""
        command.Scheduler.getInstance().run()

    def teleopPeriodic(self):
        """This function is called periodically during operator control."""
        command.Scheduler.getInstance().run()

    def testPeriodic(self):
        """This function is called periodically during test mode."""
        wpilib.LiveWindow.run()
コード例 #2
0
ファイル: robot.py プロジェクト: rzayevan/robotpy-wpilib
 def robotInit(self):
     """
     This function is called upon program startup and
     should be used for any initialization code.
     """
     # Create operator interface
     self.oi = OI(self)
     # Create subsystems
     self.example_subsystem = ExampleSubsystem(self)
     #Create the command used for the autonomous period
     self.autonomous_command = ExampleCommand(self)
コード例 #3
0
ファイル: robot.py プロジェクト: DaPortlyJester/robot2016
 def robotInit(self):
     """
     This function is called upon program startup and
     should be used for any initialization code.
     """
     self.oi = None
     #Create the command used for the autonomous period
     self.autonomous_command = ExampleCommand(self)