Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support digital, single analog, and dual analog pressure sensors #8

Open
gcschmit opened this issue Jan 2, 2023 · 4 comments
Open
Labels
defer until next season We will revisit this next FRC season enhancement New feature or request good first issue Good for newcomers

Comments

@gcschmit
Copy link
Contributor

gcschmit commented Jan 2, 2023

The pneumatics subsystem currently only supports dual analog pressure sensors (from Rev). It would be relatively straight forward to add a parameter to the constructor to select between the above three options. (If using a digital pressure sensor, replace enableCompressorAnalog with enableCompressorDigital.)

@gcschmit gcschmit added enhancement New feature or request good first issue Good for newcomers labels Jan 2, 2023
@gcschmit
Copy link
Contributor Author

gcschmit commented Jan 2, 2023

From CD message: "There is a pneumatics.getCompressorConfigType() method that I believe tells you if the PDH is configured for digital or analog pressure sensor."

@randomstring
Copy link
Contributor

I spent some time look at this today. Just detecting the compressor type requires the compressor mode to be set prior. I think the better option is to select the compressor mode when instantiating the pneumatic class. See my (yet untested):
FRC-Sonic-Squirrels@509db00

There is also a hybrid mode, that uses both digital and analog sensors, so any calls to enableCompressorAnalog() could be replaced with enableCompressorHybrid() and I think it should work with either or both.
https://first.wpi.edu/wpilib/allwpilib/docs/release/java/edu/wpi/first/wpilibj/PneumaticHub.html#enableCompressorHybrid(double,double)

@gcschmit
Copy link
Contributor Author

gcschmit commented Jan 6, 2023

Maybe an enumeration with more options:

  • single digital
  • single analog
  • hybrid (1 digital; 1 analog)
  • double analog
  • double hybrid (1 digital; 2 analog)

or maybe two parameters – the first specifies the enumerated value related to compressor control and the second a boolean to indicate if a second analog pressure sensor is present to log pressure downstream of the regulator.

  • single digital
  • single analog
  • hybrid (1 digital; 1 analog)

@randomstring
Copy link
Contributor

I got my version of Pneumatics working with the digital sensor on my fork. Looks very similar to your solution.

@gcschmit gcschmit added the defer until next season We will revisit this next FRC season label Jan 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defer until next season We will revisit this next FRC season enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants