Go to Post Things go wrong; it happens to the best of us. You learn from it and move on. - Waynep [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-2010, 15:38
Egg 3141592654's Avatar
Egg 3141592654 Egg 3141592654 is offline
Now a mentor, always a student
FRC #0810 (Mechanical Bulls)
Team Role: Programmer
 
Join Date: Feb 2010
Rookie Year: 2008
Location: Long Island
Posts: 53
Egg 3141592654 is on a distinguished road
User Messages from robot to driver station

I have been reprogramming old robots to run in java. I was wondering if the robot can transmit messages back to the user.
__________________
"The answers to the book of life are not found in the back." Charlie Brown

Software Mentor - Team Apex Robotics 5803

Lead Programmer - Team 810 Mechanical Bulls '09-'11
Reply With Quote
  #2   Spotlight this post!  
Unread 12-11-2010, 15:47
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,042
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: User Messages from robot to driver station

Quote:
Originally Posted by Egg 3141592654 View Post
I was wondering if the robot can transmit messages back to the user.
Yes. In LabVIEW you could use the "WRITE USER MSG" function in the WPI Library. I would imagine there's something similar in Java.



Attached Thumbnails
Click image for larger version

Name:	usermsg.png
Views:	36
Size:	15.5 KB
ID:	9422  
Reply With Quote
  #3   Spotlight this post!  
Unread 12-11-2010, 17:21
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,753
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: User Messages from robot to driver station

See the DriverStationLCD class
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #4   Spotlight this post!  
Unread 14-11-2010, 09:32
Unsung FIRST Hero
Al Skierkiewicz Al Skierkiewicz is offline
Broadcast Eng/Chief Robot Inspector
AKA: Big Al WFFA 2005
FRC #0111 (WildStang)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1996
Location: Wheeling, IL
Posts: 10,766
Al Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond reputeAl Skierkiewicz has a reputation beyond repute
Re: User Messages from robot to driver station

If you are talking of pre-Crio robots, the answer is yes. In IFI controlleers, you can even use one of the digital ports on the RC to port data back to the OI. It's tricky but it can be done.
__________________
Good Luck All. Learn something new, everyday!
Al
WB9UVJ
www.wildstang.org
________________________
Storming the Tower since 1996.
Reply With Quote
  #5   Spotlight this post!  
Unread 14-11-2010, 09:35
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,753
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: User Messages from robot to driver station

The hard part with the pre-cRIO contollers is they don't support Java.
The IFI OIs also display a user byte of information from the robot code.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 14-11-2010 at 09:45.
Reply With Quote
  #6   Spotlight this post!  
Unread 15-11-2010, 10:01
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,637
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: User Messages from robot to driver station

If direct serialization is used, then streaming messages between any language is very simple. "Serialization" means transforming an object to its primitive types, then transforming those primitive types to a byte array in a controlled fashion. So long as the objects are simple and the encoding/decoding is done properly, any developer can do serialization manually.

Perhaps a better way to do it is via a standardized language, like WSDL or IDL. However, using the standard protocols to go along with those languages isn't possible with any FRC control system that I'm aware of. Instead, WSDL (xml variant) would be compiled on your development machine to its C/C++/Java equivalent classes: each class has an encode() and decode() method that ensures a C object is identical to its Java equivalent. The structure in physical memory will be different at run-time, yet the code can call the same methods and access the same data. For a first-time run through, I recommend that you keep the C/Java objects very simple so they only contain primitive (int/short/long/char[]) types.

Overall, my suggestion is to create a WSDL file, compile it into C/Java equivalents, and then use the C classes on the robot and the Java classes on the display. Call class.encode() on the robot to get a byte array, then send that byte array from the robot to the display via the robot's communications protocols, the class.decode() on the display. There are some more nuances to get it working properly, but this is the fundamental principle that should get you started.

Being able to do this will open up doors in your career. It will enable you to develop brand new features in a new language while still interfacing with legacy systems developed before you were even born. In industrial systems, just because something is 'old' doesn't mean it's outdated.

We were able to interface the CRIO to our own custom "Radar" display in Java on our laptop in 2009 by doing direct serialization. We could see blips of all other robot trailers detected by the camera on our radar display, as well as have active statuses for the battery, sensors, etc. We didn't do well that year since the robot had many mechanical issues, but the display piece was solid.
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub

Last edited by JesseK : 15-11-2010 at 10:03.
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
Finding Distance From Driver Station mwtidd Programming 18 05-06-2010 14:48
Driver Station user manual Ether FRC Control System 7 20-03-2010 17:57
Driver Station User Messages Extend Length bearsomg C/C++ 2 13-02-2010 18:58
Need help with Driver Station User Message Jakub Programming 5 18-01-2010 00:40
Programming Digital Inputs from Driver Station spooncwru Programming 8 01-02-2009 13:14


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

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