-
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 pull request #15 from LakeEffectRobotics/intake
Intake
- Loading branch information
Showing
21 changed files
with
1,120 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
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,28 @@ | ||
// 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.Arm; | ||
import frc.robot.subsystems.Wrist; | ||
import frc.robot.subsystems.Arm.ArmExtension; | ||
import frc.robot.subsystems.Arm.ArmPosition; | ||
import frc.robot.subsystems.Wrist.WristPosition; | ||
|
||
// NOTE: Consider using this command inline, rather than writing a subclass. For more | ||
// information, see: | ||
// https://docs.wpilib.org/en/stable/docs/software/commandbased/convenience-features.html | ||
public class AmpCommandGroup extends SequentialCommandGroup { | ||
/** Creates a new IntakeCommandGroup. */ | ||
public AmpCommandGroup(Wrist wrist, Arm arm) { | ||
// Add your commands in the addCommands() call, e.g. | ||
// addCommands(new FooCommand(), new BarCommand()); | ||
addCommands(new WristCommand(wrist, WristPosition.UP), | ||
new RotateArmCommand(arm,ArmPosition.AMP), | ||
new ExtendArmCommand(arm, ArmExtension.RETRACT), | ||
new WristCommand(wrist, WristPosition.DOWN) | ||
); | ||
} | ||
} |
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; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.Claw; | ||
|
||
public class ClawCommand extends Command { | ||
|
||
Claw claw; | ||
double speed; | ||
|
||
public ClawCommand(Claw claw, double speed) { | ||
this.claw = claw; | ||
this.speed = speed; | ||
} | ||
|
||
@Override | ||
public void execute() { | ||
claw.setOutput(speed); | ||
} | ||
|
||
} |
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,41 @@ | ||
package frc.robot.commands; | ||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import frc.robot.subsystems.Arm; | ||
import frc.robot.subsystems.Arm.ArmExtension; | ||
|
||
public class ExtendArmCommand extends Command { | ||
Arm arm; | ||
ArmExtension extend; | ||
|
||
public ExtendArmCommand(Arm arm,Arm.ArmExtension extend) { | ||
this.arm = arm; | ||
this.extend = extend; | ||
|
||
|
||
} | ||
|
||
@Override | ||
public void initialize(){ | ||
if(extend == ArmExtension.EXTEND){ | ||
arm.extendArm(); | ||
}else{ | ||
arm.retractArm(); | ||
} | ||
} | ||
|
||
@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 arm.inPosition(); | ||
} | ||
} |
Oops, something went wrong.