Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
dlpond917 committed Feb 19, 2024
2 parents 13ac990 + f110271 commit a809a3c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
10 changes: 9 additions & 1 deletion src/main/java/org/codeorange/frc2024/robot/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public enum ElevatorPosition {
}
}

public static final double ELEVATOR_INCHES_PER_ROTATION = 0.25*22*12/60; //12:60 gears attached to 22 tooth sprocket on #25 chain with 0.25 inch pitch
public static final double ELEVATOR_LOWER_LIMIT_INCHES = 0;
public static final double ELEVATOR_UPPER_LIMIT_INCHES = 20;
public static final double CLIMBER_LOWER_LIMIT_ROTATIONS = 0;
Expand Down Expand Up @@ -198,8 +197,12 @@ public enum ElevatorPosition {
public static final double ARM_P = isPrototype() ? 100 : 0;
public static final double ARM_I = isPrototype() ? 0 : 0;
public static final double ARM_D = isPrototype() ? 5 : 0;
public static final double ARM_RTS = isPrototype() ? 144.0 : 60.0 * 3;
public static final double ARM_STM = isPrototype() ? 1.0 : 3.0;

public static final double ELEVATOR_P = isPrototype() ? 1 : 0;
public static final double ELEVATOR_INCHES_PER_ROTATION = isPrototype() ? 0.25*22*12/60 : 30*2 * 8.0 / 72.0 / 25.4; //12:60 gears attached to 22 tooth sprocket on #25 chain with 0.25 inch pitch


public static final double CLIMBER_P = isPrototype() ? 0 : 0;
public static final double CLIMBER_I = isPrototype() ? 0 : 0;
Expand All @@ -208,9 +211,14 @@ public enum ElevatorPosition {
public static final double SHOOTER_P = isPrototype() ? 2 : 0;
public static final double SHOOTER_I = isPrototype() ? 0 : 0;
public static final double SHOOTER_D = isPrototype() ? 0 : 0;
public static final double SHOOTER_STM = isPrototype() ? 1 : 0.5;

public static final double WRIST_P = isPrototype() ? 10 : 0;
public static final double WRIST_I = isPrototype() ? 0 : 0;
public static final double WRIST_D = isPrototype() ? 0 : 0;
public static final double WRIST_RTS = isPrototype() ? 81.0 : 25.0;
public static final double WRIST_STM = isPrototype() ? 1.0 : 5.0;



public static final int STEER_MOTOR_CURRENT_LIMIT = 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public ArmIOTalonFX() {
var armFeedBackConfigs = talonFXConfigs.Feedback;
armFeedBackConfigs.FeedbackRemoteSensorID = absoluteEncoder.getDeviceID();
armFeedBackConfigs.FeedbackSensorSource = FeedbackSensorSourceValue.FusedCANcoder;
armFeedBackConfigs.SensorToMechanismRatio = 1.0;
armFeedBackConfigs.RotorToSensorRatio = 144.0;
armFeedBackConfigs.SensorToMechanismRatio = ARM_STM;
armFeedBackConfigs.RotorToSensorRatio = ARM_RTS;

var armMotionMagicConfig = talonFXConfigs.MotionMagic;
armMotionMagicConfig.MotionMagicCruiseVelocity = 0.2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.ctre.phoenix6.controls.VelocityVoltage;
import com.ctre.phoenix6.controls.VoltageOut;
import com.ctre.phoenix6.hardware.TalonFX;
import com.ctre.phoenix6.signals.FeedbackSensorSourceValue;
import com.ctre.phoenix6.signals.InvertedValue;
import com.ctre.phoenix6.signals.NeutralModeValue;
import edu.wpi.first.math.controller.SimpleMotorFeedforward;
Expand Down Expand Up @@ -45,6 +46,8 @@ public ShooterIOTalonFX() {
config.Slot0.kD = SHOOTER_D;
config.Slot0.kS = 0;
config.Slot0.kV = 0;
config.Feedback.FeedbackSensorSource = FeedbackSensorSourceValue.RotorSensor;
config.Feedback.SensorToMechanismRatio = SHOOTER_STM;
leader.getConfigurator().apply(config);
follower.getConfigurator().apply(config);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public WristIOTalonFX() {
wristFeedBackConfigs.FeedbackRemoteSensorID = absoluteEncoder.getDeviceID();
wristFeedBackConfigs.FeedbackSensorSource = FeedbackSensorSourceValue.FusedCANcoder;
//ask amber about below
wristFeedBackConfigs.SensorToMechanismRatio = 1.0;
wristFeedBackConfigs.RotorToSensorRatio = 81.0;
wristFeedBackConfigs.SensorToMechanismRatio = WRIST_STM;
wristFeedBackConfigs.RotorToSensorRatio = WRIST_RTS;

MotionMagicConfigs wristMotionMagicConfig = configs.MotionMagic;
wristMotionMagicConfig.MotionMagicCruiseVelocity = 1;
Expand Down

0 comments on commit a809a3c

Please sign in to comment.