Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   CANJaguar errors on driver station after deploying code (http://www.chiefdelphi.com/forums/showthread.php?t=133029)

Tyler Scheuble 16-01-2015 23:41

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)]

Screenshot

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
        }
       
    }
}

I have tried replacing SpeedController with CANJaguar but as far as the robot is concerned both results are exactly the same.:confused:

EDIT: Formatting

RufflesRidge 17-01-2015 08:27

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?

Tyler Scheuble 17-01-2015 12:44

Re: CANJaguar errors on driver station after deploying code
 
Quote:

Have you checked to make sure that you can see that CANJaguar using the roboRIO webdashboard?
I am having problems finding out where to get that. Does this screenshot make sense for you?
http://puu.sh/eEcav/f85f6c8588.png

Joe Ross 17-01-2015 12:49

Re: CANJaguar errors on driver station after deploying code
 
1 Attachment(s)
If the jaguars were properly connected, they would show up under CAN, like attached.

RufflesRidge 17-01-2015 12:50

Re: CANJaguar errors on driver station after deploying code
 
Quote:

Originally Posted by Tyler Scheuble (Post 1429617)
I am having problems finding out where to get that. Does this screenshot make sense for you?
http://puu.sh/eEcav/f85f6c8588.png

It does and it indicates that your roboRIO sees no devices on the CAN bus (or you took it shortly after boot-up and you need to refresh the page).

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.

Tyler Scheuble 17-01-2015 13:06

Re: CANJaguar errors on driver station after deploying code
 
Ok we are in the process of rewiring the jags now. Thank you!

Tyler Scheuble 17-01-2015 14:46

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.

blueForest 20-01-2015 18:50

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)


All times are GMT -5. The time now is 11:36.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi