Package frc.robot.services.control
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 typeIO- The IO interface typeIN- The AutoLogged inputs type
- All Implemented Interfaces:
Monitored
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
FieldsModifier and TypeFieldDescriptionprotected final org.littletonrobotics.junction.networktables.LoggedDashboardChooser<P>Dashboard chooser for profiles.protected final INInputs object for logging and state.protected final IOIO interface for hardware interaction.Fields inherited from class frc.lib.service.BaseService
name -
Constructor Summary
ConstructorsConstructorDescriptionControlService(String serviceName, IO io, IN inputs, org.littletonrobotics.junction.networktables.LoggedDashboardChooser<P> chooser) Constructs a ControlService. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears all hardware faults and warnings associated with this subsystem.booleanReturns whether or not the subsystem is healthy.voidupdate()Logic to be executed in parallel.protected abstract voidupdateInputs(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
-
Field Details
-
chooser
protected final org.littletonrobotics.junction.networktables.LoggedDashboardChooser<P extends ControlProfile> chooserDashboard chooser for profiles. -
io
IO interface for hardware interaction. -
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:BaseServiceLogic to be executed in parallel. Marked 'abstract' so every child MUST implement it.- Specified by:
updatein classBaseService
-
updateInputs
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:MonitoredReturns whether or not the subsystem is healthy. -
clearFaults
public void clearFaults()Description copied from interface:MonitoredClears all hardware faults and warnings associated with this subsystem.- Specified by:
clearFaultsin interfaceMonitored
-