-
Notifications
You must be signed in to change notification settings - Fork 1
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
61930db
commit 6118497
Showing
8 changed files
with
103 additions
and
51 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package frc.robot.commands.swerve; | ||
|
||
import com.pathplanner.lib.auto.AutoBuilder; | ||
import com.pathplanner.lib.path.PathConstraints; | ||
|
||
import edu.wpi.first.math.geometry.Pose2d; | ||
import edu.wpi.first.math.geometry.Rotation2d; | ||
import edu.wpi.first.math.util.Units; | ||
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard; | ||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.swerve.SwerveSubsystem; | ||
|
||
public class AlignCommand { | ||
|
||
public AlignCommand(){ | ||
|
||
|
||
} | ||
|
||
static public Command getAlignCommand(Pose2d targetPose, SwerveSubsystem swerveSubsystem){ | ||
Command command = AutoBuilder.pathfindToPose( | ||
targetPose, | ||
new PathConstraints( | ||
2.0, 2.0, | ||
Units.degreesToRadians(720), Units.degreesToRadians(1080) | ||
), | ||
0, | ||
0.0 | ||
); | ||
|
||
command.addRequirements(swerveSubsystem); | ||
|
||
return command; | ||
} | ||
|
||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/frc/robot/commands/swerve/SwerveStopCommand.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,21 @@ | ||
package frc.robot.commands.swerve; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.swerve.SwerveSubsystem; | ||
|
||
public class SwerveStopCommand extends Command { | ||
SwerveSubsystem swerveSubsystem; | ||
|
||
public SwerveStopCommand(SwerveSubsystem swerveSubsystem){ | ||
addRequirements(swerveSubsystem); | ||
this.swerveSubsystem = swerveSubsystem; | ||
} | ||
|
||
public void initialize() { | ||
swerveSubsystem.setDrivePowers(0, 0, 0); | ||
} | ||
|
||
public boolean isFinished() { | ||
return true; | ||
} | ||
} |
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