[wpilib] Rename PneumaticsModuleType constants

This commit is contained in:
Peter Johnson
2026-03-19 21:32:48 -07:00
parent f060c98992
commit ea32c247db
44 changed files with 142 additions and 137 deletions

View File

@@ -30,7 +30,7 @@ kWheelDiameterInches = 6
kEncoderDistancePerPulse = (kWheelDiameterInches * math.pi) / kEncoderCPR
# Hatch
kHatchSolenoidModuleType = wpilib.PneumaticsModuleType.CTREPCM
kHatchSolenoidModuleType = wpilib.PneumaticsModuleType.CTRE_PCM
kHatchSolenoidModule = 0
kHatchSolenoidPorts = (0, 1)

View File

@@ -30,7 +30,7 @@ kWheelDiameterInches = 6
kEncoderDistancePerPulse = (kWheelDiameterInches * math.pi) / kEncoderCPR
# Hatch
kHatchSolenoidModuleType = wpilib.PneumaticsModuleType.CTREPCM
kHatchSolenoidModuleType = wpilib.PneumaticsModuleType.CTRE_PCM
kHatchSolenoidModule = 0
kHatchSolenoidPorts = (0, 1)

View File

@@ -18,7 +18,7 @@ class Intake(Subsystem):
# Double solenoid connected to two channels of a PCM with the default CAN ID
self.pistons = wpilib.DoubleSolenoid(
0,
wpilib.PneumaticsModuleType.CTREPCM,
wpilib.PneumaticsModuleType.CTRE_PCM,
IntakeConstants.kSolenoidPorts[0],
IntakeConstants.kSolenoidPorts[1],
)

View File

@@ -29,7 +29,7 @@ class Pneumatics(Subsystem):
)
# Compressor connected to a PCM with a default CAN ID (0)
self.compressor = wpilib.Compressor(0, wpilib.PneumaticsModuleType.CTREPCM)
self.compressor = wpilib.Compressor(0, wpilib.PneumaticsModuleType.CTRE_PCM)
def getPressure(self) -> float:
"""Query the analog pressure sensor.

View File

@@ -33,21 +33,21 @@ class MyRobot(wpilib.TimedRobot):
# Solenoid corresponds to a single solenoid.
# In this case, it's connected to channel 0 of a PH with the default CAN ID.
self.solenoid = wpilib.Solenoid(
busId=0, moduleType=wpilib.PneumaticsModuleType.REVPH, channel=0
busId=0, moduleType=wpilib.PneumaticsModuleType.REV_PH, channel=0
)
# DoubleSolenoid corresponds to a double solenoid.
# In this case, it's connected to channels 1 and 2 of a PH with the default CAN ID.
self.doubleSolenoid = wpilib.DoubleSolenoid(
busId=0,
moduleType=wpilib.PneumaticsModuleType.REVPH,
moduleType=wpilib.PneumaticsModuleType.REV_PH,
forwardChannel=1,
reverseChannel=2,
)
# Compressor connected to a PH with a default CAN ID (1)
self.compressor = wpilib.Compressor(
busId=0, moduleType=wpilib.PneumaticsModuleType.REVPH
busId=0, moduleType=wpilib.PneumaticsModuleType.REV_PH
)
# Publish elements to dashboard.

View File

@@ -14,7 +14,7 @@ class Intake:
self.motor = wpilib.PWMSparkMax(IntakeConstants.MOTOR_PORT)
self.piston = wpilib.DoubleSolenoid(
0,
wpilib.PneumaticsModuleType.CTREPCM,
wpilib.PneumaticsModuleType.CTRE_PCM,
IntakeConstants.PISTON_FWD_CHANNEL,
IntakeConstants.PISTON_REV_CHANNEL,
)