|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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?
|
|
#2
|
|||||
|
|||||
|
Re: Analog Declaration Preventing All Robot Functions
|
|
#3
|
|||
|
|||
|
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
). |
|
#4
|
|||
|
|||
|
Re: Analog Declaration Preventing All Robot Functions
Quote:
[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) |
|
#5
|
|||
|
|||
|
Re: Analog Declaration Preventing All Robot Functions
Quote:
private static final AnalogChannel pot = new AnalogChannel(8); but it just doesn't like the declaration |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
Re: Analog Declaration Preventing All Robot Functions
Quote:
|
|
#8
|
||||||
|
||||||
|
Re: Analog Declaration Preventing All Robot Functions
Port 8 is used to read the battery voltage.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|