How do deploy code with Eclipse?

I’ve been trying to deploy code to the roborio for a few days now. It’s not connecting to the driver station either. It finds it in eclipse but it shows this

    [echo] [athena-deploy] Copying code over.
      [scp] Connecting to roboRIO-3335.local:22
      [scp] done.
      [scp] Connecting to roboRIO-3335.local:22
      [scp] done.
     [echo] [athena-deploy] Starting program.
  [sshexec] Connecting to roboRIO-3335.local:22
  [sshexec] cmd : . /etc/profile.d/natinst-path.sh; /usr/local/frc/bin/frcKillRobot.sh -t -r;
  [sshexec] start-stop-daemon: warning: killing process 3227: No such process
BUILD SUCCESSFUL
Total time: 8 seconds

and here’s the code


package org.usfirst.frc.team3335.robot;

/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

import edu.wpi.first.wpilibj.*;
import edu.wpi.first.wpilibj.vision.*;

public class Robot extends IterativeRobot {

    private Joystick controller;
    private RobotDrive drive;
    private SpeedController one, two, three, four, lift;
    private AxisCamera camera;
    private DigitalInput limit;

    public void robotInit() {
        joystickInit();
        sensorInit();
        robotDriveInit();
        speedControllerInit();
    }

    public void sensorInit() {
        limit = new DigitalInput(1);
    }

    public void joystickInit() {
        controller = new Joystick(1);
    }

    public void robotDriveInit() {
        drive = new RobotDrive(one, two, three, four);
    }

    public void speedControllerInit() {
        one = new Talon(1);
        two = new Talon(2);
        three = new Talon(3);
        four = new Talon(4);
        lift = new Talon(5);
    }

    public void autonomousPeriodic() {

    }

    public void teleopPeriodic() {
        double y = getDeadZone(controller.getY(), 0.1);
        double x = getDeadZone(controller.getThrottle(), 0.1);
        drive.arcadeDrive(y, x);
         if (controller.getAxis(Joystick.AxisType.kZ) > 0.8) {
                two.set(-1);
            } else if (controller.getAxis(Joystick.AxisType.kZ) < -0.8 && limit.get()) {
                two.set(1);
            } else {
                two.set(0);
            }
    }
    public void testPeriodic() {

    }

    public double getDeadZone(double axis, double zone) {

        return Math.abs(axis) > zone ? axis : 0;
    }
}

does this mean it was successful? I’m so confused. This is my first time using eclipse. And if anyone knows as to the roborio’s:confused not wanting to show up on the driver station, it’d be a great help.

Yes, that looks like a successful code deployment. If you’re having issues though you should check for errors in the driver station log.

What is Error 44009 on the driver station?

Never mind. I still don’t understand why it won’t connect. All the firmware has been uploaded and the image updated. The code has been deployed and yet nothing.

Alright I’ll ask the somewhat obvious questions lol.

Are you using the new driverstation, have you entered your team number into the driverstation, and how are you connecting to the rRIO?

It is the new driverstation, I have entered the team number into the driverstation, and I’m connected via ethernet cable. I’ve also tried with the type a to type b usb cable.

Also, joysticks (and talons?) have a 0-index now. That code won’t run unless your joystick is in slot 2.

Are you saying I should put controller = new Joystick(2); ?

What he’s saying is that the roboRIO uses something called 0-indexed IO This means that the joystick (and all other IO identifiers) numbers go 0, 1, 2, 3. For the first, second, third and fourth ports respecivly

Your code:

controller = new Joystick(1);

sets up joystick in port 1, which is actually the SECOND port.

To solve this you can either
a) change the code to

controller = new Joystick(0);

b) change the driverstation so that the joystick goes into the SECOND port.

I recomend the first.

Onto your main problem.

When connected via ethernet, could you post the output of “ipconfig”
Are you getting No Robot Code, Comunications, or is it just not doing anything when you enable?

Now I’m getting communications. It just says there’s no robot code.


package org.usfirst.frc.team3335.robot;

/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.                             */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project.                                                               */
/*----------------------------------------------------------------------------*/

import edu.wpi.first.wpilibj.*;
import edu.wpi.first.wpilibj.vision.*;

public class Robot extends IterativeRobot {

    private Joystick controller;
    private RobotDrive drive;
    private SpeedController one, two, three, four, lift;
    private AxisCamera camera;
    private DigitalInput limit;

    public void robotInit() {
        joystickInit();
        sensorInit();
        robotDriveInit();
        speedControllerInit();
    }

    public void sensorInit() {
        limit = new DigitalInput(0);
    }

    public void joystickInit() {
        controller = new Joystick(0);
    }

    public void robotDriveInit() {
        drive = new RobotDrive(one, two, three, four);
    }

    public void speedControllerInit() {
        one = new Victor(0);
        two = new Victor(1);
        three = new Victor(2);
        four = new Victor(3);
        lift = new Victor(4);
    }

    public void autonomousPeriodic() {

    }

    public void teleopPeriodic() {
        double y = getDeadZone(controller.getY(), 0.1);
        double x = getDeadZone(controller.getThrottle(), 0.1);
        drive.arcadeDrive(y,x);
         if (controller.getAxis(Joystick.AxisType.kZ) > 0.8) {
                two.set(-1);
            } else if (controller.getAxis(Joystick.AxisType.kZ) < -0.8 && limit.get()) {
                two.set(1);
            } else {
                two.set(0);
            }
    }
    public void testPeriodic() {

    }

    public double getDeadZone(double axis, double zone) {

        return Math.abs(axis) > zone ? axis : 0;
    }
}
 

This should work, right?

Okay. There is a problem in the code. When I remove the RobotDrive, the robot code shows up on the driverstation. What’s happening here?

Your SpeedController objects should have a type of Victor, not SpeedController.

No, that’s fine. What is likely happening is that you’re initializing your speed controllers AFTER you initialize drive. They are null when passed to new RobotDrive(), which should throw a null pointer exception and crash. Try initializing the controllers before the drive.

How silly of me x.x I forget that it matters which initialize first. Thank you for your help!

Everything’s working now. Thank you everybody!