Go to Post FIRST is not a party. It is the most important activity a high school age student can do. - JohnBoucher [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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 11:36.

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