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 24, 2024
1 parent cf773c5 commit e8ba8ba
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/main/java/frc/robot/subsystems/XRPDrivetrain.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,27 +46,8 @@ public void arcadeDrive(double xaxisSpeed, double zaxisRotate) {
}

//TODO:Task 2-Write a function that makes the robot take in a left wheel speed and a right wheel speed, and move at those speeds.
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
);
public static Command SpeedCommand(double leftSpeed, double rightSpeed){
m_diffDrive.tankDrive(leftSpeed, rightSpeed);
}
//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 e8ba8ba

Please sign in to comment.