added spark configs to all subsystems, fixed a few formatting inconsistencies, added a TODO
This commit is contained in:
parent
9ab7ffad84
commit
dff4d0e04f
@ -69,7 +69,7 @@ public class ArmConstants {
|
||||
|
||||
static {
|
||||
canCoderConfig.MagnetSensor.SensorDirection = SensorDirectionValue.CounterClockwise_Positive;
|
||||
canCoderConfig.MagnetSensor.MagnetOffset = 0.0;
|
||||
canCoderConfig.MagnetSensor.MagnetOffset = kMagnetOffset;
|
||||
// TODO Need to do more reading on this setting, and how to properly offset the Arm so that horizontal is 0
|
||||
//canCoderConfig.MagnetSensor.AbsoluteSensorDiscontinuityPoint = 0.5;
|
||||
|
||||
|
@ -1,5 +1,7 @@
|
||||
package frc.robot.constants;
|
||||
|
||||
import com.revrobotics.spark.config.SparkMaxConfig;
|
||||
|
||||
public class ClimberPivotConstants {
|
||||
public static final int kPivotMotorID = 0;
|
||||
|
||||
@ -12,4 +14,6 @@ public class ClimberPivotConstants {
|
||||
public static final double kPIDControllerD = 0;
|
||||
|
||||
public static final double kClimberClimbPosition = 0;
|
||||
|
||||
public static final SparkMaxConfig motorConfig = new SparkMaxConfig();
|
||||
}
|
||||
|
@ -1,5 +1,9 @@
|
||||
package frc.robot.constants;
|
||||
|
||||
import com.revrobotics.spark.config.SparkMaxConfig;
|
||||
|
||||
public class ClimberRollersConstants {
|
||||
public static final int kRollerMotorID = 0;
|
||||
|
||||
public static final SparkMaxConfig motorConfig = new SparkMaxConfig();
|
||||
}
|
||||
|
@ -1,7 +1,11 @@
|
||||
package frc.robot.constants;
|
||||
|
||||
import com.revrobotics.spark.config.SparkMaxConfig;
|
||||
|
||||
public class ManipulatorConstants {
|
||||
public static final int kManipulatorMotorID = 0;
|
||||
public static final int kCoralBeamBreakID = 0;
|
||||
public static final int kAlgaeBeamBreakID = 0;
|
||||
|
||||
public static final SparkMaxConfig motorConfig = new SparkMaxConfig();
|
||||
}
|
||||
|
@ -32,7 +32,11 @@ public class Arm extends SubsystemBase {
|
||||
MotorType.kBrushless
|
||||
);
|
||||
|
||||
armMotor.configure(ArmConstants.motorConfig, ResetMode.kResetSafeParameters, PersistMode.kPersistParameters);
|
||||
armMotor.configure(
|
||||
ArmConstants.motorConfig,
|
||||
ResetMode.kResetSafeParameters,
|
||||
PersistMode.kPersistParameters
|
||||
);
|
||||
|
||||
positionController = new PIDController(
|
||||
ArmConstants.kPositionalP,
|
||||
|
@ -2,6 +2,8 @@ package frc.robot.subsystems;
|
||||
|
||||
import com.revrobotics.RelativeEncoder;
|
||||
import com.revrobotics.spark.SparkMax;
|
||||
import com.revrobotics.spark.SparkBase.PersistMode;
|
||||
import com.revrobotics.spark.SparkBase.ResetMode;
|
||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
@ -22,6 +24,12 @@ public class ClimberPivot extends SubsystemBase {
|
||||
MotorType.kBrushless
|
||||
);
|
||||
|
||||
pivotMotor.configure(
|
||||
ClimberPivotConstants.motorConfig,
|
||||
ResetMode.kResetSafeParameters,
|
||||
PersistMode.kPersistParameters
|
||||
);
|
||||
|
||||
neoEncoder = pivotMotor.getEncoder();
|
||||
|
||||
cageLimitSwitch = new DigitalInput(ClimberPivotConstants.kClimberLimitSwitchID);
|
||||
|
@ -1,12 +1,15 @@
|
||||
package frc.robot.subsystems;
|
||||
|
||||
import com.revrobotics.spark.SparkMax;
|
||||
import com.revrobotics.spark.SparkBase.PersistMode;
|
||||
import com.revrobotics.spark.SparkBase.ResetMode;
|
||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.wpilibj2.command.Command;
|
||||
import edu.wpi.first.wpilibj2.command.SubsystemBase;
|
||||
import frc.robot.constants.ClimberRollersConstants;
|
||||
|
||||
//TODO Figure out a way to detect if we're at the top of the cage
|
||||
public class ClimberRollers extends SubsystemBase {
|
||||
private SparkMax rollerMotor;
|
||||
|
||||
@ -15,6 +18,12 @@ public class ClimberRollers extends SubsystemBase {
|
||||
ClimberRollersConstants.kRollerMotorID,
|
||||
MotorType.kBrushless
|
||||
);
|
||||
|
||||
rollerMotor.configure(
|
||||
ClimberRollersConstants.motorConfig,
|
||||
ResetMode.kResetSafeParameters,
|
||||
PersistMode.kPersistParameters
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3,6 +3,8 @@ package frc.robot.subsystems;
|
||||
import java.util.function.DoubleSupplier;
|
||||
|
||||
import com.revrobotics.spark.SparkMax;
|
||||
import com.revrobotics.spark.SparkBase.PersistMode;
|
||||
import com.revrobotics.spark.SparkBase.ResetMode;
|
||||
import com.revrobotics.spark.SparkLowLevel.MotorType;
|
||||
|
||||
import edu.wpi.first.wpilibj.DigitalInput;
|
||||
@ -22,6 +24,12 @@ public class Manipulator extends SubsystemBase {
|
||||
MotorType.kBrushless
|
||||
);
|
||||
|
||||
manipulatorMotor.configure(
|
||||
ManipulatorConstants.motorConfig,
|
||||
ResetMode.kResetSafeParameters,
|
||||
PersistMode.kPersistParameters
|
||||
);
|
||||
|
||||
coralBeamBreak = new DigitalInput(ManipulatorConstants.kCoralBeamBreakID);
|
||||
algaeBeamBreak = new DigitalInput(ManipulatorConstants.kAlgaeBeamBreakID);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user