Skip to content

Commit

Permalink
Task 2 Completion
Browse files Browse the repository at this point in the history
  • Loading branch information
Saanvi Korem committed Oct 23, 2024
1 parent fb914f1 commit cf773c5
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/main/java/frc/robot/subsystems/XRPDrivetrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,24 @@ public void arcadeDrive(double xaxisSpeed, double zaxisRotate) {
public static Command tankDriveCom(double leftSpeed, double rightSpeed){
return new FunctionalCommand(
() -> {
//
//start
RobotContainer.m_xrpDrivetrain.tankDrive(0,0);
RobotContainer.m_xrpDrivetrain.resetEncoders();
},
//action
() -> {
RobotContainer.m_xrpDrivetrain.tankDrive(leftSpeed, rightSpeed);
},
//stop
interrupted ->
RobotContainer.m_xrpDrivetrain.tankDrive(0, 0);

//boolean
() -> {
return false;
}
)
RobotContainer.m_xrpDrivetrain
);
}
//HINT:This is called a tank drive, maybe there is a function that can easily allow for it?
//HINT:To see all the functions that the drivetrain has, type "m_diffDrive." without the quotes and look at the options generated by auto complete.
Expand Down

0 comments on commit cf773c5

Please sign in to comment.