Go to Post It's sooo stressful! I brought my suitcase to school today, and I still don't know if we're going! - elfenari [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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
 


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