|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
CANNotInitializedException
We've been trying to get our CANJaguar code working, but it keeps returning the CANNotInitializedException.
Our code right now is Code:
public void robotInit(){
try {
CANJaguar armMotor = new CANJaguar (4, CANJaguar.ControlMode.kPosition);
} catch (CANTimeoutException ex){
ex.printStackTrace();
}
Code:
[Squawk VM] Version: 2011 FRC, Nov 5 2011, 14:34:13 [cRIO] FPGA Hardware GUID: 0x1394f6dc1feb42ec6910e5767ed1d22c [cRIO] FPGA Software GUID: 0xa14c11bde4bb64aef6a86fc52a294cd9 [cRIO] DIO LoopTiming: 260, expecting: 261 [cRIO] edu.wpi.first.wpilibj.can.CANNotInitializedException [cRIO] at edu.wpi.first.wpilibj.can.CANExceptionFactory.checkStatus(CANExceptionFactory.java:44) [cRIO] at edu.wpi.first.wpilibj.can.JaguarCANDriver.sendMessage(JaguarCANDriver.java:36) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.sendMessage(CANJaguar.java:574) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.getTransaction(CANJaguar.java:637) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.getFirmwareVersion(CANJaguar.java:1199) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.initCANJaguar(CANJaguar.java:247) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.<init>(CANJaguar.java:286) [cRIO] at edu.wpi.first.wpilibj.templates.RobotTemplate.robotInit(RobotTemplate.java:70) [cRIO] at edu.wpi.first.wpilibj.SimpleRobot.startCompetition(SimpleRobot.java:104) [cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase.java:156) [cRIO] in virtual method #10 of javax.microedition.midlet.MIDlet(bci=17) [cRIO] at javax.microedition.midlet.MIDletTunnelImpl.callStartApp(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 0x25c7bb8 (System Web Services Load Thread) deleted: errno=0 (0) status=0 (0) [cRIO] task 0x28784f8 (mDNS resolve) deleted: errno=0 (0) status=0 (0) [cRIO] task 0x2bff230 (mDNS resolve) deleted: errno=0 (0) status=0 (0) |
|
#2
|
|||
|
|||
|
Re: CANNotInitializedException
Also, you cannot define a jaguar inside of a code block (in this case, your "try" block, and then use it anywhere outside of the block. Outside of any method, but inside your class, type (you may have already done this):
Code:
CANJaguar armMotor; (Basically remove the CANJaguar variable marker): Code:
public void robotInit(){
try {
armMotor = new CANJaguar (4, CANJaguar.ControlMode.kPosition);
} catch (CANTimeoutException ex){
ex.printStackTrace();
}
|
|
#3
|
|||
|
|||
|
Re: CANNotInitializedException
The described error will occur if the cRIO has not had a CAN plugin set when the firmware was flashed. You need to re-image the cRIO to solve the problem.
|
|
#4
|
||||
|
||||
|
Re: CANNotInitializedException
AriTheHun, I believe you would be correct if the issue were a CANTimeoutException, but this is a CANNotInitializedException, which, as Metis said, is supposed to occur when the CAN Driver is not properly loaded.
|
|
#5
|
|||
|
|||
|
Re: CANNotInitializedException
So does it work if you select a CAN driver in the imaging tool?
|
|
#6
|
|||||
|
|||||
|
Re: CANNotInitializedException
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|