Resource Already Allocated Error Mystery

Hey folks,
I’m an alumni programmer trying to help my team out with a weird error. Essentially, a Resource Already Allocated error is being thrown on a declaration of a DigitalInput (limit switch). Normally, this means there’s a duplicated port number somewhere, but we’ve tried swapping ports, and we’ve looked through pretty much the entire codebase without finding duplicates. We’re pretty stuck. Here’s a github link:

And here’s the error:

ERROR  1  Could not instantiate robot edu.wpi.first.hal.DIOJNI!  edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:245) 
ERROR  1  Unhandled exception instantiating robot edu.wpi.first.hal.DIOJNI edu.wpi.first.hal.util.UncleanStatusException: Code: -1029. HAL: Resource already allocated  frc.robot.subsystems.HoodPosition.(HoodPosition.java:23)

Any help at all would be appreciated! I fully expect we’re missing something silly. Thanks!

You have
public static HoodPosition m_hPosition = new HoodPosition();
in Robot.java, and
private final HoodPosition m_hoodPosition = new HoodPosition();
in RobotContainer.java. I’d keep only one of these.

It looks like you’re doing similar with several subsystems.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.