Class ControlService<P extends ControlProfile,IO,IN extends org.littletonrobotics.junction.inputs.LoggableInputs>

java.lang.Object
frc.lib.service.BaseService
frc.robot.services.control.ControlService<P,IO,IN>
Type Parameters:
P - The ControlProfile type
IO - The IO interface type
IN - The AutoLogged inputs type
All Implemented Interfaces:
Monitored
Direct Known Subclasses:
Driver, Operator

public abstract class ControlService<P extends ControlProfile,IO,IN extends org.littletonrobotics.junction.inputs.LoggableInputs> extends BaseService implements Monitored
Abstract base class for control services. Handles chooser logic, standardized logging, rumble hardware updates, and disconnect alerts.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected final org.littletonrobotics.junction.networktables.LoggedDashboardChooser<P>
    Dashboard chooser for profiles.
    protected final IN
    Inputs object for logging and state.
    protected final IO
    IO interface for hardware interaction.

    Fields inherited from class frc.lib.service.BaseService

    name
  • Constructor Summary

    Constructors
    Constructor
    Description
    ControlService(String serviceName, IO io, IN inputs, org.littletonrobotics.junction.networktables.LoggedDashboardChooser<P> chooser)
    Constructs a ControlService.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all hardware faults and warnings associated with this subsystem.
    boolean
    Returns whether or not the subsystem is healthy.
    void
    Logic to be executed in parallel.
    protected abstract void
    updateInputs(IO io, IN inputs, P profile)
    Subclasses must map the profile methods to the inputs object.

    Methods inherited from class frc.lib.service.BaseService

    getName

    Methods inherited from class java.lang.Object

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

    • chooser

      protected final org.littletonrobotics.junction.networktables.LoggedDashboardChooser<P extends ControlProfile> chooser
      Dashboard chooser for profiles.
    • io

      protected final IO io
      IO interface for hardware interaction.
    • inputs

      protected final IN extends org.littletonrobotics.junction.inputs.LoggableInputs inputs
      Inputs object for logging and state.
  • Constructor Details

    • ControlService

      public ControlService(String serviceName, IO io, IN inputs, org.littletonrobotics.junction.networktables.LoggedDashboardChooser<P> chooser)
      Constructs a ControlService.
      Parameters:
      serviceName - The name of the service.
      io - The IO interface for hardware interaction.
      inputs - The inputs object for logging and state.
      chooser - The dashboard chooser for profiles.
  • Method Details

    • update

      public void update()
      Description copied from class: BaseService
      Logic to be executed in parallel. Marked 'abstract' so every child MUST implement it.
      Specified by:
      update in class BaseService
    • updateInputs

      protected abstract void updateInputs(IO io, IN inputs, P profile)
      Subclasses must map the profile methods to the inputs object.
      Parameters:
      io - The IO interface for hardware interaction.
      inputs - The inputs object for logging and state.
      profile - The control profile.
    • isHealthy

      public boolean isHealthy()
      Description copied from interface: Monitored
      Returns whether or not the subsystem is healthy.
      Specified by:
      isHealthy in interface Monitored
      Returns:
      True if the subsystem is healthy, false otherwise.
    • clearFaults

      public void clearFaults()
      Description copied from interface: Monitored
      Clears all hardware faults and warnings associated with this subsystem.
      Specified by:
      clearFaults in interface Monitored