Class QuestCommandRetryHandler
java.lang.Object
frc.alotobots.library.subsystems.vision.oculus.util.QuestCommandRetryHandler
Handler for retrying Quest commands with proper delays between attempts.
-
Constructor Summary
ConstructorsConstructorDescriptionQuestCommandRetryHandler
(IntegerPublisher questMosi) Creates a new command retry handler with default timing valuesQuestCommandRetryHandler
(IntegerPublisher questMosi, double commandDelaySeconds, double retryDelaySeconds) Creates a new command retry handler with custom timing values -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns whether a command is currently being executedvoid
startRetry
(int maxAttempts, int command, int expectedResponse, int clearCommand) Simplified method that allows skipping callbacksvoid
startRetry
(int maxAttempts, int command, int expectedResponse, int clearCommand, Runnable onSuccess, Runnable onFailure) Start a new command retry sequencevoid
update
(int currentResponse) Update method to be called in updateInputs
-
Constructor Details
-
QuestCommandRetryHandler
Creates a new command retry handler with default timing values- Parameters:
questMosi
- MOSI publisher for sending commands
-
QuestCommandRetryHandler
public QuestCommandRetryHandler(IntegerPublisher questMosi, double commandDelaySeconds, double retryDelaySeconds) Creates a new command retry handler with custom timing values- Parameters:
questMosi
- MOSI publisher for sending commandscommandDelaySeconds
- Delay between clear and command (seconds)retryDelaySeconds
- Delay between retry attempts (seconds)
-
-
Method Details
-
startRetry
public void startRetry(int maxAttempts, int command, int expectedResponse, int clearCommand, Runnable onSuccess, Runnable onFailure) Start a new command retry sequence -
startRetry
public void startRetry(int maxAttempts, int command, int expectedResponse, int clearCommand) Simplified method that allows skipping callbacks -
update
public void update(int currentResponse) Update method to be called in updateInputs- Parameters:
currentResponse
- Current response value
-
isCommandActive
public boolean isCommandActive()Returns whether a command is currently being executed
-