Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Driver Station long error (http://www.chiefdelphi.com/forums/showthread.php?t=144411)

ncarvo 02-22-2016 11:00 AM

Driver Station long error
 
My code compiles but when in the driver station i get this long error message that no one understands.


ERROR Unhandled exception instantiating robot org.usfirst.frc.team5473.robot.Robot java.lang.RuntimeException: Code: -1029. HAL: Resource already allocated at [edu.wpi.first.wpilibj.hal.PWMJNI.allocatePWMChanne l(Native Method), edu.wpi.first.wpilibj.PWM.initPWM(PWM.java:117), edu.wpi.first.wpilibj.PWM.<init>(PWM.java:134), edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java: 35), edu.wpi.first.wpilibj.Talon.<init>(Talon.java:51), edu.wpi.first.wpilibj.RobotDrive.<init>(RobotDrive .java:95), org.usfirst.frc.team5473.robot.Robot.<init>(Robot. java:46), sun.reflect.NativeConstructorAccessorImpl.newInsta nce0(Native Method), sun.reflect.NativeConstructorAccessorImpl.newInsta nce(NativeConstructorAccessorImpl.java:62), sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:45) , java.lang.reflect.Constructor.newInstance(Construc tor.java:408), java.lang.Class.newInstance(Class.java:433), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:204)]




please help. need solution asap.

pblankenbaker 02-22-2016 11:09 AM

Re: Driver Station long error
 
The stack trace (error output) indicates that you have a problem at line 46 in your Robot.java code.

The error message indicates that you tried to use the same PWM port in the construction of more than one SpeedController or Servo.

VrewDaive 02-22-2016 11:22 AM

Re: Driver Station long error
 
Read through your code very thoroughly, odds are you declared something incorrectly or you put something in the wrong spot. I could try and help if you post code

abigailthefox 02-22-2016 11:58 AM

Re: Driver Station long error
 
Quote:

Originally Posted by ncarvo (Post 1544248)
(Robot.java:46)

There's your error!!
Any time you get a ridiculously long error message (I've been getting several of these over the past few days as we restructure some code), look through it to identify any java file YOU wrote...i.e. Robot.java. The other .java files are from the wpilib, and can help you see what element of the code is causing the problem. Also, the Robot.java:46 shows that the error (as mentioned by someone earlier) is at line 46.
Open up Eclipse (or whatever development environment you're using), and scroll down to line 46 in your Robot.java file.
There may not be any explicit errors, so you'll have to look at what exactly is written there. Chances are, it's a problem with a class from the wpilib that you're calling for the first time, and from the rest of the error message, it looks like potentially a Talon/PWM port issue.
Check to see where you declare the port that your PWM plugs into (usually declared in the RobotMap, or at the top of a class), and make sure there's no duplicates (i.e. Talon 1 is being assigned to port 0, and Talon 2 is also being assigned to port 0). This may not be obvious, especially if you've redone your code a few times, or physically moved things around. Also, make sure to look at the physical robot, and where everything is plugged into the RoboRIO. Make sure that the assigned port in the code matches the port that it is physically plugged into on the RoboRIO.
If everything lines up and you're still getting an error, post some code and we can try to help you out!!

ncarvo 02-22-2016 10:27 PM

Re: Driver Station long error
 
Thanks, guys, works now.


All times are GMT -5. The time now is 08:00 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi