Class Subsystem

java.lang.Object
com.cdarobotics.cdalib.subsystems.Subsystem
Direct Known Subclasses:
CompoundSubsystem, DeviceSubsystem, NullSubsystem, ThreadedIMU

public abstract class Subsystem extends Object
A robot mechanism with a fixed lifecycle: init() once on OpMode init, start() once when the OpMode starts, update() every loop, and stop() once when it ends.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract void
    Called once when the OpMode initializes.
    abstract void
    Called repeatedly during the OpMode init phase, after init() and before start(), while the driver is still on the init screen.
    abstract void
    Called once when the OpMode starts (play pressed).
    abstract void
    Called once when the OpMode ends.
    abstract void
    Called every loop.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Subsystem

      public Subsystem()
  • Method Details

    • init

      public abstract void init()
      Called once when the OpMode initializes. Grab hardware and set starting state here.
    • init_loop

      public abstract void init_loop()
      Called repeatedly during the OpMode init phase, after init() and before start(), while the driver is still on the init screen. Use it for work that must keep running until play is pressed, such as reporting sensor readings or waiting on hardware.
    • start

      public abstract void start()
      Called once when the OpMode starts (play pressed).
    • update

      public abstract void update()
      Called every loop. Read inputs and drive the mechanism here.
    • stop

      public abstract void stop()
      Called once when the OpMode ends. Safe or release the mechanism here.