Getting a “Unhandled exception: edu.wpi.first.hal.util.UncleanStatusException: Code: -1029. HAL: Resource already allocated.” error

ERROR  1  Unhandled exception: edu.wpi.first.hal.util.UncleanStatusException: Code: -1029. HAL: Resource already allocated  frc.robot.Subsystems.Shooter.( 
ERROR  1  The startCompetition() method (or methods called by it) should have handled the exception above.  edu.wpi.first.wpilibj.RobotBase.runRobot( 
Warning at edu.wpi.first.wpilibj.RobotBase.runRobot( Robots should not quit, but yours did!

Maybe include the shooter code that is failing, the code around line 62 which is throwing the error.

My guess is you are trying to allocate a new object on a can ID that has already been taken or a solenoid on a pneumatic port already taken.

1 Like

From the refrences to the type it looks like it could also be a relay id reused. My guess is since it was a shooter that it is a reused motor id, but maybe a solenoid if if you are using one to feed or gate your shooter.

This error means that you’re creating that you’re creating two device objects on the same ports. Look over the port numbers and CAN IDs you’re constructing objects with and make sure you’re not using the same ports for the same type of devices (DIO/CAN/PWM/PCM/etc).
Another option is that you’re creating two Shooter objects – running a Search Everywhere for new Shooter should only give one result (and make sure it’s not in a loop): if you have two, that’s the issue.


Did you figure out the problem?

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