generated from Frc5572/Java-Template
-
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.
- Loading branch information
Showing
4 changed files
with
38 additions
and
8 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
23 changes: 19 additions & 4 deletions
23
src/main/java/frc/robot/subsystems/drive/DrivetrainReal.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 |
---|---|---|
@@ -1,26 +1,41 @@ | ||
package frc.robot.subsystems.drive; | ||
|
||
import edu.wpi.first.math.geometry.Rotation2d; | ||
import edu.wpi.first.wpilibj.motorcontrol.VictorSP; | ||
import frc.robot.Constants; | ||
|
||
/** | ||
* DrivetrainReal | ||
*/ | ||
public class DrivetrainReal implements DrivetrainIO { | ||
|
||
VictorSP FLMotor = new VictorSP(Constants.Motors.DriveTrainMotors.FLMOTOR); | ||
Check warning on line 11 in src/main/java/frc/robot/subsystems/drive/DrivetrainReal.java GitHub Actions / Linting
|
||
VictorSP FRMotor = new VictorSP(Constants.Motors.DriveTrainMotors.FRMOTOR); | ||
Check warning on line 12 in src/main/java/frc/robot/subsystems/drive/DrivetrainReal.java GitHub Actions / Linting
|
||
VictorSP BLMotor = new VictorSP(Constants.Motors.DriveTrainMotors.BLMOTOR); | ||
Check warning on line 13 in src/main/java/frc/robot/subsystems/drive/DrivetrainReal.java GitHub Actions / Linting
|
||
VictorSP BRMotor = new VictorSP(Constants.Motors.DriveTrainMotors.BRMOTOR); | ||
Check warning on line 14 in src/main/java/frc/robot/subsystems/drive/DrivetrainReal.java GitHub Actions / Linting
|
||
|
||
|
||
/** | ||
* Drivetrain Real | ||
*/ | ||
public DrivetrainReal() {} | ||
public DrivetrainReal() { | ||
FLMotor.addFollower(BLMotor); | ||
FRMotor.addFollower(BRMotor); | ||
|
||
FRMotor.setInverted(true); | ||
} | ||
|
||
|
||
@Override | ||
public void updateInputs(DrivetrainIOInputs inputs) { | ||
inputs.gyroYaw = Rotation2d.fromDegrees(0); | ||
|
||
} | ||
|
||
/** | ||
* Drive Voltage | ||
*/ | ||
public void setDriveVoltage(double lvolts, double rvolts) {} | ||
public void setDriveVoltage(double lvolts, double rvolts) { | ||
FRMotor.setVoltage(lvolts); | ||
FRMotor.setVoltage(rvolts); | ||
} | ||
|
||
} |