Go to Post Practice bots are not regulated by FIRST. Your practice bot could have a flamethrower and a jamming device on it, and they wouldn't care in the slightest. You just can't compete at a competition with it. :) - AlecMataloni [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-01-2015, 23:41
Tyler Scheuble Tyler Scheuble is offline
Programming Lead
FRC #2471 (Team Mean Machine)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Vancouver, WA
Posts: 15
Tyler Scheuble is an unknown quantity at this point
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.

EDIT: Formatting

Last edited by Tyler Scheuble : 17-01-2015 at 12:45.
Reply With Quote
  #2   Spotlight this post!  
Unread 17-01-2015, 08:27
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
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?
Reply With Quote
  #3   Spotlight this post!  
Unread 17-01-2015, 12:44
Tyler Scheuble Tyler Scheuble is offline
Programming Lead
FRC #2471 (Team Mean Machine)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Vancouver, WA
Posts: 15
Tyler Scheuble is an unknown quantity at this point
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
Reply With Quote
  #4   Spotlight this post!  
Unread 17-01-2015, 12:49
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,572
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: CANJaguar errors on driver station after deploying code

If the jaguars were properly connected, they would show up under CAN, like attached.
Attached Thumbnails
Click image for larger version

Name:	CAN Jaguar.PNG
Views:	27
Size:	37.0 KB
ID:	17880  
Reply With Quote
  #5   Spotlight this post!  
Unread 17-01-2015, 12:50
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 989
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: CANJaguar errors on driver station after deploying code

Quote:
Originally Posted by Tyler Scheuble View Post
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 17-01-2015, 13:06
Tyler Scheuble Tyler Scheuble is offline
Programming Lead
FRC #2471 (Team Mean Machine)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Vancouver, WA
Posts: 15
Tyler Scheuble is an unknown quantity at this point
Re: CANJaguar errors on driver station after deploying code

Ok we are in the process of rewiring the jags now. Thank you!
Reply With Quote
  #7   Spotlight this post!  
Unread 17-01-2015, 14:46
Tyler Scheuble Tyler Scheuble is offline
Programming Lead
FRC #2471 (Team Mean Machine)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Vancouver, WA
Posts: 15
Tyler Scheuble is an unknown quantity at this point
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.
Reply With Quote
  #8   Spotlight this post!  
Unread 20-01-2015, 18:50
blueForest blueForest is offline
Registered User
FRC #2228
 
Join Date: Aug 2013
Location: Honeoye Falls NY
Posts: 1
blueForest is an unknown quantity at this point
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)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:31.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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