-
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.
create the commands for the arm & claw
- Loading branch information
Showing
7 changed files
with
141 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,30 @@ | ||
package frc.robot.subsystems.arm; | ||
|
||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import frc.robot.subsystems.arm.ArmIO.ArmInputs; | ||
|
||
public class Arm extends SubsystemBase { | ||
|
||
ArmIO io; | ||
ArmInputs inputs = new ArmInputs(); | ||
|
||
public Arm(ArmIO io) { | ||
this.io = io; | ||
} | ||
|
||
/** | ||
* @param position The position to set the arm to in degrees | ||
*/ | ||
public void setArmPosition(double position) { | ||
io.setArmPosition(position); | ||
} | ||
|
||
@Override | ||
public void periodic() { | ||
io.updateInputs(inputs); | ||
} | ||
|
||
public double getArmPosition() { | ||
return inputs.armPosition; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,31 @@ | ||
package frc.robot.subsystems.claw; | ||
|
||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
import frc.robot.subsystems.claw.ClawIO.ClawInputs; | ||
|
||
public class Claw extends SubsystemBase { | ||
|
||
ClawIO io; | ||
ClawInputs inputs = new ClawInputs(); | ||
|
||
public Claw(ClawIO io) { | ||
this.io = io; | ||
} | ||
|
||
public void setShooterVelocity(double leftVelocity, double rightVelocity) { | ||
io.setShooterVelocity(leftVelocity, rightVelocity); | ||
} | ||
|
||
public void setIntakeVelocity(double velocity) { | ||
io.setIntakeVelocity(velocity); | ||
} | ||
|
||
@Override | ||
public void periodic() { | ||
io.updateInputs(inputs); | ||
} | ||
|
||
public double getShooterVelocity() { | ||
return (inputs.shooterLeftVelocity + inputs.shooterRightVelocity) / 2; | ||
} | ||
} |
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