Skip to content

Commit

Permalink
added falcon config for collector motor
Browse files Browse the repository at this point in the history
  • Loading branch information
Meh243 committed Jan 12, 2024
1 parent 7c8e85b commit 452e83f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/java/frc/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.ctre.phoenix6.mechanisms.swerve.SwerveModuleConstants;
import com.ctre.phoenix6.mechanisms.swerve.SwerveModuleConstants.SteerFeedbackType;
import com.ctre.phoenix6.mechanisms.swerve.SwerveModuleConstantsFactory;
import com.ctre.phoenix6.signals.NeutralModeValue;
import edu.wpi.first.math.geometry.Translation2d;
import edu.wpi.first.math.util.Units;
import frc.robot.Constants.RobotMap.CAN;
Expand Down Expand Up @@ -156,4 +157,11 @@ public class VisionConstants {
public static final Translation2d FIELD_LIMIT = new Translation2d(Units.feetToMeters(54.0), Units.feetToMeters(26.0));
public static final Translation2d VISION_LIMIT = new Translation2d(Units.feetToMeters(9), Units.feetToMeters(5));
}

public class CollectorConstants {
public static final boolean COLLECTOR_MOTOR_INVERTED = false;
public static final int COLLECTOR_MOTOR_SUPPLY_CURRENT_LIMIT = 0; // TODO: make sure they are not set to 0
public static final int COLLECTOR_MOTOR_STATOR_CURRENT_LIMIT = 0;
public static final NeutralModeValue COLLECTOR_MOTOR_NEUTRAL_MODE = NeutralModeValue.Coast;
}
}
6 changes: 5 additions & 1 deletion src/main/java/frc/robot/subsystems/Collector.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
package frc.robot.subsystems;

import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.signals.NeutralModeValue;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import frc.robot.Constants.RobotMap;
import frc.robot.Constants.RobotMap.CAN;
import frc.robot.Constants.CollectorConstants;
import frc.thunder.config.FalconConfig;

public class Collector extends SubsystemBase {

Expand All @@ -17,7 +21,7 @@ public class Collector extends SubsystemBase {

public Collector() {
// Initialize collector hardware
collectorMotor = new TalonFX(RobotMap.CAN.COLLECTOR_MOTOR);
collectorMotor = FalconConfig.createMotor(CAN.COLLECTOR_MOTOR, getName(), CollectorConstants.COLLECTOR_MOTOR_INVERTED, CollectorConstants.COLLECTOR_MOTOR_SUPPLY_CURRENT_LIMIT, CollectorConstants.COLLECTOR_MOTOR_STATOR_CURRENT_LIMIT, CollectorConstants.COLLECTOR_MOTOR_NEUTRAL_MODE);
collectorEntryBeamBreak = new DigitalInput(RobotMap.COLLECTOR_ENTRY_BEAMBREAK);
}

Expand Down

0 comments on commit 452e83f

Please sign in to comment.