Go to Post Wishes and dreams can hold a robot together just as well as nuts and bolts. - Kyle [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 21-01-2011, 18:06
pigpc1993 pigpc1993 is offline
Registered User
AKA: Colin Feeney
FRC #3716 (WARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Manhasset, NY
Posts: 41
pigpc1993 is an unknown quantity at this point
Debugging Techniques

My team and I are trying to figure out how to debug. Also When we use System.out.println were does it print to. It's not going to NetBeans or the Control Center. Any help would be awesome!
Reply With Quote
  #2   Spotlight this post!  
Unread 22-01-2011, 20:54
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
Re: Debugging Techniques

It should be going to the build process window. If you have it hidden you might not have seen it.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2011, 20:56
pigpc1993 pigpc1993 is offline
Registered User
AKA: Colin Feeney
FRC #3716 (WARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Manhasset, NY
Posts: 41
pigpc1993 is an unknown quantity at this point
Re: Debugging Techniques

Quote:
Originally Posted by sjspry View Post
It should be going to the build process window. If you have it hidden you might not have seen it.
I don't see it. :/
Reply With Quote
  #4   Spotlight this post!  
Unread 22-01-2011, 20:57
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
Re: Debugging Techniques

Once you hit run, you should see the messages of it compiling and trying to flash the cRIO's memory in a window. Any printlns should appear there.

If they don't, I'm surprised you can program it at all.
Reply With Quote
  #5   Spotlight this post!  
Unread 22-01-2011, 22:30
Jeanne Boyarsky Jeanne Boyarsky is offline
Java Mentor
FRC #0694 (StuyPulse)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 100
Jeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud ofJeanne Boyarsky has much to be proud of
Re: Debugging Techniques

Yes, it should appear in your NetBeans console if you loaded the code from there. If the code was loaded from another computer or from another machine, your NetBeans doesn't know about it. You can launch the "net console" on the machine with the Driver Station to force the System.out results to go there. (I just learned this yesterday! We'd always used NetBeans last year.)

Alternative forms of debugging are to send small output to the DashBoard (or better yet this year's SmartDashboard.) System.out is usually simpler though.

Remember to take out the System.outs when you are done as output slows down the code. (I/O takes longer than CPU.)
__________________
Team 694 mentor 2010-present, FIRST Volunteer and Co-organizer of FIRST World Maker Faire Tent
2012 NYC Woodie Flowers Finalist
2015 NYC Volunteer of the Year
Reply With Quote
  #6   Spotlight this post!  
Unread 23-01-2011, 10:29
ksanger's Avatar
ksanger ksanger is offline
Registered User
FRC #0211 (MaK)
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Rochester NY
Posts: 62
ksanger is on a distinguished road
Re: Debugging Techniques

MaK211 Team can not debug either. We can compile and download code which will run. But when we compile and download through the Netbeans debugger the PC just hangs. We do see the download and the reboots. In the 2010 version (Pre 2011 Upgrade) we would eventually get a message stating waiting for connection. In the 2011 version we get nada. The dashboard shows no program code. If we right click on the Debug Project Icon and select Attach there is no port specified on the form and the OK button is grayed out. We have not been able to find any 2011 instructions for debugging in Java with Netbeans.

All ideas are welcome.
Reply With Quote
  #7   Spotlight this post!  
Unread 25-01-2011, 17:27
pigpc1993 pigpc1993 is offline
Registered User
AKA: Colin Feeney
FRC #3716 (WARP)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Manhasset, NY
Posts: 41
pigpc1993 is an unknown quantity at this point
Re: Debugging Techniques

What happens is that once the code compiles and sends we leave it connected to the robot we launch the Classmate DriveStation and run out program. Nothing logs on NetBeans.
Reply With Quote
  #8   Spotlight this post!  
Unread 25-01-2011, 18:49
ksanger's Avatar
ksanger ksanger is offline
Registered User
FRC #0211 (MaK)
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Rochester NY
Posts: 62
ksanger is on a distinguished road
Re: Debugging Techniques

For normal program execution we do that too. Download code, see it on the dashboard, then set to Autonomous or Teleoperated...

Its only when we want to set a breakpoint and launch the debugger do we have an issue where the laptop with the debugger on it doesn't get to the point where the debugger runs. Nor does the dashboard application see the robot code deploy. It shouldn't because the debugger is not running yet. We still need help with how to get the debugger to run.
Reply With Quote
  #9   Spotlight this post!  
Unread 04-02-2011, 22:54
AllenGregoryIV's Avatar
AllenGregoryIV AllenGregoryIV is offline
Engineering Coach
AKA: Allen "JAG" Gregory
FRC #3847 (Spectrum)
Team Role: Coach
 
Join Date: Jul 2008
Rookie Year: 2003
Location: Texas
Posts: 2,549
AllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond reputeAllenGregoryIV has a reputation beyond repute
Send a message via AIM to AllenGregoryIV
Re: Debugging Techniques

So we just started playing with CAN today (Java and CAN-Serial converter) but now we can't see the println's anymore because the console out is disabled.

How do other teams debug code with out print statements?

That is the only system I have used for FIRST robots.

Setting up a dashboard doesn't seem to give the same information. We know we can do file out but we can't get live updates while the robot is running.

Has anyone else found a simple solution to this problem?

Edited: I got the printlns working again, not really sure what the problem is but now CAN won't work getting an error when I try to initialize any jaguars: "edu.wpi.first.wpilibj.util.UncleanStatusException : Fatal status code detected: -1"

Last edited by AllenGregoryIV : 05-02-2011 at 13:24. Reason: fixed part of the problem
Reply With Quote
  #10   Spotlight this post!  
Unread 07-02-2011, 21:44
alexhenning alexhenning is offline
WPILib Developer
FRC #0348
 
Join Date: Apr 2010
Rookie Year: 2003
Location: MA
Posts: 49
alexhenning will become famous soon enough
Re: Debugging Techniques

There's a net console if you're using CAN. I'm using the eclipse plugin and it automatically shows it. If it doesn't open a terminal cd into the project directory and run "ant echo" and you should get output. You need to make sure you're on the right netmask is 255.0.0.0 for whatever reason, my router dynamically assigns me 255.255.255.0 sometimes.

The one problem I've had with netconsole is if you print to fast, the router gets slow and it can cause issues so just limit the rate at which you print.
Reply With Quote
  #11   Spotlight this post!  
Unread 08-02-2011, 02:45
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: Debugging Techniques

Quote:
Originally Posted by alexhenning View Post
The one problem I've had with netconsole is if you print to fast, the router gets slow and it can cause issues so just limit the rate at which you print.
That should be greatly improved by the v27 image. The NetConsole server now batches output into larger packets.
Reply With Quote
  #12   Spotlight this post!  
Unread 09-10-2011, 09:37
twiggzee twiggzee is offline
Registered User
FRC #3502 (Octo-(PI)-Rates)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2011
Location: Tallahassee, FL
Posts: 55
twiggzee is an unknown quantity at this point
Re: Debugging Techniques

we're new to java this year and trying to get the debugger to run. we're having the same experience as ksanger described here. was there ever a solution found?
__________________
Wendy
Team 3502
Reply With Quote
  #13   Spotlight this post!  
Unread 09-10-2011, 11:40
ksanger's Avatar
ksanger ksanger is offline
Registered User
FRC #0211 (MaK)
 
Join Date: Mar 2010
Rookie Year: 2010
Location: Rochester NY
Posts: 62
ksanger is on a distinguished road
Re: Debugging Techniques

Wendy; We never did get the debugger to work. Our team is just starting up again this fall and maybe we'll get to try again in a month or two. Good luck and welcome to USFirst Robotics.
Reply With Quote
  #14   Spotlight this post!  
Unread 10-10-2011, 01:35
twiggzee twiggzee is offline
Registered User
FRC #3502 (Octo-(PI)-Rates)
Team Role: Mentor
 
Join Date: Mar 2011
Rookie Year: 2011
Location: Tallahassee, FL
Posts: 55
twiggzee is an unknown quantity at this point
Re: Debugging Techniques

ok thanks. i have new info and more questions.

since i wasn't able to get the debugger to work, i tried hard wiring it instead of doing it through wifi. that seemed to work fine.

does this mean that we have to be hard wired to debug? my common sense tells me that this is not practical. i should not have to follow our robot around with my laptop connected in order to debug code, right?

are there teams out there that can attach a debugger through wireless connection? if so, any help is much appreciated.

this is what is displayed in the output window.

in the debugger console:
Attaching to Wendy:2900
then it just sits there forever.

in the Team3502 (deploy,debug-run) Window:

init:
init:
Deleting directory C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\build
Deleting directory C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Deleting directory C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\j2meclasses
clean:
Created dir: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\build
Compiling 2 source files to C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\build
compile:
Created dir: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\j2meclasses
preverify:
Created dir: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Building jar: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite\Team3502_1.0.0.jar
jar-app:
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
[translating suite image [closed: false, parent: squawk] ...]
### Excluding compile: com.sun.squawk.Method::getParameterTypes
### Excluding compile: com.sun.squawk.SymbolParser::getSignatureTypeAt
[Including resource: META-INF/MANIFEST.MF]
Romizer processed 113 classes and generated 4 files.
Expanding: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite\Team3502_1.0.0.jar into C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Moving 1 file to C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Moving 1 file to C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Moving 1 file to C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\suite
Deleting: C:\Documents and Settings\Wendy Chan\My Documents\NetBeansProjects\Team3502Robot\trunk\Tea m3502\image.suite.api
Host OS: Windows XP 5.1, 5.1
Host JVM: Java HotSpot(TM) Client VM 19.1-b02
Target IP: 10.35.2.2
Network interfaces on host:
Intel(R) PRO/Wireless 3945ABG Network Connection - McAfee Core NDIS Intermediate Filter Miniport: address: 10.35.2.4 netmask: 255.0.0.0 <--- on robot's subnet
Connecting FTP @10.35.2.2
upgrade:
Sending local file image.suite
flashapp:
deploy:
debug-run:
do-debug-run:
[cRIO] [OTA Server] ********* REBOOTING cRIO *********
[cRIO]
Waiting for cRIO to reboot (1s)
Waiting for cRIO to reboot (2s)
Waiting for cRIO to reboot (3s)
Waiting for cRIO to reboot (4s)
Waiting for cRIO to reboot (5s)
Waiting for cRIO to reboot (6s)
Waiting for cRIO to reboot (7s)
[cRIO]
Connect debugger attempt 1
Connecting NetBeans debugger
Start debug proxy
init:
CompilerOracle: exclude com/sun/squawk/Method.getParameterTypes
CompilerOracle: exclude com/sun/squawk/SymbolParser.getSignatureTypeAt
CompilerOracle: exclude com/sun/squawk/SymbolParser.stripMethods
Trying to connect to VM on socket://10.35.2.2:2800
[cRIO] -> * Loading StartupDlls: debug
[cRIO] Entering debug.o StartupLibraryInit
[cRIO] Debugging is up, target server mounted at /tsfs
[cRIO]
[cRIO]
[cRIO] VxWorks
[cRIO]
[cRIO] Copyright 1984-2006 Wind River Systems, Inc.
[cRIO]
[cRIO] CPU: MPC5200 -- Wind River Lite5200 BSP.
[cRIO] Runtime Name: VxWorks
[cRIO] Runtime Version: 6.3
[cRIO] BSP version: 2.0/10
[cRIO] Created: Jul 29 2009, 13:41:47
[cRIO] ED&R Policy Mode: Deployed
[cRIO] WDB Comm Type: WDB_COMM_END
[cRIO] WDB: Ready.
[cRIO]
[cRIO] Leaving debug.o StartupLibraryInit
[cRIO] * Loading StartupDlls: NiRioRpc
[cRIO] * Loading StartupDlls: niorbs
[cRIO] * Loading StartupDlls: NiViSrvr
[cRIO] * Loading StartupDlls: visa32
[cRIO] * Loading StartupDlls: nivissvc
[cRIO] task 0xed1418 (PAL00fa27d0) deleted: errno=0 (0) status=0 (0)
[cRIO] NI-RIO Server 3.2 started successfully.
[cRIO] task 0xc4c8b8 (NiRioRpc) deleted: errno=0 (0) status=0 (0)
[cRIO] * Loading StartupDlls: nivision
Connect debugger attempt 2
Connecting NetBeans debugger
[cRIO] * Loading StartupDlls: niserial
[cRIO] * Loading StartupDlls: FRC_FPGA
[cRIO] * Loading StartupDlls: FRC_NetworkCommunication
[cRIO] task 0x1af5638 (t2) deleted: errno=0 (0) status=0 (0)
[cRIO] FRC_NetworkCommunication was compiled from SVN revision 2258
[cRIO]
[cRIO] NI-VISA Server 4.5 started successfully.
[cRIO] task 0xe4fbe0 (t1) deleted: errno=1835009 (0x1c0001) status=1 (0x1)
Attached JPDA debugger to localhost:2900
[cRIO] FPGA Hardware GUID: 0x2EAA5E59CAF1A8A966853A011B61CC91
[cRIO] FPGA Software GUID: 0x2EAA5E59CAF1A8A966853A011B61CC91
[cRIO] FPGA Hardware Version: 2011
[cRIO] FPGA Software Version: 2011
[cRIO] FPGA Hardware Revision: 1.5.3
[cRIO] FPGA Software Revision: 1.5.3
[cRIO] * Loading StartupDlls: FRC_JavaVM
[cRIO]
[cRIO]
[cRIO] [OTA Server] Version: 2011 FRC, Jan 6 2011, 09:47:42
[cRIO]
[cRIO]
[cRIO] Welcome to LabVIEW Real-Time 8.6.1f3
[cRIO]
[cRIO] [Squawk VM] Version: 2011 FRC, Feb 18 2011, 15:57:21
[cRIO] [Squawk VM] File SQUAWK_DEBUG_ENABLED found, starting squawk in debug mode...
[cRIO] Listening for connection from proxy on serversocket://:2800
Failed to establish connection with VM: Connection timed out: connect - trying again in 5 seconds...
Trying to connect to VM on socket://10.35.2.2:2800
Established connection to VM (handshake took 16ms)
[cRIO] FPGA Hardware GUID: 0x2eaa5e59caf1a8a966853a011b61cc91
[cRIO] FPGA Software GUID: 0x2eaa5e59caf1a8a966853a011b61cc91
Waiting for connection from debugger on serversocket://:2900
Synchronizing debug state with VM...
Established connection to Debugger (handshake took 8813ms)
__________________
Wendy
Team 3502
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 10:55.

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