Skip to content

Commit

Permalink
changed some unit stuff and added conversions
Browse files Browse the repository at this point in the history
  • Loading branch information
Vignesh1234587 committed Dec 7, 2024
1 parent 8bf5693 commit 684dd24
Show file tree
Hide file tree
Showing 12 changed files with 494 additions and 169 deletions.
7 changes: 2 additions & 5 deletions src/main/java/frc/robot/subsystems/arms/PivotIOSim.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,10 @@

/** Add your docs here. */
public class PivotIOSim implements PivotIO {
<<<<<<< Updated upstream
=======
private final DCMotor pivotGearbox = DCMotor.getKrakenX60Foc(2);
// private final DCMotor pivotGearbox = DCMotor.getKrakenX60Foc(2);

public RobotContainer robotContainer = new RobotContainer();
// public RobotContainer robotContainer = new RobotContainer();

>>>>>>> Stashed changes

// SIM VARIABLES
private int gearBoxMotorCount = 2;
Expand Down
22 changes: 17 additions & 5 deletions src/main/java/frc/robot/subsystems/arms/PivotIOTalonFX.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
import com.ctre.phoenix6.signals.InvertedValue;
import com.ctre.phoenix6.signals.NeutralModeValue;

<<<<<<< Updated upstream
import frc.robot.constants.PhysicalConstants;
=======
import edu.wpi.first.units.measure.Angle;
import edu.wpi.first.units.measure.AngularVelocity;
import edu.wpi.first.units.measure.Current;
import edu.wpi.first.units.measure.Voltage;
import frc.robot.physicalConstants;
>>>>>>> Stashed changes
import frc.robot.util.Conversions;
import org.littletonrobotics.junction.Logger;

Expand All @@ -27,11 +35,11 @@ public class PivotIOTalonFX implements PivotIO {

private double startAngleDegs;

private final StatusSignal<Double> leaderPositionDegs;
private final StatusSignal<Double> velocityDegsPerSec;
private final StatusSignal<Double> appliedVolts;
private final StatusSignal<Double> currentAmps;
private final StatusSignal<Double> pitch;
private final StatusSignal<Angle> leaderPositionDegs;
private final StatusSignal<AngularVelocity> velocityDegsPerSec;
private final StatusSignal<Voltage> appliedVolts;
private final StatusSignal<Current> currentAmps;
private final StatusSignal<Angle> pitch;

public PivotIOTalonFX(int leadID, int followID, int gyroID) {
TalonFXConfiguration config = new TalonFXConfiguration();
Expand Down Expand Up @@ -96,9 +104,13 @@ public void updateInputs(PivotIOInputs inputs) {
// Conversions.falconToDegrees(
// (followPositionDegs.getValueAsDouble()), Constants.PivotConstants.REDUCTION);
inputs.velocityDegsPerSec =
<<<<<<< Updated upstream
Conversions.falconToDegrees(
velocityDegsPerSec.getValueAsDouble() * 2048,
PhysicalConstants.PivotConstants.REDUCTION);
=======
velocityDegsPerSec.getValueAsDouble();
>>>>>>> Stashed changes
inputs.appliedVolts = appliedVolts.getValueAsDouble();
inputs.currentAmps = currentAmps.getValueAsDouble();
inputs.positionSetpointDegs = positionSetpointDegs;
Expand Down
Loading

0 comments on commit 684dd24

Please sign in to comment.