-
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.
Merge remote-tracking branch 'origin/dev-2' into feat/elevator-2
Fixed some merge conflicts
- Loading branch information
Showing
8 changed files
with
277 additions
and
126 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// 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.wpilibj2.command.SequentialCommandGroup; | ||
import frc.robot.subsystems.WristSubsystem; | ||
|
||
public class SequentialCommands extends SequentialCommandGroup { | ||
/** Creates a new TestCommand. */ | ||
public SequentialCommands(WristSubsystem wristSubsystem) { | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
addCommands( | ||
new WristCommand(wristSubsystem, 0), | ||
new WristCommand(wristSubsystem, 20), | ||
new WristCommand(wristSubsystem, 40)); | ||
} | ||
|
||
// // Called when the command is initially scheduled. | ||
// @Override | ||
// public void initialize() {} | ||
|
||
// // Called every time the scheduler runs while the command is scheduled. | ||
// @Override | ||
// public void execute() {} | ||
|
||
// // Called once the command ends or is interrupted. | ||
// @Override | ||
// public void end(boolean interrupted) {} | ||
|
||
// // Returns true when the command should end. | ||
// @Override | ||
// public boolean isFinished() { | ||
// return false; | ||
// } | ||
} |
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,44 @@ | ||
// 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.wpilibj2.command.CommandBase; | ||
import frc.robot.subsystems.WristSubsystem; | ||
|
||
public class WristCommand extends CommandBase { | ||
/** Creates a new WristCommand. */ | ||
private final WristSubsystem wristSubsystem; | ||
|
||
private double targetAngle; | ||
|
||
public WristCommand(WristSubsystem wristSubsystem, double targetAngle) { | ||
// Use addRequirements() here to declare subsystem dependencies. | ||
this.wristSubsystem = wristSubsystem; | ||
this.targetAngle = targetAngle; | ||
|
||
addRequirements(wristSubsystem); | ||
} | ||
|
||
// Called when the command is initially scheduled. | ||
@Override | ||
public void initialize() { | ||
// sets target angle | ||
wristSubsystem.setTargetAngle(targetAngle); | ||
} | ||
|
||
// Called every time the scheduler runs while the command is scheduled. | ||
@Override | ||
public void execute() {} | ||
|
||
// Called once the command ends or is interrupted. | ||
@Override | ||
public void end(boolean interrupted) {} | ||
|
||
// Returns true when the command should end. | ||
@Override | ||
public boolean isFinished() { | ||
return wristSubsystem.nearTargetAngle(); | ||
} | ||
} |
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
Oops, something went wrong.