[wpilib] Add/update documentation to PneumaticBase and subclasses (NFC) (#4881)

Co-authored-by: Starlight220 <53231611+Starlight220@users.noreply.github.com>
This commit is contained in:
Ryan Blue
2023-01-02 13:23:59 -05:00
committed by GitHub
parent 9872e676d8
commit 83f1860047
8 changed files with 722 additions and 47 deletions

View File

@@ -79,31 +79,39 @@ class Compressor : public wpi::Sendable,
bool IsEnabled() const;
/**
* Check if the pressure switch is triggered.
* Returns the state of the pressure switch.
*
* @return true if pressure is low
* @return True if pressure switch indicates that the system is not full,
* otherwise false.
*/
bool GetPressureSwitchValue() const;
/**
* Query how much current the compressor is drawing.
* Get the current drawn by the compressor.
*
* @return The current through the compressor, in amps
* @return Current drawn by the compressor.
*/
units::ampere_t GetCurrent() const;
/**
* Query the analog input voltage (on channel 0) (if supported).
* If supported by the device, returns the analog input voltage (on channel
* 0).
*
* @return The analog input voltage, in volts
* This function is only supported by the REV PH. On CTRE PCM, this will
* return 0.
*
* @return The analog input voltage, in volts.
*/
units::volt_t GetAnalogVoltage() const;
/**
* Query the analog sensor pressure (on channel 0) (if supported). Note this
* is only for use with the REV Analog Pressure Sensor.
* If supported by the device, returns the pressure read by the analog
* pressure sensor (on channel 0).
*
* @return The analog sensor pressure, in PSI
* This function is only supported by the REV PH with the REV Analog Pressure
* Sensor. On CTRE PCM, this will return 0.
*
* @return The pressure read by the analog pressure sensor.
*/
units::pounds_per_square_inch_t GetPressure() const;
@@ -113,34 +121,68 @@ class Compressor : public wpi::Sendable,
void Disable();
/**
* Enable compressor closed loop control using digital input.
* 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.
*/
void EnableDigital();
/**
* Enable compressor closed loop control using analog input. Note this is only
* for use with the REV Analog Pressure Sensor.
* 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
* {@code minPressure} and will turn off when the pressure reaches {@code
* maxPressure}. This mode is only supported by the REV PH with the REV Analog
* Pressure Sensor connected to analog channel 0.
*
* <p>On CTRE PCM, this will enable digital control.
* On CTRE PCM, this will enable digital control.
*
* @param minPressure The minimum pressure in PSI to enable compressor
* @param maxPressure The maximum pressure in PSI to disable compressor
* @param minPressure The minimum pressure. The compressor will turn on when
* the pressure drops below this value.
* @param maxPressure The maximum pressure. The compressor will turn off when
* the pressure reaches this value.
*/
void EnableAnalog(units::pounds_per_square_inch_t minPressure,
units::pounds_per_square_inch_t maxPressure);
/**
* Enable compressor closed loop control using hybrid input. Note this is only
* for use with the REV Analog Pressure Sensor.
* 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 \a both:
*
* - The digital pressure switch indicates the system is not full AND
* - The analog pressure sensor indicates that the pressure in the system
* is below the specified minimum pressure.
*
* The compressor will turn off when \a either:
*
* - The digital pressure switch is disconnected or indicates that the system
* is full OR
* - The pressure detected by the analog sensor is greater than the specified
* maximum pressure.
*
* On CTRE PCM, this will enable digital control.
*
* @param minPressure The minimum pressure in PSI to enable compressor
* @param maxPressure The maximum pressure in PSI to disable compressor
* @param 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.
* @param 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.
*/
void EnableHybrid(units::pounds_per_square_inch_t minPressure,
units::pounds_per_square_inch_t maxPressure);
/**
* Returns the active compressor configuration.
*
* @return The active compressor configuration.
*/
CompressorConfigType GetConfigType() const;
void InitSendable(wpi::SendableBuilder& builder) override;