Base class for pneumatics devices. More...
#include <frc/PneumaticsBase.h>
Public Member Functions | |
virtual | ~PneumaticsBase ()=default |
virtual bool | GetCompressor () const =0 |
Returns whether the compressor is active or not. | |
virtual bool | GetPressureSwitch () const =0 |
Returns the state of the pressure switch. | |
virtual units::ampere_t | GetCompressorCurrent () const =0 |
Returns the current drawn by the compressor. | |
virtual void | DisableCompressor ()=0 |
Disables the compressor. | |
virtual void | EnableCompressorDigital ()=0 |
Enables the compressor in digital mode using the digital pressure switch. | |
virtual void | EnableCompressorAnalog (units::pounds_per_square_inch_t minPressure, units::pounds_per_square_inch_t maxPressure)=0 |
If supported by the device, enables the compressor in analog mode. | |
virtual void | EnableCompressorHybrid (units::pounds_per_square_inch_t minPressure, units::pounds_per_square_inch_t maxPressure)=0 |
If supported by the device, enables the compressor in hybrid mode. | |
virtual CompressorConfigType | GetCompressorConfigType () const =0 |
Returns the active compressor configuration. | |
virtual void | SetSolenoids (int mask, int values)=0 |
Sets solenoids on a pneumatics module. | |
virtual int | GetSolenoids () const =0 |
Gets a bitmask of solenoid values. | |
virtual int | GetModuleNumber () const =0 |
Get module number for this module. | |
virtual int | GetSolenoidDisabledList () const =0 |
Get a bitmask of disabled solenoids. | |
virtual void | FireOneShot (int index)=0 |
Fire a single solenoid shot. | |
virtual void | SetOneShotDuration (int index, units::second_t duration)=0 |
Set the duration for a single solenoid shot. | |
virtual bool | CheckSolenoidChannel (int channel) const =0 |
Check if a solenoid channel is valid. | |
virtual int | CheckAndReserveSolenoids (int mask)=0 |
Check to see if the solenoids marked in the bitmask can be reserved, and if so, reserve them. | |
virtual void | UnreserveSolenoids (int mask)=0 |
Unreserve the solenoids marked in the bitmask. | |
virtual bool | ReserveCompressor ()=0 |
Reserve the compressor. | |
virtual void | UnreserveCompressor ()=0 |
Unreserve the compressor. | |
virtual units::volt_t | GetAnalogVoltage (int channel) const =0 |
If supported by the device, returns the raw voltage of the specified analog input channel. | |
virtual units::pounds_per_square_inch_t | GetPressure (int channel) const =0 |
If supported by the device, returns the pressure read by an analog pressure sensor on the specified analog input channel. | |
virtual Solenoid | MakeSolenoid (int channel)=0 |
Create a solenoid object for the specified channel. | |
virtual DoubleSolenoid | MakeDoubleSolenoid (int forwardChannel, int reverseChannel)=0 |
Create a double solenoid object for the specified channels. | |
virtual Compressor | MakeCompressor ()=0 |
Create a compressor object. | |
Static Public Member Functions | |
static std::shared_ptr< PneumaticsBase > | GetForType (int module, PneumaticsModuleType moduleType) |
For internal use to get a module for a specific type. | |
static int | GetDefaultForType (PneumaticsModuleType moduleType) |
For internal use to get the default for a specific type. | |
Base class for pneumatics devices.
|
virtualdefault |
|
pure virtual |
Check to see if the solenoids marked in the bitmask can be reserved, and if so, reserve them.
mask | The bitmask of solenoids to reserve. The LSB represents solenoid 0. |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Check if a solenoid channel is valid.
channel | Channel to check |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Disables the compressor.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
If supported by the device, enables the compressor in analog mode.
This mode uses an analog pressure sensor connected to analog channel 0 to cycle the compressor. The compressor will turn on when the pressure drops below minPressure
and will turn off when the pressure reaches
. This mode is only supported by the REV PH with the REV Analog Pressure Sensor connected to analog channel 0.
maxPressure
On CTRE PCM, this will enable digital control.
minPressure | The minimum pressure. The compressor will turn on when the pressure drops below this value. |
maxPressure | The maximum pressure. The compressor will turn off when the pressure reaches this value. |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Enables the compressor in digital mode using the digital pressure switch.
The compressor will turn on when the pressure switch indicates that the system is not full, and will turn off when the pressure switch indicates that the system is full.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
If supported by the device, enables the compressor in hybrid mode.
This mode uses both a digital pressure switch and an analog pressure sensor connected to analog channel 0 to cycle the compressor. This mode is only supported by the REV PH with the REV Analog Pressure Sensor connected to analog channel 0.
The compressor will turn on when both:
The compressor will turn off when either:
On CTRE PCM, this will enable digital control.
minPressure | The minimum pressure. The compressor will turn on when the pressure drops below this value and the pressure switch indicates that the system is not full. |
maxPressure | The maximum pressure. The compressor will turn off when the pressure reaches this value or the pressure switch is disconnected or indicates that the system is full. |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Fire a single solenoid shot.
index | solenoid index |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
If supported by the device, returns the raw voltage of the specified analog input channel.
This function is only supported by the REV PH. On CTRE PCM, this will return 0.
channel | The analog input channel to read voltage from. |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Returns whether the compressor is active or not.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Returns the active compressor configuration.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Returns the current drawn by the compressor.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
static |
For internal use to get the default for a specific type.
moduleType | module type |
|
static |
For internal use to get a module for a specific type.
module | module number |
moduleType | module type |
|
pure virtual |
Get module number for this module.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
If supported by the device, returns the pressure read by an analog pressure sensor on the specified analog input channel.
This function is only supported by the REV PH. On CTRE PCM, this will return 0.
channel | The analog input channel to read pressure from. |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Returns the state of the pressure switch.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Get a bitmask of disabled solenoids.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Gets a bitmask of solenoid values.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Create a compressor object.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Create a double solenoid object for the specified channels.
forwardChannel | solenoid channel for forward |
reverseChannel | solenoid channel for reverse |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Create a solenoid object for the specified channel.
channel | solenoid channel |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Reserve the compressor.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Set the duration for a single solenoid shot.
index | solenoid index |
duration | shot duration |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Sets solenoids on a pneumatics module.
mask | Bitmask indicating which solenoids to set. The LSB represents solenoid 0. |
values | Bitmask indicating the desired states of the solenoids. The LSB represents solenoid 0. |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Unreserve the compressor.
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.
|
pure virtual |
Unreserve the solenoids marked in the bitmask.
mask | The bitmask of solenoids to unreserve. The LSB represents solenoid 0. |
Implemented in frc::PneumaticHub, and frc::PneumaticsControlModule.