View Full Version : Analog Declaration Preventing All Robot Functions
octopirates3502
14-02-2014, 15:54
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
Have you tried this class yet?
http://robotics.francisparker.org/javadoc/edu/wpi/first/wpilibj/AnalogPotentiometer.html
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
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>(AnalogChannel.java:68)
[cRIO] at edu.wpi.first.wpilibj.AnalogChannel.<init>(AnalogChannel.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
Have you tried this class yet?
http://robotics.francisparker.org/javadoc/edu/wpi/first/wpilibj/AnalogPotentiometer.html
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
In the middle of your diagnostic message, you'll see that it believes analog port 8 is already being used:
[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
In the middle of your diagnostic message, you'll see that it believes analog port 8 is already being used:
[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
Port 8 is used to read the battery voltage.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.