Go to Post My brain is borderline mush, I don't have much of a voice, and I don't think I could be much happier. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-06-2010, 12:37
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Communicating With A PC

I am stuck here guys and I need some help, I am not going to use a serial port since out laptop does not have a serial port. I was thinking either communicate with an ethernet on the 2nd port or the existing connection with the dashboard. The problem is I do not know how to do that, there is no socket class, or anything similar to it. I am currently looking at the DataOutputStream and the Driverstation class, but I am not sure if thats the one that communicate through the ethernet. I have an idea on what they do, but I have no idea from the client side to get that data being sent. Should I use sockets? If I do use sockets, whats the port and IP of the robot? I know I sound like a total noob, but its been a long day, I woke up at 5:30 and lifted for an hour and now I am school trying to figure this out...
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #2   Spotlight this post!  
Unread 03-06-2010, 12:49
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Communicating With A PC

1. You could use the DashBoard data stream to feed data one-way to the PC, then setup the Classmate to feed to an external dashboard (it will do this), on your computer. I do not know what port this uses, but the IP is 10.xx.yy.2 where xx.yy is your team number (For me it would be 10.0.33.2). Dashboard will only send data to port 1, directly to the Classmate, which then relays the data to your program.

2. You could use sockets. In LabVIEW (after not using the front panel controls and Dashboard) I would go to sockets. Nothing wrong with them, you just need to know what you are doing.

3. If you do not understand the Dashboard, you should probably not go into sockets.

4. Read through some of the LabVIEW dashboard code to get a feel for how the Dashboard operates client-side. There are two VI's of significance:
There is one (I forgot it's name), that gives you your data. It gives you two strings: High and Low (priority). You then take the binary string and get a structure of data. You do not have to do it that way, but you get two strings whatever way you do it. Look inside this VI. It will tell you exactly how the Dashboard is getting its data. It uses a UDP socket and waits for new data (in it's own thread). You should *probably* create a new thread to run it in, so your other code dosen't have to wait for new data (and hang when there is no data coming in).
The other VI is Get Image from Controller. It does just that, it gets the latest camera image from the crio. Feed it the IP (which you know) and it will get it for you. Inside, it has a TCP or UDP socket (I think it's TCP but I am not quite sure) that gets a string, which it then converts to an image. I do not know the encoding on it, but it uses the LabVIEW image to string function to create it.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #3   Spotlight this post!  
Unread 03-06-2010, 14:44
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: Communicating With A PC

Quote:
Originally Posted by davidthefat View Post
there is no socket class, or anything similar to it. I am currently looking at the DataOutputStream and the Driverstation class, but I am not sure if thats the one that communicate through the ethernet
Sounds like you're using Java, so I'll write a response to that; [apalrd]'s got the rest of it covered. Going off of the Javadoc here. You can use the SocketConnection interface; create the instance using the static methods of the Connector class. There's an example in the Javadoc for the SocketConnection class (here).

--Ryan
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
  #4   Spotlight this post!  
Unread 03-06-2010, 14:47
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Communicating With A PC

Quote:
Originally Posted by RyanCahoon View Post
Sounds like you're using Java,

...


--Ryan
Based on his previous posts it is probably safe to assume he is using C++.
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
  #5   Spotlight this post!  
Unread 03-06-2010, 14:54
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,086
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: Communicating With A PC

You're using C++, right? It depends on what information you're trying to communicate to/from the PC. If you don't use the dashboard interface, then you'll want to use sockets. Lookup how to use sockets, its mostly the same interface as every other OS.

If you use sockets, you get to pick the port that you use. We have a webserver running on our robot that we use to communicate with it. The code for it uses the portable boost::asio asynchronous I/O library to abstract all the socket crap away. But, asynchronous I/O is inherently tricky, so user beware. http://code.google.com/p/webdma/
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #6   Spotlight this post!  
Unread 03-06-2010, 14:57
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Communicating With A PC

what are you trying to transfer? If you just want to get feedback or basic debug info, you could just use my ZomB Dashboard: http://firstforge.wpi.edu/sf/projects/zombdashboard
it (currently) uses the dashboard packets to send ints, floats, and strings, and also supports the video stream. You can also configure the DS to send data (minus video) to a remote computer (its in a draft manual on the site)
It uses the Dashboard class and works with Java and C++ If you need help, pm me.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #7   Spotlight this post!  
Unread 03-06-2010, 19:06
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Communicating With A PC

Quote:
Originally Posted by JamesBrown View Post
Based on his previous posts it is probably safe to assume he is using C++.
No, I should have mentioned it, the cRio is flashed to Java so I have to use java, the client will be in C++ though. Thanks Ryan, just what I needed

Quote:
Originally Posted by byteit101 View Post
what are you trying to transfer? If you just want to get feedback or basic debug info, you could just use my ZomB Dashboard: http://firstforge.wpi.edu/sf/projects/zombdashboard
it (currently) uses the dashboard packets to send ints, floats, and strings, and also supports the video stream. You can also configure the DS to send data (minus video) to a remote computer (its in a draft manual on the site)
It uses the Dashboard class and works with Java and C++ If you need help, pm me.

Thanks for your help, if you have not noticed, I like to do a lot of things from scratch, LOL
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.

Last edited by davidthefat : 03-06-2010 at 20:12.
  #8   Spotlight this post!  
Unread 03-06-2010, 21:10
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Communicating With A PC

Quote:
Originally Posted by davidthefat View Post
Thanks for your help, if you have not noticed, I like to do a lot of things from scratch, LOL
I have, you can download it and see how I did it, and use that knowledge to enable you to build your own.
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #9   Spotlight this post!  
Unread 03-06-2010, 21:16
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Communicating With A PC

Quote:
Originally Posted by davidthefat View Post
...the cRio is flashed to Java...
The solution is to flash the crio. Not that hard, just open the FRC crio imaging tool (In LabVIEW it is under one of the menus, there is a shortcut to it somewhere also), select the crio and C++, and hit the button. Done in under 10 minutes.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
  #10   Spotlight this post!  
Unread 03-06-2010, 21:21
davidthefat davidthefat is offline
Alumni
AKA: David Yoon
FRC #0589 (Falkons)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2010
Location: California
Posts: 792
davidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud ofdavidthefat has much to be proud of
Re: Communicating With A PC

Quote:
Originally Posted by apalrd View Post
The solution is to flash the crio. Not that hard, just open the FRC crio imaging tool (In LabVIEW it is under one of the menus, there is a shortcut to it somewhere also), select the crio and C++, and hit the button. Done in under 10 minutes.
But then I have to download the C++ library and the IDE and stuff, I will do it after I am done with this part of the project, its for my AP Comp Sci final and I don't want to risk messing up, I only have like 1 week left
__________________
Do not say what can or cannot be done, but, instead, say what must be done for the task at hand must be accomplished.
  #11   Spotlight this post!  
Unread 03-06-2010, 22:11
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: Communicating With A PC

Quote:
Originally Posted by apalrd View Post
The solution is to flash the crio. Not that hard, just open the FRC crio imaging tool (In LabVIEW it is under one of the menus, there is a shortcut to it somewhere also), select the crio and C++, and hit the button. Done in under 10 minutes.
More like 20 seconds

And the C++ libraries should already be in place on your computer if you installed the build tools from the DVD. As far as I know the imaging tool just changes a few config files to load the correct environment
__________________

"To have no errors would be life without meaning. No strugle, no joy"
"A network is only as strong as it's weakest linksys"

Last edited by Radical Pi : 03-06-2010 at 23:37.
Closed Thread


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
Driver's Station not communicating with cRio Alexandstein Technical Discussion 8 21-01-2010 21:05
Communicating with a laptop BEEKMAN C/C++ 16 09-01-2010 21:08
Help: IFI loader not communicating with control unit red_alert_13 Programming 9 20-01-2006 17:30
Problem with communicating with STAMP through serial port Skabana159 Technical Discussion 2 06-02-2003 21:10


All times are GMT -5. The time now is 23:10.

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