|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools |
Rating:
|
Display Modes |
|
|
|
#1
|
|||||
|
|||||
|
We have been having some trouble with the CANJaguars.
I have updated firmware, assigned IDs, and tested motors using BDC-Comm. The problem lies in running the code. When I enable the robot, I get this: Code:
[cRIO] NI-VISA Server 4.5 started successfully. [cRIO] task 0xe63670 (t1) deleted: errno=1835009 (0x1c0001) status=1 (0x1) [cRIO] FPGA Hardware GUID: 0x2EAA5E59CAF1A8A966853A011B61CC91 [cRIO] FPGA Software GUID: 0x2EAA5E59CAF1A8A966853A011B61CC91 [cRIO] FPGA Hardware Version: 2011 [cRIO] FPGA Software Version: 2011 [cRIO] FPGA Hardware Revision: 1.5.3 [cRIO] FPGA Software Revision: 1.5.3 [cRIO] * Loading StartupDlls: FRC_JavaVM [cRIO] [cRIO] [cRIO] [OTA Server] Version: 2011 FRC, Jan 6 2011, 09:47:42 [cRIO] [cRIO] [cRIO] Welcome to LabVIEW Real-Time 8.6.1f3 [cRIO] [cRIO] [Squawk VM] Version: 2011 FRC, Jan 17 2011, 16:12:19 [cRIO] [cRIO] [Squawk VM] Version: 2011 FRC, Jan 17 2011, 16:12:19 [cRIO] FPGA Hardware GUID: 0x2eaa5e59caf1a8a966853a011b61cc91 [cRIO] FPGA Software GUID: 0x2eaa5e59caf1a8a966853a011b61cc91 [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:29) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.sendMessage(CANJaguar.java:567) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.getTransaction(CANJaguar.java:630) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.getFirmwareVersion(CANJaguar.java:1192) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.initCANJaguar(CANJaguar.java:240) [cRIO] at edu.wpi.first.wpilibj.CANJaguar.<init>(CANJaguar.java:267) [cRIO] at edu.wpi.first.wpilibj.templates.RobotTemplate.robotInit(RobotTemplate.java:30) [cRIO] at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:73) [cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase.java:154) [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] Default IterativeRobot.disabledInit() method... Overload me! [cRIO] Default IterativeRobot.disabledContinuous() method... Overload me! [cRIO] Default IterativeRobot.disabledPeriodic() method... Overload me! [cRIO] Default IterativeRobot.teleopInit() method... Overload me! [cRIO] java.lang.NullPointerException [cRIO] at edu.wpi.first.wpilibj.templates.RobotTemplate.teleopPeriodic(RobotTemplate.java:46) [cRIO] at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:141) [cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase.java:154) [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] Default IterativeRobot.teleopContinuous() method... Overload me! [cRIO] java.lang.NullPointerException [cRIO] at edu.wpi.first.wpilibj.templates.RobotTemplate.teleopPeriodic(RobotTemplate.java:46) [cRIO] at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:141) [cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase.java:154) [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] java.lang.NullPointerException [cRIO] at edu.wpi.first.wpilibj.templates.RobotTemplate.teleopPeriodic(RobotTemplate.java:46) [cRIO] at edu.wpi.first.wpilibj.IterativeRobot.startCompetition(IterativeRobot.java:141) [cRIO] at edu.wpi.first.wpilibj.RobotBase.startApp(RobotBase.java:154) [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) Here is my code: Code:
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
package edu.wpi.first.wpilibj.templates;
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.CANJaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.SpeedController;
/**
* The VM is configured to automatically run this class, and to call the
* functions corresponding to each mode, as described in the IterativeRobot
* documentation. If you change the name of this class or the package after
* creating this project, you must also update the manifest file in the resource
* directory.
*/
public class RobotTemplate extends IterativeRobot {
Joystick gp = new Joystick(1); //GamePad
CANJaguar leftA;
CANJaguar leftB;
CANJaguar rightA;
CANJaguar rightB;
public void robotInit() {
try {
leftA = new CANJaguar(2);
leftB = new CANJaguar(3);
rightA = new CANJaguar(4);
rightB = new CANJaguar(5);
} catch(Exception e) {
e.printStackTrace();
}
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
try {
//Tank Drive, Gamepad
try {
leftA.setX(gp.getRawAxis(2));
leftB.setX(gp.getRawAxis(2));
rightA.setX(gp.getRawAxis(4));
rightB.setX(gp.getRawAxis(4));
} catch(Exception e) {
e.printStackTrace();
}
} catch (edu.wpi.first.wpilibj.can.CANNotInitializedException cnie) {
cnie.printStackTrace();
}
}
}
|
|
#2
|
|||
|
|||
|
Re: Java CAN-Bus Issue
Is that the entire log?
I dont see where the can plugin is being loaded . . . did you re-image the crio to v25 with the can plugin selected? |
|
#3
|
|||||
|
|||||
|
Re: Java CAN-Bus Issue
That is an excerpt. I cut some out for space.
The plugin loads fine. I have reimaged it with the 2011 Serial to CAN driver, V25. I am sure the cables are fine, as I have salvaged them from our Breakaway bot. Everything is fine, up until the point where I enable the robot. If you need any more info, I can try to do it again tomorrow. Thanks In Advance! |
|
#4
|
|||
|
|||
|
Re: Java CAN-Bus Issue
If you look carefully one of the jags doesn't initialize properly which is called BEFORE you enable it. Are you sure your jags are numbered 2 3 4 5 instead of 1 2 3 4?
|
|
#5
|
|||||
|
|||||
|
Re: Java CAN-Bus Issue
I am 90% sure that I have them numbered 2-5. I will check when I am in our shop in a few hours. Thanks!
|
|
#6
|
|||
|
|||
|
Re: Java CAN-Bus Issue
Quote:
-Joe |
|
#7
|
|||||
|
|||||
|
Re: Java CAN-Bus Issue
Thanks you two. I've reimaged it and it works now!
![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|