Go to Post I want to understand the physics. - Molten [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 13-01-2012, 21:21
Lalaland1125 Lalaland1125 is offline
Registered User
AKA: Ethan Steinberg
FRC #2429
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: La Canada
Posts: 29
Lalaland1125 is an unknown quantity at this point
Is TCP communication allowed in-game?

Our team is planning to process images on the Classmate. Our plan is to simply open a socket on the classmate on a high number port and simply push data back and forth using TCP. This obviously works right now in testing.

My question is: Can we do this during competition? Are teams allowed to communicate with their robot from a background task on the Classmate over TCP on a high number port?

(I know there will be speed issues due to network congestion etc, during the competition).
  #2   Spotlight this post!  
Unread 13-01-2012, 21:25
bdbayes bdbayes is offline
Captain
FRC #2927 (Pi Rho Techs)
Team Role: Leadership
 
Join Date: Apr 2011
Rookie Year: 2009
Location: Tacoma, WA
Posts: 75
bdbayes is a jewel in the roughbdbayes is a jewel in the roughbdbayes is a jewel in the rough
Re: Is TCP communication allowed in-game?

See the rule below.

Quote:
[R53]
Connections to the cRIO Ethernet ports must be compliant with the following parameters:
The DAP-1522 wireless bridge is connected to the cRIO Ethernet port 1 (either directly or via a CAT5 Ethernet pigtail).
Ethernet-connected COTS devices or custom circuits may connect to any remaining Ethernet ports; however, these devices may not transmit or receive UDP packets using ports 1100-1200 except for ports 1130 and 1140.
  #3   Spotlight this post!  
Unread 13-01-2012, 21:30
~Cory~'s Avatar
~Cory~ ~Cory~ is offline
Student
AKA: Cory Rypkema
FRC #0706
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Worcester MA
Posts: 216
~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold~Cory~ is a splendid one to behold
Re: Is TCP communication allowed in-game?

We are also persuing this method. However, one must be VERY careful as to not cause excessive bandwidth/other bottleneck issues because the fms people will complain.

In previous years they had a screen that shows network data for each robot and a log so no funny business
__________________
corin.rypkema.org
WPI Class of '17
'12 Dean's List Finalist, Mentor of 706 - Cyberhawks
  #4   Spotlight this post!  
Unread 13-01-2012, 21:39
Lalaland1125 Lalaland1125 is offline
Registered User
AKA: Ethan Steinberg
FRC #2429
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: La Canada
Posts: 29
Lalaland1125 is an unknown quantity at this point
Re: Is TCP communication allowed in-game?

So, it seems like there are two main rules:

1. Do not use those port numbers in the range 1100-1200.

2. Try not to act like you are running a Denial of Service attack on the network.
  #5   Spotlight this post!  
Unread 13-01-2012, 21:45
ratdude747's Avatar
ratdude747 ratdude747 is offline
Official Scorekeeper
AKA: Larry Bolan
no team
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Madison, IN
Posts: 1,064
ratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond repute
Re: Is TCP communication allowed in-game?

you could use the camera direct to the classmate/laptop last year via a special labview .vi for the dashboard (I have a copy if anybody wants it to play with). Last I checked they still are using the 4 port AP's on the bot (only way to use them with the 4 slot crio), so if you connect the camera there, you can view the camera from the dash via the special VI.

I think that is legal... that looks to be the same rule as used in 2011.

edit- attached the .vi
Attached Files
File Type: zip Read MJPG.vi.zip (19.6 KB, 16 views)
__________________
Dean's List Semi-finalist 2010
1747 Harrison Boiler Robotics 2008-2010, 2783 Engineers of Tomorrow 2011, Event Volunteer 2012-current

DISCLAIMER: Any opinions/comments posted are solely my personal opinion and does not reflect the views/opinions of FIRST, IndianaFIRST, or any other organization.

Last edited by ratdude747 : 13-01-2012 at 21:48.
  #6   Spotlight this post!  
Unread 13-01-2012, 22:23
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,586
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Is TCP communication allowed in-game?

Quote:
Originally Posted by ratdude747 View Post
you could use the camera direct to the classmate/laptop last year via a special labview .vi for the dashboard (I have a copy if anybody wants it to play with).
edit- attached the .vi
This is included by default this year.
  #7   Spotlight this post!  
Unread 14-01-2012, 00:07
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
Re: Is TCP communication allowed in-game?

How are you getting the TCP comm link to work?

I'm currently unable to find the networking API from java..
  #8   Spotlight this post!  
Unread 14-01-2012, 00:10
ratdude747's Avatar
ratdude747 ratdude747 is offline
Official Scorekeeper
AKA: Larry Bolan
no team
 
Join Date: Feb 2009
Rookie Year: 2008
Location: Madison, IN
Posts: 1,064
ratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond reputeratdude747 has a reputation beyond repute
Re: Is TCP communication allowed in-game?

Quote:
Originally Posted by Joe Ross View Post
This is included by default this year.
cool... since I am no longer actively involved with a team this year, I didn't know. Sorry about that.
__________________
Dean's List Semi-finalist 2010
1747 Harrison Boiler Robotics 2008-2010, 2783 Engineers of Tomorrow 2011, Event Volunteer 2012-current

DISCLAIMER: Any opinions/comments posted are solely my personal opinion and does not reflect the views/opinions of FIRST, IndianaFIRST, or any other organization.
  #9   Spotlight this post!  
Unread 14-01-2012, 10:24
Lalaland1125 Lalaland1125 is offline
Registered User
AKA: Ethan Steinberg
FRC #2429
Team Role: Programmer
 
Join Date: Jan 2012
Rookie Year: 2011
Location: La Canada
Posts: 29
Lalaland1125 is an unknown quantity at this point
Re: Is TCP communication allowed in-game?

Quote:
Originally Posted by shuhao View Post
How are you getting the TCP comm link to work?

I'm currently unable to find the networking API from java..


http://ideone.com/9dM5E
That's our code as of roughly now(I think the only change was that the robot does not support UTF, so we just switched that to ASCII or something).

javax.microedition.io is where the magic is.

If you want I can give you our server-side code, but it's just standard socket opening and accepting a connection(in C++ that is).

Last edited by Lalaland1125 : 14-01-2012 at 10:27.
  #10   Spotlight this post!  
Unread 14-01-2012, 11:08
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
Re: Is TCP communication allowed in-game?

Quote:
Originally Posted by Lalaland1125 View Post
http://ideone.com/9dM5E
That's our code as of roughly now(I think the only change was that the robot does not support UTF, so we just switched that to ASCII or something).

javax.microedition.io is where the magic is.

If you want I can give you our server-side code, but it's just standard socket opening and accepting a connection(in C++ that is).

Why can't you just go with message = m_inputStream.readUTF(); instead of all that, which should do the same thing? and same for outputStream with writeUTF

Last edited by shuhao : 14-01-2012 at 11:15.
  #11   Spotlight this post!  
Unread 15-01-2012, 14:22
pspeer's Avatar
pspeer pspeer is offline
Programming / Electronics
FRC #1730 (TeamDriven)
Team Role: Engineer
 
Join Date: Mar 2007
Rookie Year: 2006
Location: Lee's Summit, MO
Posts: 9
pspeer is an unknown quantity at this point
Re: Is TCP communication allowed in-game?

Has anyone been able to get TCP communication from the DriverStation to the cRIO using C++?

Does WPILIB support the use of TCP/UDP sockets?
  #12   Spotlight this post!  
Unread 19-01-2012, 16:10
MohammadAdib MohammadAdib is offline
Outside-of-the-box thinker
FRC #0948 (NRG948)
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Bellevue WA
Posts: 7
MohammadAdib is an unknown quantity at this point
Re: Is TCP communication allowed in-game?

Quote:
Originally Posted by shuhao View Post
How are you getting the TCP comm link to work?

I'm currently unable to find the networking API from java..
In normal Java there are easy ways to implement a client server solution. From what i have seen/learned/experienced, it is always noteworthy that a client and server should talk with each other as little as possible while still maintaining communication. If your program requires sending a large amount of small data (such as coordinates) back and forth, then i suggest that you disable Nagle's algorithm, otherwise all of your small TCP packets will be made into one big packet and get sent, and that can mess things up quite a bit if you have some sort of command parser on the other side waiting to read the packets u send. Now that being said, in my opinion the ideal solution is to have the classmate running a server application listening on an open ServerSocket. A client will be on whatever you decide to send data to the classmate with which will try to connect to the classmate via some method of network communication. Then you can let the data flow. But if you are sending small amounts of data (< 1kb) then i recommend using a DatagramPacket (UDP). Regardless how you do it, Here is a useful site on making server and client solutions in Java: http://systembash.com/content/a-simp...nd-tcp-client/

If you have any technical questions about ANYTHING feel free to email me or something.

EDIT: I forgot to mention an extremely critical thing. Always make your servers threaded! That means for every client that connects to the ServerSocket on your server application, start a new designated thread for handling communication. If your server talks back, then also start another thread for sending info on the socket. Without threading, performance will TANK.

Last edited by MohammadAdib : 19-01-2012 at 16:14.
  #13   Spotlight this post!  
Unread 19-01-2012, 16:55
MohammadAdib MohammadAdib is offline
Outside-of-the-box thinker
FRC #0948 (NRG948)
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Bellevue WA
Posts: 7
MohammadAdib is an unknown quantity at this point
Re: Is TCP communication allowed in-game?

I just wrote and tested this very simple code for a threaded TCP server template using Java. The server is fully threaded and can read input from incoming clients. There is no limit to how many clients can connect. It uses a thread to search for new clients and once a client connects another thread is started for reading input from that client's socket.

Feel free to use the code as it is a template, but please do not remove the credit comment on the top

Download the file from below:
Attached Files
File Type: java TCPServer.java (2.5 KB, 23 views)
  #14   Spotlight this post!  
Unread 19-01-2012, 19:11
pavanetti's Avatar
pavanetti pavanetti is offline
Registered User
FRC #1382
 
Join Date: Dec 2010
Location: Brazil
Posts: 12
pavanetti is an unknown quantity at this point
Re: Is TCP communication allowed in-game?

I did so:
http://www.chiefdelphi.com/forums/sh...d.php?t=100558
(Post 5)
  #15   Spotlight this post!  
Unread 19-01-2012, 21:33
shuhao shuhao is offline
Registered User
FRC #4069 (Lo-Ellen Robotics)
Team Role: Mentor
 
Join Date: Nov 2011
Rookie Year: 2012
Location: Sudbury
Posts: 138
shuhao is an unknown quantity at this point
What do you guys think about a restful server so it will be easier to develop and test for?

I feel like a constant connection is not necessary. Also, how are you guys structuring rthe network? Server on laptop or server on crio. The formal seems simpler
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


All times are GMT -5. The time now is 18:48.

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