This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from glowkate/main
Added a fake DriveTrainVariant and a constant to disable the DriveTrain.
- Loading branch information
Showing
4 changed files
with
106 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
97 changes: 97 additions & 0 deletions
97
src/main/java/ca/warp7/frc2022/subsystems/drivetrain/LazyDriveTrainVariant.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,97 @@ | ||
package ca.warp7.frc2022.subsystems.drivetrain; | ||
|
||
import ca.warp7.frc2022.lib.control.PID; | ||
|
||
|
||
/* | ||
This class is suppose to be a substitute for an instance of DriveTrainVariant. To the rest of the program, | ||
its a valid DriveTrainVariant, however it does not actually do anything. | ||
THIS CLASS IS NOT USED WHEN THE DRIVE TRAIN IS ENABLED, NONE OF THE METHODS DO ANYTHING OF USE. | ||
*/ | ||
public final class LazyDriveTrainVariant implements DriveTrainVariant { | ||
public LazyDriveTrainVariant() { | ||
} | ||
|
||
@Override | ||
public void setVelocityPID( | ||
double leftVelocityRotationsPerSecond, | ||
double rightVelocityRotationsPerSecond, | ||
double leftVoltage, | ||
double rightVoltage) { | ||
} | ||
|
||
@Override | ||
public void setPositionPID(double leftDistanceRotations, double rightDistanceRotations) { | ||
} | ||
|
||
@Override | ||
public void configurePID(PID pid) { | ||
} | ||
|
||
@Override | ||
public void configureRampRate(double secondsFromNeutralToFull) { | ||
} | ||
|
||
@Override | ||
public void setEncoderPosition(double leftRotations, double rightRotations) { | ||
} | ||
|
||
@Override | ||
public void setBrake() { | ||
} | ||
|
||
@Override | ||
public void setCoast() { | ||
} | ||
|
||
@Override | ||
public double getLeftPositionRotations() { | ||
return (0.0); | ||
} | ||
|
||
@Override | ||
public double getRightPositionRotations() { | ||
return (0.0); | ||
} | ||
|
||
@Override | ||
public double getLeftVelocityRPS() { | ||
return (0.0); | ||
} | ||
|
||
@Override | ||
public double getRightVelocityRPS() { | ||
return (0.0); | ||
} | ||
|
||
@Override | ||
public double getLeftVoltage() { | ||
return (0.0); | ||
} | ||
|
||
@Override | ||
public double getRightVoltage() { | ||
return (0.0); | ||
} | ||
|
||
@Override | ||
public void neutralOutput() { | ||
} | ||
|
||
@Override | ||
public void setPercentOutput(double leftPercent, double rightPercent) { | ||
} | ||
|
||
@Override | ||
public double getLeftPIDErrorRotations() { | ||
return(0.0); | ||
|
||
} | ||
|
||
@Override | ||
public double getRightPIDErrorRotations() { | ||
return(0.0); | ||
|
||
} | ||
} |