This repository has been archived by the owner on Jan 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
2e3ebca
commit a65ae8c
Showing
12 changed files
with
107 additions
and
183 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
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 |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package frc.robot.commands; | ||
|
||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
import edu.wpi.first.wpilibj2.command.CommandBase; | ||
import frc.robot.Constants; | ||
import frc.robot.Robot; | ||
import frc.robot.RobotContainer; | ||
import frc.robot.subsystems.Tank; | ||
|
||
public class InvertDriveCommand extends CommandBase { | ||
@SuppressWarnings({"PMD.UnusedPrivateField", "PMD.SingularField"}) | ||
private final Tank m_drivebase; | ||
private final RobotContainer robot; | ||
|
||
public InvertDriveCommand(Tank subsystem, RobotContainer robot) { | ||
m_drivebase = subsystem; | ||
this.robot = robot; | ||
|
||
addRequirements(m_drivebase); | ||
} | ||
|
||
@Override | ||
public void initialize() { | ||
RobotContainer.inverted = true; | ||
robot.initTeleop(); | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
// double check getMaxSpeed(), might be wrong | ||
m_drivebase.arcadeDrive( | ||
-RobotContainer.getDriverControllerLeftStickYAdjusted() * Constants.CanConstants.maxSpeed, | ||
RobotContainer.getDriverControllerRightStickXAdjusted() * 0.75); | ||
} | ||
|
||
@Override | ||
public void end(boolean interrupted) { | ||
m_drivebase.arcadeDrive(0, 0); | ||
RobotContainer.inverted = false; | ||
robot.initTeleop(); | ||
} | ||
|
||
@Override | ||
public boolean isFinished() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public boolean runsWhenDisabled() { | ||
return false; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.