Skip to content

Commit 4743f2f

Browse files
authored
Add PCM/PH known issue (#1801)
* Add known issue about PH/PCM crash * Add link in pneumatics docs * Add note about checking for CAN disconnects
1 parent 4d90cd1 commit 4743f2f

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

source/docs/software/hardware-apis/pneumatics/pneumatics.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
Operating pneumatic cylinders
44
=============================
55

6+
.. important:: There is a known bug with constructing Pneumatic related devices when the CAN bus is disconnected. See :ref:`Known Issues <docs/yearly-overview/known-issues:code crash when initializing a ph/pcm related device>`.
7+
68
Using the FRC Control System to control Pneumatics
79
--------------------------------------------------
810

source/docs/yearly-overview/known-issues.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,36 @@ This article details known issues (and workarounds) for FRC\ |reg| Control Syste
88
Open Issues
99
-----------
1010

11+
Code crash when initializing a PH/PCM related device
12+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13+
14+
**Issue:** The following crash may happen when a ``Solenoid``, ``DoubleSolenoid``, ``Compressor``, ``PneumaticHub`` or ``PneumaticsControlModule`` is initialized when the CAN bus is disconnected.
15+
16+
**Workaround:** It is recommended to wrap the constructor in a try/catch and catch any corresponding usages. Additionally, you will want to double check that all CAN connections are secure from possible disconnects.
17+
18+
.. tabs::
19+
20+
.. code-tab:: java
21+
22+
private Solenoid m_intakeSolenoid;
23+
24+
@Override
25+
public void robotInit() {
26+
try {
27+
m_intakeSolenoid = new Solenoid(PneumaticsModuleType.REVPH, 0);
28+
} catch (UncleanStatusException ex) {
29+
DriverStation.reportError("Error creating Solenoid", ex.getStackTrace());
30+
}
31+
}
32+
33+
public void toggleSolenoid() {
34+
try {
35+
m_intakeSolenoid.toggle();
36+
} catch (NullPointerException ex) {
37+
DriverStation.reportError("Solenoid object is null", ex.getStackTrace());
38+
}
39+
}
40+
1141
Onboard I2C Causing System Lockups
1242
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1343

0 commit comments

Comments
 (0)