Go to Post I'm liking this. Programmers wont. But I will. :D - Rion Atkinson [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 12-11-2012, 12:59
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Java Code Deploying Help

Hey CD

we have recently decided to use Java to code our robot.

but here we have a problem:
everytime we build/deploy the code in Netbeans we get the following message

Waiting to Connect to OTA command server of 10.21.85.2:8001 for the past 10 sec

this message keeps going on and never stops

Would you please help us and tell us what should so or what we did wrong
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #2   Spotlight this post!  
Unread 12-11-2012, 13:10
krieck's Avatar
krieck krieck is offline
Registered User
AKA: Keith
FRC #2846 (Firebears)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Minnesota
Posts: 49
krieck is an unknown quantity at this point
Re: Java Code Deploying Help

Netbeans deploys code by FTPing it into your cRIO. My guess is that you aren't making the network connection into the robot.

The first thing to check is whether your Netbeans is configured with your team number, since that will determine what IP address it's trying to connect to. Open the Netbeans preferences dialog and select Miscellaneous / FRC configuration to set it.

Next check that your computer is on the correct subnet for the cRIO. The subnet IP addresses are based on your team number.

If you open a command window, you should be able to "ping" or "ftp" straight to the cRIO. This will help diagnosing network problems.
Reply With Quote
  #3   Spotlight this post!  
Unread 12-11-2012, 13:12
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Java Code Deploying Help

Are you sure that the robot is connected properly to your computer/laptop? If connecting times out, that probably means that it is not connected right. Make sure you've set the IP correctly.
__________________
All opinions are my own.
Reply With Quote
  #4   Spotlight this post!  
Unread 12-11-2012, 16:21
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Post Re: Java Code Deploying Help

Thanks very much, we fixed that problem but now a new message pops up.

This time when we deploy the code:
if does everything but it gets stuck on this line:

Code:
[cRIO] GCs: 1 full, 0 partial
[cRIO] ** VM stopped: exit code = 1 **
[cRIO] task 0xdaa8c0 (SquawkRobotTask) deleted: errno=0 (0) status = 1 (0x1)
The consol does not pass this line and gets stuck here
Could you please help me solve this issue
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #5   Spotlight this post!  
Unread 12-11-2012, 16:30
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Java Code Deploying Help

Quote:
Originally Posted by 2185Bilal View Post
** VM stopped: exit code = 1 **
That means that somewhere (I'm assuming in the WPIlibj or squawk), this is called.
Code:
System.exit(1);
If you could figure out what you're doing in your code that would cause to API to shutdown on you like that, you'll find out why that comes up. It's possible this might be something to do with how you deployed. (Did you image your CRIO correctly? Have you run java code on it before?)
__________________
All opinions are my own.
Reply With Quote
  #6   Spotlight this post!  
Unread 12-11-2012, 17:10
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Re: Java Code Deploying Help

Quote:
Originally Posted by joelg236 View Post
That means that somewhere (I'm assuming in the WPIlibj or squawk), this is called.
Code:
System.exit(1);
If you could figure out what you're doing in your code that would cause to API to shutdown on you like that, you'll find out why that comes up. It's possible this might be something to do with how you deployed. (Did you image your CRIO correctly? Have you run java code on it before?)
Well, for the 2012 season we were using Labview, but this year we decided to use Java. So today, I re imaged the cRIO to work in a Java Developing Environment and I also formatted the image. And we have never run java on the cRIO before.

The way we deployed the code, was basically connected to our cRIO using a direct ethernet cable, we opened the Driver Station program and it showed us that we had communication. Then we opened netbeans and pressed the green play button to deploy the code. It did all the stuff it shoudl (built the project, downloaded it, rebooted the cRIO) and then it stops at the line that i posted before.

I am not sure if this is a programming issue or electrical issue. and also if it would be helpful, i can post my code in this thread
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #7   Spotlight this post!  
Unread 12-11-2012, 18:19
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Java Code Deploying Help

Quote:
i can post my code in this thread
Sure, do that.
__________________
All opinions are my own.
Reply With Quote
  #8   Spotlight this post!  
Unread 12-11-2012, 20:06
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Re: Java Code Deploying Help

sure here it is:

Code:
package team2185.code.exhibtionCode;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.Watchdog;

public class ExhibtionCode extends IterativeRobot {
    
    // DEFINING THE JAGUARS
    Jaguar lm1 = new Jaguar(1); // left motor
    Jaguar lm2 = new Jaguar(2);
    Jaguar rm1 = new Jaguar(3); // right motor
    Jaguar rm2 = new Jaguar(4);
    
    RobotDrive driveSys = new RobotDrive (lm1, lm2, rm1, rm2);
    
    Joystick control = new Joystick(1);
    
//****************************************************************************//    
    
    public void robotInit() {
        // INITIALIZATION CODE
        // code in here runs when the robot first starts up    
    }
    
    public void autonomousInit() {
        for(int i=0; i<4; i++){
            driveSys.drive(0.5,0);
            Timer.delay(2.0);
            driveSys.drive(0,0.75);
            Timer.delay(1.0);
        }
    }
    
    public void teleopInit() {
        // TELEOPERATED INTIALIZATION CODE
        // runs only once at the start of the teleop period
    }

//****************************************************************************//
    
    public void autonomousPeriodic() {
        // called periodically during the autonomous period
    }
    
    public void teleopPeriodic() {
        if (control.getRawButton(1)){ // if button 1 pressed drive at full speed
            driveSys.tankDrive(control, 2, control, 5);
        }else {                       // else drive at half speed 
            driveSys.tankDrive(control, 2, control, 5);
            driveSys.setMaxOutput(0.5);
        }
    }

//****************************************************************************//
    
    public void disabledInit() {
        driveSys.drive(0.0, 0.0);
    }
}
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #9   Spotlight this post!  
Unread 12-11-2012, 20:47
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Java Code Deploying Help

That code looks all right. Not sure of your intentions for it (A button to go full speed?), but from an error standpoint, it looks all good. If I were you, I'd reimage the CRIO and possibly reinstall the FRC plugins (Maybe compiling is going wrong and the bytecode won't run).
__________________
All opinions are my own.
Reply With Quote
  #10   Spotlight this post!  
Unread 12-11-2012, 21:53
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Re: Java Code Deploying Help

Okay, I did that and I will try that out tmw in school.

Also is any other advice you can give me
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #11   Spotlight this post!  
Unread 12-11-2012, 22:09
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Java Code Deploying Help

In this :
Code:
public void teleopPeriodic() {
        if (control.getRawButton(1)){ // if button 1 pressed drive at full speed
            driveSys.tankDrive(control, 2, control, 5);
        }else {                       // else drive at half speed 
            driveSys.tankDrive(control, 2, control, 5);
            driveSys.setMaxOutput(0.5);
        }
    }
Make sure you setMaxOutput() back to 1 when the button is pressed. So,
Code:
public void teleopPeriodic() {
        if (control.getRawButton(1)){ // if button 1 pressed drive at full speed
            driveSys.tankDrive(control, 2, control, 5);
            driveSys.setMaxOutput(1);
        }else {                       // else drive at half speed 
            driveSys.tankDrive(control, 2, control, 5);
            driveSys.setMaxOutput(0.5);
        }
    }
__________________
All opinions are my own.
Reply With Quote
  #12   Spotlight this post!  
Unread 13-11-2012, 06:56
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Re: Java Code Deploying Help

I meant some advice that would help me to deloy the code. Could you like tell me how teams deploy the code and what should the ip address be of the pc and crio
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #13   Spotlight this post!  
Unread 13-11-2012, 17:48
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Re: Java Code Deploying Help

Okay never mind

I got the robot running. Thanks for all your help, i really appreciate it

And also i will looking forward to see ur team at GTR West and east
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #14   Spotlight this post!  
Unread 13-11-2012, 18:36
joelg236 joelg236 is offline
4334 Retired Mentor & Alumni
AKA: Joel Gallant
no team
Team Role: Mentor
 
Join Date: Dec 2011
Rookie Year: 2012
Location: Calgary
Posts: 733
joelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond reputejoelg236 has a reputation beyond repute
Re: Java Code Deploying Help

Quote:
Originally Posted by 2185Bilal View Post
I got the robot running. Thanks for all your help, i really appreciate it
No problem.
Quote:
Originally Posted by 2185Bilal View Post
And also i will looking forward to see ur team at GTR West and east
I don't think our team is heading out there this year unfortunately. Maybe worlds.
__________________
All opinions are my own.

Last edited by joelg236 : 13-11-2012 at 18:36. Reason: Mis-quote
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:33.

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