![]() |
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). |
Re: Is TCP communication allowed in-game?
See the rule below.
Quote:
|
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::ouch:: |
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. |
Re: Is TCP communication allowed in-game?
1 Attachment(s)
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 |
Re: Is TCP communication allowed in-game?
Quote:
|
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.. |
Re: Is TCP communication allowed in-game?
Quote:
|
Re: Is TCP communication allowed in-game?
Quote:
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). |
Re: Is TCP communication allowed in-game?
Quote:
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 |
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? |
Re: Is TCP communication allowed in-game?
Quote:
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. |
Re: Is TCP communication allowed in-game?
1 Attachment(s)
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: |
Re: Is TCP communication allowed in-game?
|
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 |
Re: Is TCP communication allowed in-game?
As has been answered, yes it is. What has not been mentioned however is that TCP communications are restricted (or were restricted, as of last year) to specific ports, both of which were used up by the dashboard and/or the camera, iirc. In practice, this might not be the case, but I wouldn't rely on it.
|
Re: Is TCP communication allowed in-game?
Quote:
We are not sticking the server on the crio for two reasons: 1. Having a server on the robot increases complexity. I trust neither myself nor the crio to do threads correctly and well, and those threads would be needed to create a "good" server. Having a server on the robot would also complicate code which should be kept as simple as possible(because if the crio crashes, all your other electronics do nothing). 2. If the crio is a client, it can immediately tell when the server is offline(it will fail at the initialization of the robot when it tries to connect). This allows us to simply set a "serverFail" boolean to true, and skip over the network code so that the robot can continue to function even when the server is offline. For easier development our team is simply using a text protocol JSON, which should make many things simpler(and is a heck of alot easier to debug as well). |
I feel like rest would be the easiest as it's json that you can use your browser to debug and use the HTTPclient class aand a HTTP server
Though there will be no constant connection |
Re: Is TCP communication allowed in-game?
Quote:
|
Re: Is TCP communication allowed in-game?
Quote:
|
Re: Is TCP communication allowed in-game?
Quote:
|
Quote:
|
Re: Is TCP communication allowed in-game?
The only reason I see this working across the router is from experience, since when we test our bot in the pits we plug into a Ethernet port in the router without changing its settings. Then again, we arnt connected to the field at that point.
|
| All times are GMT -5. The time now is 18:48. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi