-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
detect block, intake until speci, claw intake power, and teleop action
- Loading branch information
Showing
8 changed files
with
115 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/commands/auton/ClawIntakePower.java
This file was deleted.
Oops, something went wrong.
4 changes: 0 additions & 4 deletions
4
...Code/src/main/java/org/firstinspires/ftc/teamcode/commands/auton/IntakeUntilSpecimen.java
This file was deleted.
Oops, something went wrong.
25 changes: 25 additions & 0 deletions
25
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/commands/claw/ClawIntakePower.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.firstinspires.ftc.teamcode.commands.claw; | ||
|
||
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry; | ||
import com.arcrobotics.ftclib.command.CommandBase; | ||
|
||
import org.firstinspires.ftc.teamcode.subsystems.Claw; | ||
|
||
public class ClawIntakePower extends CommandBase { | ||
private final MultipleTelemetry telemetry; | ||
private final Claw claw; | ||
private final double power; | ||
|
||
public ClawIntakePower(final MultipleTelemetry telemetry, final Claw claw, final double power) { | ||
this.telemetry = telemetry; | ||
this.power = power; | ||
this.claw = claw; | ||
|
||
super.addRequirements(claw); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
this.claw.setClawPower(power); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
TeamCode/src/main/java/org/firstinspires/ftc/teamcode/commands/claw/IntakeUntilSpecimen.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.firstinspires.ftc.teamcode.commands.claw; | ||
|
||
import com.acmerobotics.dashboard.telemetry.MultipleTelemetry; | ||
import com.arcrobotics.ftclib.command.CommandBase; | ||
import com.qualcomm.robotcore.util.ElapsedTime; | ||
|
||
import org.firstinspires.ftc.teamcode.subsystems.Claw; | ||
|
||
public class IntakeUntilSpecimen extends CommandBase { | ||
private final MultipleTelemetry telemetry; | ||
private final Claw claw; | ||
private final Claw.Color color; | ||
private final int duration; | ||
private final ElapsedTime timer; | ||
|
||
public IntakeUntilSpecimen(final MultipleTelemetry telemetry, final Claw claw, final Claw.Color color, final int duration) { | ||
this.telemetry = telemetry; | ||
this.claw = claw; | ||
this.color = color; | ||
this.duration = duration; | ||
this.timer = new ElapsedTime(); | ||
|
||
super.addRequirements(claw); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
this.claw.setClawPower(1); | ||
this.timer.reset(); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return this.claw.hasValidBlock(color) != Claw.BlockCases.WAIT || this.timer.seconds() >= duration; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters