Go to Post I lose track of what day it is during build season. - Gary Dillard [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 04-02-2012, 10:47
JacobGH JacobGH is offline
Registered User
FRC #1849
 
Join Date: Nov 2011
Location: Bethesda, MD
Posts: 18
JacobGH is an unknown quantity at this point
how to print debugging statements to Netbeans

We're using Netbeans with Java to run our robot. If I upload new code to the robot then, as part of the compile/upload/reboot process a Netbeans is terminal is connected to the cRio, so any System.out.println() statements get printed to the development machine. But so far, I don't know how to get that terminal connection without the whole code-upload process. How do I do that?
Reply With Quote
  #2   Spotlight this post!  
Unread 04-02-2012, 10:52
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 990
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: how to print debugging statements to Netbeans

Go to your Start menu and select NetConsole for cRIO on a machine connected to the robot network. The cRIO uses broadcast messages for the NetConsole so it should begin receiving the messages automatically. Note that you cannot use NetConsole and have the Netbeans console running at the same time on the same machine because they bind the same port. The can run at the same time on different machines and should both receive the messages.
Reply With Quote
  #3   Spotlight this post!  
Unread 04-02-2012, 12:17
ssirovica's Avatar
ssirovica ssirovica is offline
Programming Captain
AKA: Sasha Sirovica
FRC #1458 (Red Ties)
Team Role: Programmer
 
Join Date: Sep 2011
Rookie Year: 2010
Location: Alamo
Posts: 26
ssirovica is an unknown quantity at this point
Re: how to print debugging statements to Netbeans

You can also use this code to print to the dashboard on the Classmate or another PC. Here is an example:
PHP Code:
public void printToClassmate(){

       
DriverStationLCD driverStation DriverStationLCD.getInstance();
       
driverStation.println(DriverStationLCD.Line.kUser21"Left Speed: " Double.toString(leftEncoder.getRate()));
       
driverStation.println(DriverStationLCD.Line.kUser31"Right Encoder: " Double.toString(rightEncoder.getDistance()));
       
driverStation.println(DriverStationLCD.Line.kUser41"Axis output: " Double.toString(leftStick.getRawAxis(4)));
       
//driverStation.println(DriverStationLCD.Line.kUser5, 1, "URF: " + Double.toString(ultra.getRangeInches()));
       //driverStation.println(DriverStationLCD.Line.kUser4, 1, "Gyro angle: " + Double.toString(gyro.getAngle()));

       
driverStation.updateLCD();
    } 
Just make sure to change kUser after every line because that is the line number it prints on, and call this method in your main While loop.
__________________
Computers run on smoke. When you let the smoke out the computer stops working.
Reply With Quote
  #4   Spotlight this post!  
Unread 04-02-2012, 15:43
JacobGH JacobGH is offline
Registered User
FRC #1849
 
Join Date: Nov 2011
Location: Bethesda, MD
Posts: 18
JacobGH is an unknown quantity at this point
Re: how to print debugging statements to Netbeans

I searched for "netconsole" on the classmate from the Windows start menu but it didn't find anything. I had one of the faulty USB classmate images, so I had to install the driver station and cRio images from a download and maybe I didn't get the netconsole that way?

As for using the diverStationLCD, ssirovica, I need the ability to print out lots information linearly, far more than the 6 or so lines I get out of the driver station.

Is there some way I can just manually connect a terminal to the stdout on the cRio to get those messages? The development machine runs Ubuntu Linux, so it has a powerful terminal.
Reply With Quote
  #5   Spotlight this post!  
Unread 04-02-2012, 16:04
RufflesRidge RufflesRidge is offline
Registered User
no team
 
Join Date: Jan 2012
Location: USA
Posts: 990
RufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant futureRufflesRidge has a brilliant future
Re: how to print debugging statements to Netbeans

I believe NetConsole is installed with the Utilities Update, but I don't remember for sure. I know someone has posted a cross platform Python version somewhere here on CD that will listen on the right UDP port and print whatever it hears, but I don't have time to dig it up right now.
Reply With Quote
  #6   Spotlight this post!  
Unread 04-02-2012, 16:06
JacobGH JacobGH is offline
Registered User
FRC #1849
 
Join Date: Nov 2011
Location: Bethesda, MD
Posts: 18
JacobGH is an unknown quantity at this point
Re: how to print debugging statements to Netbeans

Okay, I'll go search for that cross-platform UDP listener because that would be great. Thanks.
Reply With Quote
  #7   Spotlight this post!  
Unread 04-02-2012, 18:58
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,085
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: how to print debugging statements to Netbeans

Type http://10.te.am.2 into a web browser on a computer that is configured for the same network as the cRIO, where te.am is the usual team number IP.

The button with the monitor (see below) on it on the left side is the cRIO terminal window. You have to check "refresh repeatedly" on the bottom for real time.

__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

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 12:46.

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