Class DeviceSubsystem

java.lang.Object
com.cdarobotics.cdalib.subsystems.Subsystem
com.cdarobotics.cdalib.subsystems.DeviceSubsystem

public abstract class DeviceSubsystem extends Subsystem
A Subsystem backed by a single Device. The device is refreshed automatically every loop via update(); subclasses implement the rest of the lifecycle (init/start/stop) and expose their own control methods on top of the device.
  • Field Details

    • device

      protected final Device device
      The wrapped device, refreshed every loop by update().
  • Constructor Details

    • DeviceSubsystem

      protected DeviceSubsystem(Device device)
      Creates a subsystem backed by the given device.
      Parameters:
      device - the device this subsystem wraps and refreshes each loop.
  • Method Details

    • update

      public void update()
      Description copied from class: Subsystem
      Called every loop. Read inputs and drive the mechanism here.
      Specified by:
      update in class Subsystem