-
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
284de37
commit bfb7814
Showing
5 changed files
with
102 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package frc.robot.subsystems.arm; | ||
|
||
import org.littletonrobotics.junction.AutoLog; | ||
|
||
public interface ArmIO { | ||
@AutoLog | ||
class ShooterIOInputs {} | ||
|
||
default void setShoulderVoltage(double voltage) {} | ||
|
||
default void setShoulderAngle(double degrees) {} | ||
|
||
default void setWristVoltage(double voltage) {} | ||
|
||
default void setWristAngle(double degrees) {} | ||
} |
31 changes: 31 additions & 0 deletions
31
src/main/java/frc/robot/subsystems/arm/ArmIOPrototype.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,31 @@ | ||
package frc.robot.subsystems.arm; | ||
|
||
import com.ctre.phoenix6.hardware.TalonFX; | ||
|
||
public class ArmIOPrototype implements ArmIO { | ||
private final TalonFX m_shoulder; | ||
private final TalonFX m_wrist; | ||
public ArmIOPrototype() { | ||
m_shoulder = new TalonFX(23); | ||
m_wrist = new TalonFX(24); | ||
|
||
} | ||
|
||
@Override | ||
public void setShoulderVoltage(double voltage){ | ||
m_shoulder.setVoltage(voltage); | ||
} | ||
|
||
@Override | ||
public void setShoulderAngle(double degrees){ | ||
} | ||
|
||
@Override | ||
public void setWristVoltage(double voltage){ | ||
m_wrist.setVoltage(voltage); | ||
} | ||
|
||
@Override | ||
public void setWristAngle(double degrees){ | ||
} | ||
} |
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 @@ | ||
package frc.robot.subsystems.arm; | ||
|
||
|
||
import edu.wpi.first.wpilibj2.command.Command; | ||
import edu.wpi.first.wpilibj2.command.SubsystemBase; | ||
|
||
public class ArmSubsystem extends SubsystemBase { | ||
private final ArmIO m_io; | ||
public ArmSubsystem(ArmIO io) { | ||
m_io = io; | ||
} | ||
|
||
public void setShoulderPower(double power){ | ||
m_io.setShoulderVoltage(power * 12.0); | ||
} | ||
public void setWristPower(double power){ | ||
m_io.setWristVoltage(power * 12); | ||
} | ||
|
||
public Command setShoulderPowerFactory(double power) { | ||
return runOnce(() -> setShoulderPower(power)); | ||
} | ||
|
||
public Command setWristPowerFactory(double power) { | ||
return runOnce(() -> setWristPower(power)); | ||
} | ||
} | ||
|