Go to Post Save the frustration for build season. :p - Brian C [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-01-2017, 19:49
snekiam snekiam is offline
Registered User
FRC #3322 (Eagle Imperium)
Team Role: Programmer
 
Join Date: Dec 2015
Rookie Year: 2010
Location: SE Michigan
Posts: 98
snekiam has a spectacular aura aboutsnekiam has a spectacular aura aboutsnekiam has a spectacular aura about
Re: Build succesful, but no robot code

I've seen this happen sometimes when there is an error in your RobotInit() - maybe check there for anything out of the ordinary, like a NullPointer or something.
Reply With Quote
  #2   Spotlight this post!  
Unread 30-01-2017, 19:50
generaldgibson generaldgibson is offline
generaldgibson
AKA: Daniel Gibson
FRC #3397 (FRC Robolions)
Team Role: Programmer
 
Join Date: Aug 2015
Rookie Year: 2015
Location: University City
Posts: 26
generaldgibson is an unknown quantity at this point
Re: Build succesful, but no robot code

Quote:
Originally Posted by snekiam View Post
I've seen this happen sometimes when there is an error in your RobotInit() - maybe check there for anything out of the ordinary, like a NullPointer or something.
Yes, I had this happen recently, and in the drive station there was a NullPointer indicating where the code was crashing - you'll have to change the code on that line.
Reply With Quote
  #3   Spotlight this post!  
Unread 01-02-2017, 15:10
DybbukCode DybbukCode is offline
Registered User
FRC #4572
 
Join Date: Jan 2017
Location: Easton CT
Posts: 4
DybbukCode is an unknown quantity at this point
Exclamation Re: Build succesful, but no robot code

I looked through the cconsole in the driver station, and noticed a couple of errors. Does anyone know what they mean?

********** Robot program starting **********
ERROR 1 ERROR Unhandled exception: java.lang.RuntimeException: Code: -1029. HAL: Resource already allocated at [edu.wpi.first.wpilibj.hal.PWMJNI.initializePWMPort (Native Method), edu.wpi.first.wpilibj.PWM.<init>(PWM.java:61), edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java: 24), edu.wpi.first.wpilibj.PWMSpeedController.<init>(PW MSpeedController.java:23), edu.wpi.first.wpilibj.Spark.<init>(Spark.java:49), org.usfirst.frc.team4572.robot.subsystems.DriveSub system.<init>(DriveSubsystem.java:15), org.usfirst.frc.team4572.robot.Robot.robotInit(Rob ot.java:46), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:64), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:247)] edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:249)
Error at edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:249): ERROR Unhandled exception: java.lang.RuntimeException: Code: -1029. HAL: Resource already allocated at [edu.wpi.first.wpilibj.hal.PWMJNI.initializePWMPort (Native Method), edu.wpi.first.wpilibj.PWM.<init>(PWM.java:61), edu.wpi.first.wpilibj.SafePWM.<init>(SafePWM.java: 24), edu.wpi.first.wpilibj.PWMSpeedController.<init>(PW MSpeedController.java:23), edu.wpi.first.wpilibj.Spark.<init>(Spark.java:49), org.usfirst.frc.team4572.robot.subsystems.DriveSub system.<init>(DriveSubsystem.java:15), org.usfirst.frc.team4572.robot.Robot.robotInit(Rob ot.java:46), edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:64), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.jav a:247)]
WARNING: Robots don't quit!
---> The startCompetition() method (or methods called by it) should have handled the exception above.
➔ Launching «'/usr/local/frc/JRE/bin/java' '-Djava.library.path=/usr/local/frc/lib/' '-jar' '/home/lvuser/FRCUserProgram.jar'»
Reply With Quote
  #4   Spotlight this post!  
Unread 01-02-2017, 16:10
dvanvoorst dvanvoorst is offline
Registered User
FRC #2771 (Code Red)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Grand Rapids, MI
Posts: 73
dvanvoorst is an unknown quantity at this point
Re: Build succesful, but no robot code

I believe the part that says "Resource already allocated at [edu.wpi.first.wpilibj.hal.PWMJNI.initializePWMPort " indicates that the PWM port you are trying to use has already been used to initialize another device. Make sure all of your motor controllers have a unique port number passed to them. Or post your RobotInit code here if that doesn't help.
__________________

Reply With Quote
  #5   Spotlight this post!  
Unread 01-02-2017, 16:21
DybbukCode DybbukCode is offline
Registered User
FRC #4572
 
Join Date: Jan 2017
Location: Easton CT
Posts: 4
DybbukCode is an unknown quantity at this point
Exclamation Re: Build succesful, but no robot code

Here's the robotInit code:

public void robotInit() {
chooser = new SendableChooser<Object>();
driveSubsystem = new DriveSubsystem();
gyroSystem = new GyroSystem();
ballHopperSystem = new BallHopperSystem();
ropeClimberSystem = new RopeClimberSystem();
CameraServer.getInstance().startAutomaticCapture() ;
SmartDashboard.putData("Auto mode", chooser);
robotDrive = new RobotDrive(RobotMap.FRONT_LEFT_MOTOR_PORT, RobotMap.BACK_LEFT_MOTOR_PORT, RobotMap.FRONT_RIGHT_MOTOR_PORT, RobotMap.BACK_RIGHT_MOTOR_PORT);
robotDrive.setInvertedMotor(MotorType.kFrontLeft, true);
robotDrive.setInvertedMotor(MotorType.kFrontRight, true);
robotDrive.setExpiration(0.1);
}
Reply With Quote
  #6   Spotlight this post!  
Unread 01-02-2017, 16:31
DybbukCode DybbukCode is offline
Registered User
FRC #4572
 
Join Date: Jan 2017
Location: Easton CT
Posts: 4
DybbukCode is an unknown quantity at this point
Re: Build succesful, but no robot code

UPDATE: We moved a couple things around in our doe, and we are no longer getting the same error. Now we're getting:

ERROR: Could not instantiate robot org.usfirst.frc.team4572.robot.Robot!
Reply With Quote
  #7   Spotlight this post!  
Unread 02-02-2017, 08:58
dvanvoorst dvanvoorst is offline
Registered User
FRC #2771 (Code Red)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Grand Rapids, MI
Posts: 73
dvanvoorst is an unknown quantity at this point
Re: Build succesful, but no robot code

Look at the code in each of your subsystems and note which port number your using for each motor. My suspicion is that you'll find the same port number being used in more than one place - which will cause a runtime error during initialization.
__________________

Reply With Quote
  #8   Spotlight this post!  
Unread 05-02-2017, 10:02
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,602
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Build succesful, but no robot code

Quote:
Originally Posted by DybbukCode View Post
UPDATE: We moved a couple things around in our doe, and we are no longer getting the same error. Now we're getting:

ERROR: Could not instantiate robot org.usfirst.frc.team4572.robot.Robot!
That means you renamed or moved your robot class and now the roborio can't find it.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:21.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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