Skip to content
Prev Previous commit
Next Next commit
Add a test action and command for an auto
  • Loading branch information
nihonjinrxs committed Jan 9, 2025
commit b163bf5044453969412b4ad215290d0d325eb94d
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package org.firstinspires.ftc.teamcode.actions;

import androidx.annotation.NonNull;

import com.acmerobotics.dashboard.telemetry.TelemetryPacket;
import com.acmerobotics.roadrunner.Action;

public class TestAutoAction implements Action {
private boolean initialized = false;

private int cycleCounter;

public boolean run(@NonNull TelemetryPacket packet) {
if (!this.initialized) {
this.initializeAction();
}

packet.put("TestAuto: cyclesLeft", this.cycleCounter);

this.cycleCounter--;

return this.cycleCounter <= 0;
}

private void initializeAction() {
this.cycleCounter = 5;
this.initialized = true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.firstinspires.ftc.teamcode.commands;

import com.arcrobotics.ftclib.command.Subsystem;

import org.firstinspires.ftc.teamcode.actions.TestAutoAction;
import org.firstinspires.ftc.teamcode.lib.ActionCommand;

import java.util.Set;

public class TestAuto extends ActionCommand<TestAutoAction> {
public TestAuto(TestAutoAction action, Set<Subsystem> requirements) {
super(action, requirements);
}
}