Go to Post Now I'm having visions of thousands of balloons and a grumpy old man. Oh, and a talking dog. No talking dogs on the field. Grumpy old men are ok - sometimes. - JaneYoung [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-2010, 22:36
a kenny03 a kenny03 is offline
Robotics for life(stupid classmate)
AKA: PICKELL!!!
FRC #0219 (Team Impact)
Team Role: Leadership
 
Join Date: Oct 2009
Rookie Year: 2008
Location: New Jersey
Posts: 65
a kenny03 is an unknown quantity at this point
Send a message via AIM to a kenny03
Re: sending info to a console

i have the import for the driverstationlcd class, but i have no clue what to do with it... i think one of my fellow team members might have been able to solve this problem, but i don't know if it works. (that's tomorrow's job)
another note...
does anyone know what 'private access' means, and how to get past it?
Reply With Quote
  #2   Spotlight this post!  
Unread 21-01-2010, 22:42
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: sending info to a console

Quote:
Originally Posted by a kenny03 View Post
i have the import for the driverstationlcd class, but i have no clue what to do with it... i think one of my fellow team members might have been able to solve this problem, but i don't know if it works. (that's tomorrow's job)
another note...
does anyone know what 'private access' means, and how to get past it?
All you need to do is call println() for each line you want to send and then call updateLCD() once after println'ing all the lines that you want to send. You don't need any private members.
Reply With Quote
  #3   Spotlight this post!  
Unread 22-01-2010, 10:16
a kenny03 a kenny03 is offline
Robotics for life(stupid classmate)
AKA: PICKELL!!!
FRC #0219 (Team Impact)
Team Role: Leadership
 
Join Date: Oct 2009
Rookie Year: 2008
Location: New Jersey
Posts: 65
a kenny03 is an unknown quantity at this point
Send a message via AIM to a kenny03
Re: sending info to a console

Quote:
Originally Posted by jhersh View Post
All you need to do is call println() for each line you want to send and then call updateLCD() once after println'ing all the lines that you want to send. You don't need any private members.
well, i figured that *face palm* but i am still getting an error. i am using the dsLCD class, but i am still getting a private access error

this is my code...
DriverStationLCD robot = new DriverStationLCD();
robot.println(DriverStationLCD.Line.kUser2,1,"this prints on the first line");
robot.updateLCD();
Reply With Quote
  #4   Spotlight this post!  
Unread 22-01-2010, 11:30
derekwhite's Avatar
derekwhite derekwhite is offline
Java Virtual Machine Hacker
no team (FIRST@Oracle)
Team Role: Programmer
 
Join Date: May 2009
Rookie Year: 2009
Location: Burlington, MA
Posts: 127
derekwhite is on a distinguished road
Re: sending info to a console

Hi A Kenney03,

Call "DriverStationLCD getInstance()" instead of "new DriverStationLCD()".

Since there can only be one DriverStationLCD, the private access prevents you from trying to create two objects to refer to the same item on the driver station.

BTW, errors like this are easier to comment on if you can post the error message. I wasn't sure if you were talking about a compile error, network error, code error, or what :-)
Reply With Quote
  #5   Spotlight this post!  
Unread 22-01-2010, 16:34
a kenny03 a kenny03 is offline
Robotics for life(stupid classmate)
AKA: PICKELL!!!
FRC #0219 (Team Impact)
Team Role: Leadership
 
Join Date: Oct 2009
Rookie Year: 2008
Location: New Jersey
Posts: 65
a kenny03 is an unknown quantity at this point
Send a message via AIM to a kenny03
Re: sending info to a console

ok. thank you. that helps. but new we are having trouble with the user messages system. is there a maximum limit on strings and lines? and how do we use the first line?
Reply With Quote
  #6   Spotlight this post!  
Unread 22-01-2010, 23:19
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: sending info to a console

Quote:
Originally Posted by a kenny03 View Post
ok. thank you. that helps. but new we are having trouble with the user messages system. is there a maximum limit on strings and lines? and how do we use the first line?
There are 6 lines... 21 characters per line. This is based on compatibility with last year's DS.

To use the first line, use the enum value to specify the first line.
Reply With Quote
  #7   Spotlight this post!  
Unread 31-01-2010, 22:42
full_auto full_auto is offline
Registered User
AKA: Bill
FRC #1168
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2003
Location: Pennsylvania, USA
Posts: 4
full_auto is an unknown quantity at this point
Send a message via AIM to full_auto
Re: sending info to a console

Hey guys, first post here.
We are also having trouble with using DriverStationLCD. The code that I am attempting to use is as follows:
Code:
textOut.println(DriverStationLCD.Line.kUser3, 2, message);
textOut.updateLCD();
where 'textOut' is an instance of DriverStationLCD retrieved with DriverStationLCD.getInstance() and 'message' is a String that is never more than 15 characters.

This code is executed periodically. The problem is that after it executes a few times the DS stops responding and must be restarted to regain functionality. This does not happen if I remove those two lines, so I'm fairly sure that they are the cause.

Has anyone gotten this to work? Any help is greatly appreciated.
Reply With Quote
  #8   Spotlight this post!  
Unread 01-02-2010, 17:53
full_auto full_auto is offline
Registered User
AKA: Bill
FRC #1168
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2003
Location: Pennsylvania, USA
Posts: 4
full_auto is an unknown quantity at this point
Send a message via AIM to full_auto
Re: sending info to a console

Nobody knows anything that could help?
Reply With Quote
  #9   Spotlight this post!  
Unread 01-02-2010, 18:31
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: sending info to a console

Quote:
Originally Posted by full_auto View Post
This code is executed periodically. The problem is that after it executes a few times the DS stops responding and must be restarted to regain functionality. This does not happen if I remove those two lines, so I'm fairly sure that they are the cause.
Where are they called from? How quickly are they called? Does rebooting the robot affect anything, or is restarting the driver station application the only thing that makes it work again?
Reply With Quote
  #10   Spotlight this post!  
Unread 01-02-2010, 19:18
full_auto full_auto is offline
Registered User
AKA: Bill
FRC #1168
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2003
Location: Pennsylvania, USA
Posts: 4
full_auto is an unknown quantity at this point
Send a message via AIM to full_auto
Re: sending info to a console

Quote:
Originally Posted by jhersh View Post
Where are they called from? How quickly are they called? Does rebooting the robot affect anything, or is restarting the driver station application the only thing that makes it work again?
I just got in here a little while ago... It turns out that the problem was not related to the calls to DriverStationLCD, removing those lines only made the error occur much later. All is well now. Thanks.
Reply With Quote
  #11   Spotlight this post!  
Unread 01-02-2010, 19:28
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: sending info to a console

Quote:
Originally Posted by full_auto View Post
I just got in here a little while ago... It turns out that the problem was not related to the calls to DriverStationLCD, removing those lines only made the error occur much later. All is well now. Thanks.
So... for anyone else who runs into this behavior, please explain what it ended up being and how you fixed it.

Thanks
-Joe
Reply With Quote
  #12   Spotlight this post!  
Unread 01-02-2010, 22:23
full_auto full_auto is offline
Registered User
AKA: Bill
FRC #1168
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2003
Location: Pennsylvania, USA
Posts: 4
full_auto is an unknown quantity at this point
Send a message via AIM to full_auto
Re: sending info to a console

Quote:
Originally Posted by jhersh View Post
So... for anyone else who runs into this behavior, please explain what it ended up being and how you fixed it.

Thanks
-Joe
Sorry, no problem. 'message' was sometimes being indexed out of an array prior to those two lines and I had sized the array incorrectly, so I was getting IndexOutOfBounds exceptions I did not see the exceptions because I was using a development machine separate from the DS. Fixing that by properly sizing the array was the solution (i'm ashamed that I missed this)

I do not know why commenting the two lines with DriverStationLCD seemed to delay the problem. It may have been a coincidence...

I apologize for the confusion. DriverStationLCD appears to work as intended and was not the cause of my trouble. Thank you for your responses.

Regards,
Bill
Reply With Quote
  #13   Spotlight this post!  
Unread 03-02-2010, 11:20
KevinJ KevinJ is offline
Bit Wiggler
AKA: Kevin Janesch
FRC #1533 (Triple Strange)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2005
Location: Greensboro, NC
Posts: 3
KevinJ is an unknown quantity at this point
Re: sending info to a console

Quote:
Originally Posted by jhersh View Post
Quote:
Originally Posted by full_auto View Post
This code is executed periodically. The problem is that after it executes a few times the DS stops responding and must be restarted to regain functionality. This does not happen if I remove those two lines, so I'm fairly sure that they are the cause.
Where are they called from? How quickly are they called? Does rebooting the robot affect anything, or is restarting the driver station application the only thing that makes it work again?
Quote:
Originally Posted by full_auto View Post
It turns out that the problem was not related to the calls to DriverStationLCD, removing those lines only made the error occur much later. All is well now. Thanks.
A note to everyone that doing this to send data back to the DS...

Make sure you aren't running this code CONSTANTLY. Sending new messages and running the updateLCD() method too fast will run the cRIO out of memory, and my guess is because it backlogs all the packets and fills up the memory. You'll get an OutOfMemoryError, and will have to reboot the cRIO to do anything else (like load new code).

(Found this out the hard way on WPILibJ version 1.0.0a, and my guess is it happens with the latest version too...)
Reply With Quote
  #14   Spotlight this post!  
Unread 03-02-2010, 15:08
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: sending info to a console

Quote:
Originally Posted by KevinJ View Post
A note to everyone that doing this to send data back to the DS...

Make sure you aren't running this code CONSTANTLY. Sending new messages and running the updateLCD() method too fast will run the cRIO out of memory, and my guess is because it backlogs all the packets and fills up the memory. You'll get an OutOfMemoryError, and will have to reboot the cRIO to do anything else (like load new code).

(Found this out the hard way on WPILibJ version 1.0.0a, and my guess is it happens with the latest version too...)
That's a bit strange. Are you sure that's the only thing that's happening in your loop? I just looked at the code path for that in Java and I don't see any allocations at all in that loop. Are you allocating memory yourself? Is the out of memory error coming from the Java VM or from vxWorks?
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sending data from RC to OI Nathan Programming 7 03-02-2008 22:32
sending extra information to the OI iwdu15 Programming 2 06-02-2007 20:05
Sending variables to Auto Mode Adrien Programming 4 19-02-2006 21:51
Sending data back to the OI DanDon Programming 13 26-01-2006 15:17
Sending Data Raven_Writer Programming 8 11-09-2003 16:28


All times are GMT -5. The time now is 09:39.

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