CTREPCMSim

class wpilib.simulation.CTREPCMSim(*args, **kwargs)

Bases: PneumaticsBaseSim

Class to control a simulated Pneumatic Control Module (PCM).

Overloaded function.

  1. __init__(self: wpilib.simulation._simulation.CTREPCMSim) -> None

Constructs with the default PCM module number (CAN ID).

  1. __init__(self: wpilib.simulation._simulation.CTREPCMSim, module: int) -> None

Constructs from a PCM module number (CAN ID).

Parameters:

module – module number

  1. __init__(self: wpilib.simulation._simulation.CTREPCMSim, pneumatics: wpilib._wpilib.PneumaticsBase) -> None

getAllSolenoidOutputs() int
getClosedLoopEnabled() bool

Check whether the closed loop compressor control is active.

Returns:

true if active

getCompressorCurrent() float

Read the compressor current.

Returns:

the current of the compressor connected to this module

getCompressorOn() bool
getInitialized() bool
getPressureSwitch() bool

Check the value of the pressure switch.

Returns:

the pressure switch value

getSolenoidOutput(channel: int) bool
registerClosedLoopEnabledCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the closed loop state changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

registerCompressorCurrentCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the compressor current changes.

Parameters:
  • callback – the callback

  • initialNotify – whether to call the callback with the initial state

Returns:

the CallbackStore object associated with this callback

registerCompressorOnCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
registerInitializedCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
registerPressureSwitchCallback(callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore

Register a callback to be run whenever the pressure switch value changes.

Parameters:
  • callback – the callback

  • initialNotify – whether the callback should be called with the initial value

Returns:

the CallbackStore object associated with this callback

registerSolenoidOutputCallback(channel: int, callback: Callable[[str, HAL_Value], None], initialNotify: bool) wpilib.simulation._simulation.CallbackStore
resetData() None
setAllSolenoidOutputs(outputs: int) None
setClosedLoopEnabled(closedLoopEnabled: bool) None

Turn on/off the closed loop control of the compressor.

Parameters:

closedLoopEnabled – whether the control loop is active

setCompressorCurrent(compressorCurrent: float) None

Set the compressor current.

Parameters:

compressorCurrent – the new compressor current

setCompressorOn(compressorOn: bool) None
setInitialized(initialized: bool) None
setPressureSwitch(pressureSwitch: bool) None

Set the value of the pressure switch.

Parameters:

pressureSwitch – the new value

setSolenoidOutput(channel: int, solenoidOutput: bool) None