- -
- -

Class NAR_Robot2

-
-
java.lang.Object -
edu.wpi.first.wpilibj.RobotBase -
edu.wpi.first.wpilibj.IterativeRobotBase -
common.core.misc.NAR_Robot2
-
-
-
-
-
-
All Implemented Interfaces:
-
AutoCloseable
-
-
-
public class NAR_Robot2 -extends edu.wpi.first.wpilibj.IterativeRobotBase
-
TimedRobot implements the IterativeRobotBase robot program framework. - -

The TimedRobot class is intended to be subclassed by a user creating a robot program. - -

periodic() functions from the base class are called on an interval by a Notifier instance.

-
-
-
    - -
  • -
    -

    Field Summary

    -
    Fields
    -
    -
    Modifier and Type
    -
    Field
    -
    Description
    -
    static final double
    - -
    -
    Default loop period.
    -
    -
    -
    -
  • - -
  • -
    -

    Constructor Summary

    -
    Constructors
    -
    -
    Modifier
    -
    Constructor
    -
    Description
    -
    protected
    - -
    -
    Constructor for TimedRobot.
    -
    -
    protected
    -
    NAR_Robot2(double period)
    -
    -
    Constructor for TimedRobot.
    -
    -
    -
    -
  • - -
  • -
    -

    Method Summary

    -
    -
    -
    -
    -
    Modifier and Type
    -
    Method
    -
    Description
    -
    final void
    -
    addPeriodic(Runnable callback, - double periodSeconds)
    -
    -
    Add a callback to run at a specific period.
    -
    -
    final void
    -
    addPeriodic(Runnable callback, - double periodSeconds, - double offsetSeconds)
    -
    -
    Add a callback to run at a specific period with a starting time offset.
    -
    -
    void
    - -
     
    -
    void
    - -
    -
    Ends the main loop in startCompetition().
    -
    -
    void
    - -
    -
    Provide an alternate "main loop" via startCompetition().
    -
    -
    -
    -
    -
    -

    Methods inherited from class edu.wpi.first.wpilibj.IterativeRobotBase

    -autonomousExit, autonomousInit, autonomousPeriodic, disabledExit, disabledInit, disabledPeriodic, driverStationConnected, enableLiveWindowInTest, getPeriod, isLiveWindowEnabledInTest, loopFunc, robotInit, robotPeriodic, setNetworkTablesFlushEnabled, simulationInit, simulationPeriodic, teleopExit, teleopInit, teleopPeriodic, testExit, testInit, testPeriodic
    -
    -

    Methods inherited from class edu.wpi.first.wpilibj.RobotBase

    -getMainThreadId, getRuntimeType, isAutonomous, isAutonomousEnabled, isDisabled, isEnabled, isReal, isSimulation, isTeleop, isTeleopEnabled, isTest, isTestEnabled, startRobot, suppressExitWarning
    -
    -

    Methods inherited from class java.lang.Object

    -clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    -
    -
  • -
-
-
-
    - -
  • -
    -

    Field Details

    -
      -
    • -
      -

      kDefaultPeriod

      -
      public static final double kDefaultPeriod
      -
      Default loop period.
      -
      -
      See Also:
      -
      - -
      -
      -
      -
    • -
    -
    -
  • - -
  • -
    -

    Constructor Details

    -
      -
    • -
      -

      NAR_Robot2

      -
      protected NAR_Robot2()
      -
      Constructor for TimedRobot.
      -
      -
    • -
    • -
      -

      NAR_Robot2

      -
      protected NAR_Robot2(double period)
      -
      Constructor for TimedRobot.
      -
      -
      Parameters:
      -
      period - Period in seconds.
      -
      -
      -
    • -
    -
    -
  • - -
  • -
    -

    Method Details

    -
      -
    • -
      -

      close

      -
      public void close()
      -
      -
      Specified by:
      -
      close in interface AutoCloseable
      -
      Overrides:
      -
      close in class edu.wpi.first.wpilibj.RobotBase
      -
      -
      -
    • -
    • -
      -

      startCompetition

      -
      public void startCompetition()
      -
      Provide an alternate "main loop" via startCompetition().
      -
      -
      Specified by:
      -
      startCompetition in class edu.wpi.first.wpilibj.IterativeRobotBase
      -
      -
      -
    • -
    • -
      -

      endCompetition

      -
      public void endCompetition()
      -
      Ends the main loop in startCompetition().
      -
      -
      Specified by:
      -
      endCompetition in class edu.wpi.first.wpilibj.RobotBase
      -
      -
      -
    • -
    • -
      -

      addPeriodic

      -
      public final void addPeriodic(Runnable callback, - double periodSeconds)
      -
      Add a callback to run at a specific period. - -

      This is scheduled on TimedRobot's Notifier, so TimedRobot and the callback run - synchronously. Interactions between them are thread-safe.

      -
      -
      Parameters:
      -
      callback - The callback to run.
      -
      periodSeconds - The period at which to run the callback in seconds.
      -
      -
      -
    • -
    • -
      -

      addPeriodic

      -
      public final void addPeriodic(Runnable callback, - double periodSeconds, - double offsetSeconds)
      -
      Add a callback to run at a specific period with a starting time offset. - -

      This is scheduled on TimedRobot's Notifier, so TimedRobot and the callback run - synchronously. Interactions between them are thread-safe.

      -
      -
      Parameters:
      -
      callback - The callback to run.
      -
      periodSeconds - The period at which to run the callback in seconds.
      -
      offsetSeconds - The offset from the common starting time in seconds. This is useful for - scheduling a callback in a different timeslot relative to TimedRobot.
      -
      -
      -
    • -
    -
    -
  • -
-
- -