Skip to content

Commit c25db4b

Browse files
Fixed sim
1 parent 88effb3 commit c25db4b

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

public/templates/arm-subsystem.java.hbs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,9 @@ public class {{subsystemName}} extends SubsystemBase {
170170
public void simulationPeriodic() {
171171
// Set input voltage from motor controller to simulation
172172
// Note: This may need to be talonfx.getSimState().getMotorVoltage() as the input.
173-
armSim.setInput(dcMotor.getVoltage(dcMotor.getTorque(armSim.getCurrentDrawAmps()), armSim.getVelocityRadPerSec()));
174-
173+
//armSim.setInput(dcMotor.getVoltage(dcMotor.getTorque(armSim.getCurrentDrawAmps()), armSim.getVelocityRadPerSec()));
174+
armSim.setInput(getVoltage());
175+
175176
// Update simulation by 20ms
176177
armSim.update(0.020);
177178
RoboRioSim.setVInVoltage(BatterySim.calculateDefaultBatteryLoadedVoltage(armSim.getCurrentDrawAmps()));

public/templates/elevator-subsystem.java.hbs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,8 @@ public class {{subsystemName}} extends SubsystemBase {
169169

170170
// Set input voltage from motor controller to simulation
171171
// Note: This may need to be talonfx.getSimState().getMotorVoltage() as the input
172-
elevatorSim.setInput(dcMotor.getVoltage(dcMotor.getTorque(elevatorSim.getCurrentDrawAmps()), elevatorSim.getVelocityMetersPerSecond() * positionToRotations * 2 * Math.PI));
172+
//elevatorSim.setInput(dcMotor.getVoltage(dcMotor.getTorque(elevatorSim.getCurrentDrawAmps()), elevatorSim.getVelocityMetersPerSecond() * positionToRotations * 2 * Math.PI));
173+
elevatorSim.setInput(getVoltage());
173174

174175
// Update simulation by 20ms
175176
elevatorSim.update(0.020);

public/templates/pivot-subsystem.java.hbs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ public void periodic() {
177177
public void simulationPeriodic() {
178178
// Set input voltage from motor controller to simulation
179179
// Note: This may need to be talonfx.getSimState().getMotorVoltage() as the input
180-
pivotSim.setInput(dcMotor.getVoltage(dcMotor.getTorque(pivotSim.getCurrentDrawAmps()), pivotSim.getVelocityRadPerSec()));
181-
180+
//pivotSim.setInput(dcMotor.getVoltage(dcMotor.getTorque(pivotSim.getCurrentDrawAmps()), pivotSim.getVelocityRadPerSec()));
181+
pivotSim.setInput(getVoltage());
182+
182183
// Update simulation by 20ms
183184
pivotSim.update(0.020);
184185
RoboRioSim.setVInVoltage(BatterySim.calculateDefaultBatteryLoadedVoltage(pivotSim.getCurrentDrawAmps()));

0 commit comments

Comments
 (0)