Go to Post I was surprised how easily Mike hoisted me off the ground. I'm nearly 250 pounds and he lifted me up like I was a soccer ball! :ahh: - Koko Ed [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 Rating: Thread Rating: 5 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 14-01-2015, 21:10
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
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
Code:
    [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
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.
__________________
Wait, what?
Reply With Quote
  #2   Spotlight this post!  
Unread 14-01-2015, 21:13
Team3266Spencer's Avatar
Team3266Spencer Team3266Spencer is offline
Team Captain and Lead Programmer
AKA: Spencer Lanman
FRC #3266 (Robots-R-US)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Richmond, Indiana
Posts: 280
Team3266Spencer is an unknown quantity at this point
Re: How do deploy code with Eclipse?

Yes, that looks like a successful code deployment. If you're having issues though you should check for errors in the driver station log.
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
Reply With Quote
  #3   Spotlight this post!  
Unread 14-01-2015, 21:20
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: How do deploy code with Eclipse?

What is Error 44009 on the driver station?
__________________
Wait, what?
Reply With Quote
  #4   Spotlight this post!  
Unread 14-01-2015, 21:36
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: How do deploy code with Eclipse?

Quote:
Originally Posted by Mr.Roboto3335 View Post
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.
__________________
Wait, what?
Reply With Quote
  #5   Spotlight this post!  
Unread 14-01-2015, 22:10
Team3266Spencer's Avatar
Team3266Spencer Team3266Spencer is offline
Team Captain and Lead Programmer
AKA: Spencer Lanman
FRC #3266 (Robots-R-US)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Richmond, Indiana
Posts: 280
Team3266Spencer is an unknown quantity at this point
Re: How do deploy code with Eclipse?

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?
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
Reply With Quote
  #6   Spotlight this post!  
Unread 15-01-2015, 11:08
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: How do deploy code with Eclipse?

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.
__________________
Wait, what?
Reply With Quote
  #7   Spotlight this post!  
Unread 15-01-2015, 11:20
Ozuru's Avatar
Ozuru Ozuru is offline
It's always the programmer's fault.
no team
 
Join Date: May 2013
Rookie Year: 2010
Location: Earth
Posts: 268
Ozuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to beholdOzuru is a splendid one to behold
Re: How do deploy code with Eclipse?

Also, joysticks (and talons?) have a 0-index now. That code won't run unless your joystick is in slot 2.
Reply With Quote
  #8   Spotlight this post!  
Unread 15-01-2015, 20:11
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: How do deploy code with Eclipse?

Are you saying I should put controller = new Joystick(2); ?
__________________
Wait, what?
Reply With Quote
  #9   Spotlight this post!  
Unread 15-01-2015, 20:24
timytamy's Avatar
timytamy timytamy is offline
Registered User
AKA: Tim
FRC #3132 (The Thunder Down Under)
Team Role: Electrical
 
Join Date: Nov 2009
Rookie Year: 2010
Location: Australia
Posts: 293
timytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant futuretimytamy has a brilliant future
Re: How do deploy code with Eclipse?

Quote:
Originally Posted by Mr.Roboto3335 View Post
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:
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
Code:
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?
__________________
Tim W
FIRST® Team 3132 - The Thunder Down Under
Sydney, Australia
Website | Facebook | Youtube
Reply With Quote
  #10   Spotlight this post!  
Unread 15-01-2015, 20:27
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: How do deploy code with Eclipse?

Now I'm getting communications. It just says there's no robot code.
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?
__________________
Wait, what?

Last edited by Mr.Roboto3335 : 15-01-2015 at 20:30.
Reply With Quote
  #11   Spotlight this post!  
Unread 15-01-2015, 20:57
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: How do deploy code with Eclipse?

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?
__________________
Wait, what?
Reply With Quote
  #12   Spotlight this post!  
Unread 15-01-2015, 21:26
Team3266Spencer's Avatar
Team3266Spencer Team3266Spencer is offline
Team Captain and Lead Programmer
AKA: Spencer Lanman
FRC #3266 (Robots-R-US)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Richmond, Indiana
Posts: 280
Team3266Spencer is an unknown quantity at this point
Re: How do deploy code with Eclipse?

Your SpeedController objects should have a type of Victor, not SpeedController.
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
Reply With Quote
  #13   Spotlight this post!  
Unread 16-01-2015, 00:51
fsilberberg fsilberberg is offline
WPILib Developer
AKA: Fred Silberberg
FRC #0190
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Redmond
Posts: 148
fsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura aboutfsilberberg has a spectacular aura about
Re: How do deploy code with Eclipse?

Quote:
Originally Posted by Team3266Spencer View Post
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.
Reply With Quote
  #14   Spotlight this post!  
Unread 16-01-2015, 13:34
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: How do deploy code with Eclipse?

How silly of me x.x I forget that it matters which initialize first. Thank you for your help!
__________________
Wait, what?
Reply With Quote
  #15   Spotlight this post!  
Unread 16-01-2015, 18:33
Mr.Roboto3335's Avatar
Mr.Roboto3335 Mr.Roboto3335 is offline
Wait, What?
AKA: Jimmy
FRC #3335 (Cy-Borgs)
Team Role: Programmer
 
Join Date: Nov 2011
Rookie Year: 2011
Location: Texas
Posts: 47
Mr.Roboto3335 is an unknown quantity at this point
Re: How do deploy code with Eclipse?

Everything's working now. Thank you everybody!
__________________
Wait, what?
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 18:08.

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