Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Analog Declaration Preventing All Robot Functions (http://www.chiefdelphi.com/forums/showthread.php?t=126458)

octopirates3502 14-02-2014 15:54

Analog Declaration Preventing All Robot Functions
 
In the process of building the robot for the 2014 game, we decided to use a potentiometer to figure out what angle our shooter was angled at. However, whenever I declare anything that would be plugged into an analog port (searched "analog" on http://robotics.francisparker.org/javadoc/) it renders all functions on the robot useless, and I receive the error "Robots don't quit!" What could be happening?

notmattlythgoe 14-02-2014 15:56

Re: Analog Declaration Preventing All Robot Functions
 
Have you tried this class yet?

http://robotics.francisparker.org/ja...ntiometer.html

BigJ 14-02-2014 16:02

Re: Analog Declaration Preventing All Robot Functions
 
My initial guess is that an exception is being thrown by the declaration or use of something related to the analog input in code. Look up in the output from the "Robots don't quit" message and see if there is a stack trace or error message explaining what the problem is (and post it here if you can't figure it out :) ).

octopirates3502 14-02-2014 16:55

Re: Analog Declaration Preventing All Robot Functions
 
Quote:

Originally Posted by BigJ (Post 1343210)
My initial guess is that an exception is being thrown by the declaration or use of something related to the analog input in code. Look up in the output from the "Robots don't quit" message and see if there is a stack trace or error message explaining what the problem is (and post it here if you can't figure it out :) ).

This is it

[cRIO] [Squawk VM] Version: 2011 FRC, Nov 5 2011, 14:34:13
[cRIO] FPGA Hardware GUID: 0x1394f6dc1feb42ec6910e5767ed1d22c
[cRIO] FPGA Software GUID: 0xa14c11bde4bb64aef6a86fc52a294cd9
[cRIO] edu.wpi.first.wpilibj.networktables2.server.Server ConnectionAdapter@8 entered connection state: GOT_CONNECTION_FROM_CLIENT
[cRIO] edu.wpi.first.wpilibj.networktables2.server.Server ConnectionAdapter@8 entered connection state: CONNECTED_TO_CLIENT
[cRIO] edu.wpi.first.wpilibj.util.AllocationException: Analog channel 8 on module 1 is already allocated
[cRIO] at edu.wpi.first.wpilibj.AnalogChannel.<init>(AnalogC hannel.java:68)
[cRIO] at edu.wpi.first.wpilibj.AnalogChannel.<init>(AnalogC hannel.java:49)
[cRIO] at edu.wpi.first.wpilibj.templates.subsystems.Basket. <clinit>(Basket.java:27)
[cRIO] in virtual method #109 of com.sun.squawk.Klass(bci=49)
[cRIO] in virtual method #106 of com.sun.squawk.Klass(bci=328)
[cRIO] in virtual method #105 of com.sun.squawk.Klass(bci=32)
[cRIO] in static method #25 of com.sun.squawk.VM(bci=4)
[cRIO] at edu.wpi.first.wpilibj.templates.commands.CommandBa se.<clinit>(CommandBase.java:20)
[cRIO] in virtual method #109 of com.sun.squawk.Klass(bci=49)
[cRIO] in virtual method #106 of com.sun.squawk.Klass(bci=328)
[cRIO] in virtual method #106 of com.sun.squawk.Klass(bci=156)
[cRIO] in virtual method #105 of com.sun.squawk.Klass(bci=32)
[cRIO] in static method #25 of com.sun.squawk.VM(bci=4)
[cRIO] at edu.wpi.first.wpilibj.templates.RobotTemplate.robo tInit(RobotTemplate.java:35)
[cRIO] at edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72)
[cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase .java:235)
[cRIO] in virtual method #10 of javax.microedition.midlet.MIDlet(bci=17)
[cRIO] at javax.microedition.midlet.MIDletTunnelImpl.callSta rtApp(64)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(110)
[cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO] at com.sun.squawk.Isolate.run(1506)
[cRIO] at java.lang.Thread.run(231)
[cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO] in static method #3 of com.sun.squawk.VM(bci=6)
[cRIO] java.lang.Error: ExceptionInInitializer: edu.wpi.first.wpilibj.templates.subsystems.Basket: edu.wpi.first.wpilibj.util.AllocationException: Analog channel 8 on module 1 is already allocated
[cRIO] in virtual method #106 of com.sun.squawk.Klass(bci=409)
[cRIO] in virtual method #105 of com.sun.squawk.Klass(bci=32)
[cRIO] in static method #25 of com.sun.squawk.VM(bci=4)
[cRIO] at edu.wpi.first.wpilibj.templates.commands.CommandBa se.<clinit>(CommandBase.java:20)
[cRIO] in virtual method #109 of com.sun.squawk.Klass(bci=49)
[cRIO] in virtual method #106 of com.sun.squawk.Klass(bci=328)
[cRIO] in virtual method #106 of com.sun.squawk.Klass(bci=156)
[cRIO] in virtual method #105 of com.sun.squawk.Klass(bci=32)
[cRIO] in static method #25 of com.sun.squawk.VM(bci=4)
[cRIO] at edu.wpi.first.wpilibj.templates.RobotTemplate.robo tInit(RobotTemplate.java:35)
[cRIO] at edu.wpi.first.wpilibj.IterativeRobot.startCompetit ion(IterativeRobot.java:72)
[cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase .java:235)
[cRIO] in virtual method #10 of javax.microedition.midlet.MIDlet(bci=17)
[cRIO] at javax.microedition.midlet.MIDletTunnelImpl.callSta rtApp(64)
[cRIO] at com.sun.squawk.imp.MIDletMainWrapper.main(110)
[cRIO] in virtual method #95 of com.sun.squawk.Klass(bci=25)
[cRIO] at com.sun.squawk.Isolate.run(1506)
[cRIO] at java.lang.Thread.run(231)
[cRIO] in virtual method #47 of com.sun.squawk.VMThread(bci=42)
[cRIO] in static method #3 of com.sun.squawk.VM(bci=6)
[cRIO] WARNING: Robots don't quit!
[cRIO] ---> The startCompetition() method (or methods called by it) should have handled the exception above.
[cRIO] task 0xca7f88 (worker.0) deleted: errno=0 (0) status=0 (0)

octopirates3502 14-02-2014 16:57

Re: Analog Declaration Preventing All Robot Functions
 
Quote:

Originally Posted by notmattlythgoe (Post 1343208)

yes, we did try that class. In the end, we settled to try the AnalogChannel class. In the code we have:

private static final AnalogChannel pot = new AnalogChannel(8);

but it just doesn't like the declaration

dvanvoorst 14-02-2014 17:02

Re: Analog Declaration Preventing All Robot Functions
 
In the middle of your diagnostic message, you'll see that it believes analog port 8 is already being used:

Code:

[cRIO] java.lang.Error: ExceptionInInitializer: edu.wpi.first.wpilibj.templates.subsystems.Basket: edu.wpi.first.wpilibj.util.AllocationException: Analog channel 8 on module 1 is already allocated
Try using a different port.

octopirates3502 14-02-2014 17:23

Re: Analog Declaration Preventing All Robot Functions
 
Quote:

Originally Posted by dvanvoorst (Post 1343235)
In the middle of your diagnostic message, you'll see that it believes analog port 8 is already being used:

Code:

[cRIO] java.lang.Error: ExceptionInInitializer: edu.wpi.first.wpilibj.templates.subsystems.Basket: edu.wpi.first.wpilibj.util.AllocationException: Analog channel 8 on module 1 is already allocated
Try using a different port.

It worked, thank you so much!

Joe Ross 14-02-2014 18:06

Re: Analog Declaration Preventing All Robot Functions
 
Port 8 is used to read the battery voltage.


All times are GMT -5. The time now is 11:34.

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