|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
|||
|
|||
|
Re: Build succesful, but no robot code
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.
|
|
#3
|
|||
|
|||
|
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'» |
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
|||
|
|||
|
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); } |
|
#6
|
|||
|
|||
|
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! |
|
#7
|
|||
|
|||
|
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.
|
|
#8
|
||||||
|
||||||
|
Re: Build succesful, but no robot code
That means you renamed or moved your robot class and now the roborio can't find it.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|