Team3256 / Offseason_Bot_2024

Robot code for the offseason version of final bot
Other
3 stars 1 forks source link

migrate intake beam break detection to Interrupts #43

Open realjoshuau opened 3 months ago

realjoshuau commented 3 months ago

JavaDoc: https://github.wpilib.org/allwpilib/docs/release/java/edu/wpi/first/wpilibj/AsynchronousInterrupt.html

it's pretty simple, instead of doing something like:

  public Command intakeIn() {
    return this.run(
// insert command body here
        .until(beambreak::isTriggered)
        .andThen(this.off());
  }


you would basically remove the .until and .andThen, and migrate the this.off() call to the callback of the AsyncInterrupt.

this should improve beam break perf, but remains to be seen.

linear[bot] commented 3 months ago

RCD-53 migrate intake beam break detection to Interrupts