Skip to content

Commit

Permalink
add motors to shooter subsystem
Browse files Browse the repository at this point in the history
  • Loading branch information
cuttestkittensrule committed Jan 25, 2024
1 parent c55756a commit 6216815
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,6 @@ public void set(ControlMode controlMode, double demand, double feedForward) {
case MOTION_MAGIC:
demand = Units2813.motorRevsToTicks(demand, 2048);
break;
case DUTY_CYCLE:
break;
default:
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public static class MotorSubsystemConfiguration {
* The default starting position if one is not defined
*/
public static final double DEFAULT_STARTING_POSITION = 0.0;
private Motor motor;
private Encoder encoder;
protected Motor motor;
protected Encoder encoder;
private PIDController controller;
private double acceptableError;
private double startingPosition;
Expand Down
3 changes: 2 additions & 1 deletion Robot2024/src/main/java/com/team2813/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ public static class DriverConstants {
//Mechanism CAN IDs
public static final int INTAKE = 14;
public static final int KICKER = 15;
public static final int SHOOTER = 16;
public static final int SHOOTER_1 = 16;
public static final int SHOOTER_2 = -1;
public static final int SHOOTER_PIVOT= 17;
public static final int SHOOTER_ENCODER = 18;
public static final int CLIMBER = 19;
Expand Down
11 changes: 10 additions & 1 deletion Robot2024/src/main/java/com/team2813/subsystems/Shooter.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
package com.team2813.subsystems;

import com.team2813.lib2813.control.Motor;
import com.team2813.lib2813.control.motors.TalonFXWrapper;
import com.team2813.lib2813.subsystems.MotorSubsystem;
import static com.team2813.Constants.*;

import com.ctre.phoenix.motorcontrol.FollowerType;
import com.ctre.phoenix.motorcontrol.TalonFXInvertType;

public class Shooter extends MotorSubsystem<Shooter.Angle> {
Motor shooterMotor;
public Shooter() {
// TODO: fix invert type
super(new MotorSubsystemConfiguration(new TalonFXWrapper(0, TalonFXInvertType.Clockwise)));
super(new MotorSubsystemConfiguration(
new TalonFXWrapper(SHOOTER_PIVOT, TalonFXInvertType.Clockwise),
null //TODO: write encoder class (embarassing wow)
));
TalonFXWrapper m = new TalonFXWrapper(SHOOTER_1, TalonFXInvertType.Clockwise);
m.addFollower(SHOOTER_2, TalonFXInvertType.OpposeMaster);
shooterMotor = m;
}
public static enum Angle implements MotorSubsystem.Position {
TEST(0.0);
Expand Down

0 comments on commit 6216815

Please sign in to comment.