|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
CANJaguar errors on driver station after deploying code
My team is switching from C++ to java this year and to be honest I have actually no idea what I am doing
![]() We have set up eclipse (64 bit version) and are now trying to program our testbed, and the sample program seems to run fine until we try defining the IDs, where if the code is uncommented we get this error in the driver station: Code:
ERROR Unhandled exception instantiating robot org.usfirst.frc.team2517.robot.Robot edu.wpi.first.wpilibj.can.CANMessageNotFoundException at [edu.wpi.first.wpilibj.CANJaguar.<init>(CANJaguar.java:210), org.usfirst.frc.team2517.robot.Robot.<init>(Robot.java:26), sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method), sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62), sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45), java.lang.reflect.Constructor.newInstance(Constructor.java:408), java.lang.Class.newInstance(Class.java:433), edu.wpi.first.wpilibj.RobotBase.main(RobotBase.java:197)] The code we are using: Code:
package org.usfirst.frc.team2517.robot;
import edu.wpi.first.wpilibj.*;
/*
* This sample program shows how to control a motor using a joystick. In the operator
* control part of the program, the joystick is read and the value is written to the motor.
*
* Joystick analog values range from -1 to 1 and speed controller inputs also range from -1
* to 1 making it easy to work together. The program also delays a short time in the loop
* to allow other threads to run. This is generally a good idea, especially since the joystick
* values are only transmitted from the Driver Station once every 20ms.
*/
public class Robot extends SampleRobot {
private SpeedController motorTurn;
private SpeedController motorMove;
private Joystick stick;
private final double k_updatePeriod = 0.005; // update every 0.005 seconds/5 milliseconds (200Hz)
public Robot() {
// motorTurn = new CANJaguar(4);
motorMove = new CANJaguar(13);
stick = new Joystick(0); // initialize the joystick on port 0
}
/*
* Runs the motor from a joystick.
*/
public void operatorControl() {
while (isOperatorControl() && isEnabled()) {
// Set the motor's output.
// This takes a number from -1 (100% speed in reverse) to +1 (100% speed going forward)
motorTurn.set(stick.getRawAxis(2));
motorMove.set(stick.getRawAxis(1));
Timer.delay(k_updatePeriod); // wait 5ms to the next update
}
}
}
![]() EDIT: Formatting Last edited by Tyler Scheuble : 17-01-2015 at 12:45. |
|
#2
|
|||
|
|||
|
Re: CANJaguar errors on driver station after deploying code
Have you checked to make sure that you can see that CANJaguar using the roboRIO webdashboard?
|
|
#3
|
|||
|
|||
|
Re: CANJaguar errors on driver station after deploying code
Quote:
http://puu.sh/eEcav/f85f6c8588.png |
|
#4
|
||||||
|
||||||
|
Re: CANJaguar errors on driver station after deploying code
If the jaguars were properly connected, they would show up under CAN, like attached.
|
|
#5
|
|||
|
|||
|
Re: CANJaguar errors on driver station after deploying code
Quote:
Check your CAN wiring (I would try taking the Jags out of the chain and wiring from roboRIO to PCM if used) to PDP and see if you can get at least one device to show up, then start adding Jags to see where the cabling issue is. |
|
#6
|
|||
|
|||
|
Re: CANJaguar errors on driver station after deploying code
Ok we are in the process of rewiring the jags now. Thank you!
|
|
#7
|
|||
|
|||
|
Re: CANJaguar errors on driver station after deploying code
We have tested, found and then replaced a wire that was stopping CAN as a whole, and now we are able to connect to the PCM and PDP, but the jags are still not being recognized. Here is a screenshot of our CAN connections:
http://puu.sh/eEuXx/a318618a2d.png We aren't sure if this is a firmware problem but we installed the version from the update suite. The version number is 2.1.0f3. |
|
#8
|
|||
|
|||
|
Re: CANJaguar errors on driver station after deploying code
my team is also experiencing this issue but for us it has been appearing at seemingly random times, and then the issue disappears.
Currently the we have two versions of the code, on works one throws CANMessageNotFound However i cannot figure out what the difference is that is causing the error, as they should both be doing effectively the same thing Anyway, our code is at https://github.com/cougarTech2228/Dr...team2228/robot (the working code that is, the error inducing version is in the master branch) (warning the code may have changed since this post) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|