WPILibC++ 2025.2.1
|
Module class for controlling a REV Robotics Pneumatic Hub. More...
#include <frc/PneumaticHub.h>
Classes | |
struct | Faults |
Faults for a REV PH. More... | |
struct | StickyFaults |
Sticky faults for a REV PH. More... | |
struct | Version |
Version and device data received from a REV PH. More... | |
Public Member Functions | |
PneumaticHub () | |
Constructs a PneumaticHub with the default ID (1). | |
PneumaticHub (int module) | |
Constructs a PneumaticHub. | |
~PneumaticHub () override=default | |
bool | GetCompressor () const override |
Returns whether the compressor is active or not. | |
void | DisableCompressor () override |
Disables the compressor. | |
void | EnableCompressorDigital () override |
Enables the compressor in digital mode using the digital pressure switch. | |
void | EnableCompressorAnalog (units::pounds_per_square_inch_t minPressure, units::pounds_per_square_inch_t maxPressure) override |
Enables the compressor in analog mode. | |
void | EnableCompressorHybrid (units::pounds_per_square_inch_t minPressure, units::pounds_per_square_inch_t maxPressure) override |
Enables the compressor in hybrid mode. | |
CompressorConfigType | GetCompressorConfigType () const override |
Returns the active compressor configuration. | |
bool | GetPressureSwitch () const override |
Returns the state of the pressure switch. | |
units::ampere_t | GetCompressorCurrent () const override |
Returns the current drawn by the compressor. | |
void | SetSolenoids (int mask, int values) override |
Sets solenoids on a pneumatics module. | |
int | GetSolenoids () const override |
Gets a bitmask of solenoid values. | |
int | GetModuleNumber () const override |
Get module number for this module. | |
int | GetSolenoidDisabledList () const override |
Get a bitmask of disabled solenoids. | |
void | FireOneShot (int index) override |
Fire a single solenoid shot. | |
void | SetOneShotDuration (int index, units::second_t duration) override |
Set the duration for a single solenoid shot. | |
bool | CheckSolenoidChannel (int channel) const override |
Check if a solenoid channel is valid. | |
int | CheckAndReserveSolenoids (int mask) override |
Check to see if the solenoids marked in the bitmask can be reserved, and if so, reserve them. | |
void | UnreserveSolenoids (int mask) override |
Unreserve the solenoids marked in the bitmask. | |
bool | ReserveCompressor () override |
Reserve the compressor. | |
void | UnreserveCompressor () override |
Unreserve the compressor. | |
Solenoid | MakeSolenoid (int channel) override |
Create a solenoid object for the specified channel. | |
DoubleSolenoid | MakeDoubleSolenoid (int forwardChannel, int reverseChannel) override |
Create a double solenoid object for the specified channels. | |
Compressor | MakeCompressor () override |
Create a compressor object. | |
Version | GetVersion () const |
Returns the hardware and firmware versions of this device. | |
Faults | GetFaults () const |
Returns the faults currently active on this device. | |
StickyFaults | GetStickyFaults () const |
Returns the sticky faults currently active on this device. | |
void | ClearStickyFaults () |
Clears the sticky faults. | |
units::volt_t | GetInputVoltage () const |
Returns the current input voltage for this device. | |
units::volt_t | Get5VRegulatedVoltage () const |
Returns the current voltage of the regulated 5v supply. | |
units::ampere_t | GetSolenoidsTotalCurrent () const |
Returns the total current drawn by all solenoids. | |
units::volt_t | GetSolenoidsVoltage () const |
Returns the current voltage of the solenoid power supply. | |
units::volt_t | GetAnalogVoltage (int channel) const override |
Returns the raw voltage of the specified analog input channel. | |
units::pounds_per_square_inch_t | GetPressure (int channel) const override |
Returns the pressure read by an analog pressure sensor on the specified analog input channel. | |
Public Member Functions inherited from frc::PneumaticsBase | |
virtual | ~PneumaticsBase ()=default |
Friends | |
class | DataStore |
class | PneumaticsBase |
Additional Inherited Members | |
Static Public Member Functions inherited from frc::PneumaticsBase | |
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. | |
Module class for controlling a REV Robotics Pneumatic Hub.
frc::PneumaticHub::PneumaticHub | ( | ) |
Constructs a PneumaticHub with the default ID (1).
|
explicit |
Constructs a PneumaticHub.
module | module number to construct |
|
overridedefault |
|
overridevirtual |
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. |
Implements frc::PneumaticsBase.
|
overridevirtual |
Check if a solenoid channel is valid.
channel | Channel to check |
Implements frc::PneumaticsBase.
void frc::PneumaticHub::ClearStickyFaults | ( | ) |
Clears the sticky faults.
|
overridevirtual |
Disables the compressor.
The compressor will not turn on until EnableCompressorDigital(), EnableCompressorAnalog(), or EnableCompressorHybrid() are called.
Implements frc::PneumaticsBase.
|
overridevirtual |
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 maxPressure
.
minPressure | The minimum pressure. The compressor will turn on when the pressure drops below this value. Range 0 - 120 PSI. |
maxPressure | The maximum pressure. The compressor will turn off when the pressure reaches this value. Range 0 - 120 PSI. Must be larger then minPressure. |
Implements frc::PneumaticsBase.
|
overridevirtual |
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.
Implements frc::PneumaticsBase.
|
overridevirtual |
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.
The compressor will turn on when both:
The compressor will turn off when either:
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. Range 0 - 120 PSI. |
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. Range 0 - 120 PSI. Must be larger then minPressure. |
Implements frc::PneumaticsBase.
|
overridevirtual |
units::volt_t frc::PneumaticHub::Get5VRegulatedVoltage | ( | ) | const |
Returns the current voltage of the regulated 5v supply.
|
overridevirtual |
Returns the raw voltage of the specified analog input channel.
channel | The analog input channel to read voltage from. |
Implements frc::PneumaticsBase.
|
overridevirtual |
Returns whether the compressor is active or not.
Implements frc::PneumaticsBase.
|
overridevirtual |
Returns the active compressor configuration.
Implements frc::PneumaticsBase.
|
overridevirtual |
Returns the current drawn by the compressor.
Implements frc::PneumaticsBase.
Faults frc::PneumaticHub::GetFaults | ( | ) | const |
Returns the faults currently active on this device.
units::volt_t frc::PneumaticHub::GetInputVoltage | ( | ) | const |
Returns the current input voltage for this device.
|
overridevirtual |
|
overridevirtual |
Returns the pressure read by an analog pressure sensor on the specified analog input channel.
channel | The analog input channel to read pressure from. |
Implements frc::PneumaticsBase.
|
overridevirtual |
Returns the state of the pressure switch.
Implements frc::PneumaticsBase.
|
overridevirtual |
Get a bitmask of disabled solenoids.
Implements frc::PneumaticsBase.
|
overridevirtual |
Gets a bitmask of solenoid values.
Implements frc::PneumaticsBase.
units::ampere_t frc::PneumaticHub::GetSolenoidsTotalCurrent | ( | ) | const |
Returns the total current drawn by all solenoids.
units::volt_t frc::PneumaticHub::GetSolenoidsVoltage | ( | ) | const |
Returns the current voltage of the solenoid power supply.
StickyFaults frc::PneumaticHub::GetStickyFaults | ( | ) | const |
Returns the sticky faults currently active on this device.
Version frc::PneumaticHub::GetVersion | ( | ) | const |
Returns the hardware and firmware versions of this device.
|
overridevirtual |
|
overridevirtual |
Create a double solenoid object for the specified channels.
forwardChannel | solenoid channel for forward |
reverseChannel | solenoid channel for reverse |
Implements frc::PneumaticsBase.
|
overridevirtual |
Create a solenoid object for the specified channel.
channel | solenoid channel |
Implements frc::PneumaticsBase.
|
overridevirtual |
Reserve the compressor.
Implements frc::PneumaticsBase.
|
overridevirtual |
Set the duration for a single solenoid shot.
index | solenoid index |
duration | shot duration |
Implements frc::PneumaticsBase.
|
overridevirtual |
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. |
Implements frc::PneumaticsBase.
|
overridevirtual |
Unreserve the compressor.
Implements frc::PneumaticsBase.
|
overridevirtual |
Unreserve the solenoids marked in the bitmask.
mask | The bitmask of solenoids to unreserve. The LSB represents solenoid 0. |
Implements frc::PneumaticsBase.
|
friend |
|
friend |