Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Technical Discussion (http://www.chiefdelphi.com/forums/forumdisplay.php?f=22)
-   -   Reboot roboRio After Uploading Code [Java] (http://www.chiefdelphi.com/forums/showthread.php?t=133441)

DeeWBee 24-01-2015 12:39

Reboot roboRio After Uploading Code [Java]
 
Hello!

I am programmer for Team 3630 from Breck School in Golden Valley, Minnesota. I've run into an interesting issue... I've successfully imaged the roboRio and can upload code to it from Eclipse no problem. But every time I upload code I am forced to reboot the roboRio! I'll upload the code and the DriverStation will show green across the board, but the moment I hit Enable, I magically don't have robot code and the only fix is to reboot the roboRio from the DriverStation. I must be doing something wrong because I was specifcally told I would never have to reboot the roboRio. Any help is appreciated!

Best

tanguma26 24-01-2015 13:04

Re: Reboot roboRio After Uploading Code [Java]
 
We had a similar issue last night when we try to get our code into the Rio the only thing that we could see it was that somewhere in the code there was a mistake and after it got fixed we never had that problem again.

Can you put an image of your code maybe we can help you?

DeeWBee 24-01-2015 13:16

Re: Reboot roboRio After Uploading Code [Java]
 
This code is dirt simple so I doubt it's a code issue but here you go. We've had this issue from the beginning even with sample code.


Code:

package org.usfirst.frc.team3630.robot;
//import the necessary packages for each class
import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.DigitalInput;
import edu.wpi.first.wpilibj.Talon;


/**
 * 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 Robot extends IterativeRobot {
        //Declare and name the drive train object 
        RobotDrive driveTrain;
       
        //Declare and name the two joystick objects
        Joystick leftStick;
        Joystick rightStick;
       
        //Declare and name the two front bumper objects
        DigitalInput leftBumper;
        DigitalInput rightBumper;
       
        //Declare and name the four motor controllers for the drive train
        Talon frontLeft;
        Talon rearLeft;
        Talon frontRight;
        Talon rearRight;
       
       
    /**
    * This function is run when the robot is first started up and should be
    * used for any initialization code.
    */
    public void robotInit() {
            //Construct the two joystick objects
            leftStick = new Joystick(1);
            rightStick = new Joystick(2);
           
            //Construct the two front bumper objects
            rightBumper = new DigitalInput(0);
            leftBumper = new DigitalInput(1);
           
            //Construct the four motor controller objects
            frontLeft = new Talon(1);
            rearLeft = new Talon(2);
            frontRight = new Talon(3);
            rearRight = new Talon(4);
           
            //Construct the drive train object
            driveTrain = new RobotDrive(frontLeft, rearLeft, frontRight, rearRight);
           
            //Invert the right motors in the drive train
            driveTrain.setInvertedMotor(RobotDrive.MotorType.kFrontRight, true);
            driveTrain.setInvertedMotor(RobotDrive.MotorType.kRearRight, true);
   
    }

    /**
    * This function is called periodically during autonomous
    */
    public void autonomousPeriodic() {

    }

    /**
    * This function is called periodically during operator control
    */
    public void teleopPeriodic() {
            //Define the drive train as mecanum
            driveTrain.mecanumDrive_Cartesian(leftStick.getX(), leftStick.getY(), rightStick.getX(), 0);
       
            //If the right bumper is hit, stop the right motors
            if(rightBumper.get() == false) {
                frontRight.set(0);
                rearRight.set(0);
        }
           
            //If the left bumper is hit, stop the left motors
            if(leftBumper.get() == false) {
                    frontLeft.set(0);
                    rearLeft.set(0);
            }
    }
   
    /**
    * This function is called periodically during test mode
    */
    public void testPeriodic() {
   
    }
   
}


gerthworm 29-01-2015 12:06

Re: Reboot roboRio After Uploading Code [Java]
 
Try opening the Riolog in eclipse, then reset and enable your code. We had similar issues due to null pointer exceptions that crashed the code running on the roboRIO. It was kind enough to print out the issue to the Riolog before dying, though.

I believe the same messages should get sent to the driver station though, I don't know if you're seeing anything there too...

mail929 29-01-2015 17:44

Re: Reboot roboRio After Uploading Code [Java]
 
We had a similar problem with the beta. I don't remember if we found a solution but we at least discovered the using the blue reset button was much faster than doing a full reboot.


All times are GMT -5. The time now is 14:10.

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