Skip to content

Commit 480ed4d

Browse files
committed
PWMSim -> PWMMotorControllerSim
1 parent 48a10a9 commit 480ed4d

File tree

11 files changed

+27
-25
lines changed

11 files changed

+27
-25
lines changed

ArmSimulation/physics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
6767
Constants.kArmEncoderDistPerPulse,
6868
)
6969
self.encoderSim = wpilib.simulation.EncoderSim(robot.arm.encoder)
70-
self.motorSim = wpilib.simulation.PWMSim(robot.arm.motor.getChannel())
70+
self.motorSim = wpilib.simulation.PWMMotorControllerSim(robot.arm.motor)
7171

7272
# Create a Mechanism2d display of an Arm with a fixed ArmTower and moving Arm.
7373
self.mech2d = wpilib.Mechanism2d(60, 60)

ElevatorSimulation/physics.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
5656
[0.01, 0.0],
5757
)
5858
self.encoderSim = wpilib.simulation.EncoderSim(robot.encoder)
59-
self.motorSim = wpilib.simulation.PWMSim(robot.motor.getChannel())
59+
self.motorSim = wpilib.simulation.PWMMotorControllerSim(robot.motor)
6060

6161
# Create a Mechanism2d display of an elevator
6262
self.mech2d = wpilib.Mechanism2d(20, 50)

FlywheelBangBangController/physics.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
2929
self.physics_controller = physics_controller
3030

3131
# Motors
32-
self.flywheelMotor = wpilib.simulation.PWMSim(robot.flywheelMotor.getChannel())
32+
self.flywheelMotor = wpilib.simulation.PWMMotorControllerSim(
33+
robot.flywheelMotor.getChannel()
34+
)
3335

3436
# Sensors
3537
self.encoder = wpilib.simulation.EncoderSim(robot.encoder)

HatchbotInlined/physics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
3838
self.physics_controller = physics_controller
3939

4040
# Motors
41-
self.l_motor = wpilib.simulation.PWMSim(
41+
self.l_motor = wpilib.simulation.PWMMotorControllerSim(
4242
robot.container.driveSubsystem.left1.getChannel()
4343
)
44-
self.r_motor = wpilib.simulation.PWMSim(
44+
self.r_motor = wpilib.simulation.PWMMotorControllerSim(
4545
robot.container.driveSubsystem.right1.getChannel()
4646
)
4747

HatchbotTraditional/physics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,10 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
4040
self.physics_controller = physics_controller
4141

4242
# Motors
43-
self.l_motor = wpilib.simulation.PWMSim(
43+
self.l_motor = wpilib.simulation.PWMMotorControllerSim(
4444
robot.container.drive.left1.getChannel()
4545
)
46-
self.r_motor = wpilib.simulation.PWMSim(
46+
self.r_motor = wpilib.simulation.PWMMotorControllerSim(
4747
robot.container.drive.right1.getChannel()
4848
)
4949

Physics/src/physics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
3838
self.physics_controller = physics_controller
3939

4040
# Motors
41-
self.l_motor = wpilib.simulation.PWMSim(robot.l_motor.getChannel())
42-
self.r_motor = wpilib.simulation.PWMSim(robot.r_motor.getChannel())
41+
self.l_motor = wpilib.simulation.PWMMotorControllerSim(robot.l_motor)
42+
self.r_motor = wpilib.simulation.PWMMotorControllerSim(robot.r_motor)
4343

4444
self.dio1 = wpilib.simulation.DIOSim(robot.limit1)
4545
self.dio2 = wpilib.simulation.DIOSim(robot.limit2)
4646
self.ain2 = wpilib.simulation.AnalogInputSim(robot.position)
4747

48-
self.motor = wpilib.simulation.PWMSim(robot.motor.getChannel())
48+
self.motor = wpilib.simulation.PWMMotorControllerSim(robot.motor.getChannel())
4949

5050
# Gyro
5151
self.gyro = wpilib.simulation.AnalogGyroSim(robot.gyro)

Physics4Wheel/src/physics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
3535
self.physics_controller = physics_controller
3636

3737
# Motors
38-
self.lf_motor = wpilib.simulation.PWMSim(robot.lf_motor.getChannel())
39-
# self.lr_motor = wpilib.simulation.PWMSim(2)
40-
self.rf_motor = wpilib.simulation.PWMSim(robot.rf_motor.getChannel())
41-
# self.rr_motor = wpilib.simulation.PWMSim(4)
38+
self.lf_motor = wpilib.simulation.PWMMotorControllerSim(robot.lf_motor)
39+
# self.lr_motor = wpilib.simulation.PWMMotorControllerSim(2)
40+
self.rf_motor = wpilib.simulation.PWMMotorControllerSim(robot.rf_motor)
41+
# self.rr_motor = wpilib.simulation.PWMMotorControllerSim(4)
4242

4343
# Gyro
4444
self.gyro = wpilib.simulation.AnalogGyroSim(robot.gyro)

PhysicsCamSim/src/physics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#
1717

1818
from wpilib.simulation import (
19-
PWMSim,
19+
PWMMotorControllerSim,
2020
DifferentialDrivetrainSim,
2121
EncoderSim,
2222
AnalogGyroSim,
@@ -79,8 +79,8 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
7979
)
8080

8181
# Create the motors.
82-
self.l_motor = PWMSim(robot.leftMotor.getChannel())
83-
self.r_motor = PWMSim(robot.rightMotor.getChannel())
82+
self.l_motor = PWMMotorControllerSim(robot.leftMotor.getChannel())
83+
self.r_motor = PWMMotorControllerSim(robot.rightMotor.getChannel())
8484

8585
self.gyroSim = AnalogGyroSim(robot.gyro)
8686

PhysicsMecanum/src/physics.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
3333
self.physics_controller = physics_controller
3434

3535
# Motors
36-
self.lf_motor = wpilib.simulation.PWMSim(robot.frontLeftMotor.getChannel())
37-
self.lr_motor = wpilib.simulation.PWMSim(robot.rearLeftMotor.getChannel())
38-
self.rf_motor = wpilib.simulation.PWMSim(robot.frontRightMotor.getChannel())
39-
self.rr_motor = wpilib.simulation.PWMSim(robot.rearRightMotor.getChannel())
36+
self.lf_motor = wpilib.simulation.PWMMotorControllerSim(robot.frontLeftMotor)
37+
self.lr_motor = wpilib.simulation.PWMMotorControllerSim(robot.rearLeftMotor)
38+
self.rf_motor = wpilib.simulation.PWMMotorControllerSim(robot.frontRightMotor)
39+
self.rr_motor = wpilib.simulation.PWMMotorControllerSim(robot.rearRightMotor)
4040

4141
# Gyro
4242
self.gyro = wpilib.simulation.AnalogGyroSim(robot.gyro)

PhysicsSPI/src/physics.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ def __init__(self, physics_controller: PhysicsInterface, robot: "MyRobot"):
4444
self.physics_controller = physics_controller
4545

4646
# Motors
47-
self.l_motor = wpilib.simulation.PWMSim(robot.l_motor.getChannel())
48-
self.r_motor = wpilib.simulation.PWMSim(robot.r_motor.getChannel())
47+
self.l_motor = wpilib.simulation.PWMMotorControllerSim(robot.l_motor)
48+
self.r_motor = wpilib.simulation.PWMMotorControllerSim(robot.r_motor)
4949

5050
self.dio1 = wpilib.simulation.DIOSim(robot.limit1)
5151
self.dio2 = wpilib.simulation.DIOSim(robot.limit2)
5252
self.ain2 = wpilib.simulation.AnalogInputSim(robot.position)
5353

54-
self.motor = wpilib.simulation.PWMSim(robot.motor.getChannel())
54+
self.motor = wpilib.simulation.PWMMotorControllerSim(robot.motor.getChannel())
5555

5656
# Gyro
5757
self.gyro = wpilib.simulation.ADXRS450_GyroSim(robot.gyro)

0 commit comments

Comments
 (0)