Skip to content

Commit

Permalink
fix amp reading
Browse files Browse the repository at this point in the history
  • Loading branch information
jack60612 committed Jan 18, 2025
1 parent 81cb773 commit dec306a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/ArmSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public void simulationPeriodic() {

// add load to battery
RoboRioSim.setVInVoltage(
BatterySim.calculateDefaultBatteryLoadedVoltage(m_simMotor.getMotorCurrent()));
BatterySim.calculateDefaultBatteryLoadedVoltage(m_ArmSim.getCurrentDrawAmps()));

// update encoder
m_ArmEncoderSim.setPosition(m_ArmSim.getAngleRads());
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/frc/robot/subsystems/DriveSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,7 @@ public void simulationPeriodic() {
m_driveTrainSim.getRightVelocityMetersPerSecond(), RoboRioSim.getVInVoltage(), 0.02);
// add load to battery
RoboRioSim.setVInVoltage(
BatterySim.calculateDefaultBatteryLoadedVoltage(
m_leftSim.getMotorCurrent() + m_rightSim.getMotorCurrent()));
BatterySim.calculateDefaultBatteryLoadedVoltage(m_driveTrainSim.getCurrentDrawAmps()));
// update sensors
SimGyroAngleHandler.set(-m_driveTrainSim.getHeading().getDegrees());
m_leftEncoderSim.setPosition(m_driveTrainSim.getLeftPositionMeters());
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/frc/robot/subsystems/ElevatorSubsystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ public void simulationPeriodic() {

// add load to battery
RoboRioSim.setVInVoltage(
BatterySim.calculateDefaultBatteryLoadedVoltage(m_simMotor.getMotorCurrent()));
BatterySim.calculateDefaultBatteryLoadedVoltage(m_ElevatorSim.getCurrentDrawAmps()));

// update encoder
m_ElevatorEncoderSim.setPosition(m_ElevatorSim.getPositionMeters());
Expand Down

0 comments on commit dec306a

Please sign in to comment.