-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Renamed scoring commands for coral manipulators
- Loading branch information
1 parent
dddb9ef
commit 08d348f
Showing
4 changed files
with
41 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,51 @@ | ||
package frc.robot.subsystems; | ||
|
||
import static edu.wpi.first.wpilibj2.command.Commands.waitSeconds; | ||
|
||
import com.chopshop166.chopshoplib.logging.LoggedSubsystem; | ||
|
||
import frc.robot.maps.subsystems.CoralManipMap; | ||
import frc.robot.maps.subsystems.CoralManipMap.Data; | ||
import frc.robot.maps.subsystems.OuttakeMap; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
|
||
public class CoralManip extends LoggedSubsystem<Data, CoralManipMap> { | ||
|
||
private final double RELEASE_SPEEDRIGHT = 0.3; | ||
private final double RELEASE_SPEEDLEFT = 0.1; | ||
private final double INTAKE_SPEED = 0.3; | ||
private final double RELEASE_DELAY = 1; | ||
private final double DELAY = 0.0; | ||
|
||
public CoralManip(CoralManipMap coralManipMap) { | ||
super(new Data(), coralManipMap); | ||
} | ||
|
||
public Command scoreL1() { | ||
return run(() -> { | ||
getData().leftMotor.setpoint = RELEASE_SPEEDLEFT; | ||
getData().rightMotor.setpoint = RELEASE_SPEEDRIGHT; | ||
}).until(() -> !getData().gamePieceDetected).andThen(waitSeconds(RELEASE_DELAY), safeStateCmd()); | ||
} | ||
|
||
public Command score() { | ||
return run(() -> { | ||
getData().leftMotor.setpoint = RELEASE_SPEEDRIGHT; | ||
getData().rightMotor.setpoint = RELEASE_SPEEDRIGHT; | ||
}).until(() -> !getData().gamePieceDetected).andThen(waitSeconds(RELEASE_DELAY), safeStateCmd()); | ||
} | ||
|
||
public Command intake() { | ||
return run(() -> { | ||
getData().leftMotor.setpoint = INTAKE_SPEED; | ||
getData().rightMotor.setpoint = INTAKE_SPEED; | ||
}).until(() -> getData().gamePieceDetected).andThen(safeStateCmd()); | ||
} | ||
|
||
@Override | ||
public void safeState() { | ||
// no safe state to set | ||
getData().leftMotor.setpoint = 0; | ||
getData().rightMotor.setpoint = 0; | ||
} | ||
|
||
} |
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