AdvantageKit icon indicating copy to clipboard operation
AdvantageKit copied to clipboard

Add an API method to know when a replay is being watched

Open Baconing opened this issue 9 months ago • 1 comments

Is your feature request related to a problem? Please describe. When writing code for the robot state, you have to manually change between simulation and replay (as far as I'm aware). You can easily automate switching between a simulated and real bot using Robot.isReal(), however no proper solution exists for AdvantageKit.

Describe the solution you'd like An API method that can detect when a replay is being ran, that way an end user can easily automate state changes.

Describe alternatives you've considered

  • Java System Property (e.g. -Dakit.mode=REPLAY or similar)
  • Environment Variable (e.g. AKIT_REPLAY=true or similar)

These both work fine, and would also be good solutions, however the API method is the most versatile in my opinion.

Additional context Update any documentation when it's added for other teams.

I could implement this myself in a PR if needed.

Baconing avatar Feb 27 '25 13:02 Baconing

I believe this is already implemented with Logger#hasReplaySource(). Is there a difference between what that method does and what you are proposing?

blaze-developer avatar Mar 31 '25 16:03 blaze-developer