Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Is TCP communication allowed in-game? (http://www.chiefdelphi.com/forums/showthread.php?t=100102)

sjspry 19-01-2012 23:22

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.

Lalaland1125 20-01-2012 09:43

Re: Is TCP communication allowed in-game?
 
Quote:

Originally Posted by shuhao (Post 1109404)
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

Our team is sticking the server on the laptop.

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).

shuhao 20-01-2012 10:48

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

linuxboy 20-01-2012 17:41

Re: Is TCP communication allowed in-game?
 
Quote:

Originally Posted by sjspry (Post 1109502)
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.

In order to ensure smooth operation of the robots, the Access Point on the field only allows communication between the robot and the driver station over certain ports, so while you will be able to communicate on all ports at your shop, those communications would be blocked on the field. However, if my knowledge of networks is correct, if you have another device on the robot itself (plugged into the bridge) you will be able to talk to the cRIO on all ports.

dellagd 20-01-2012 18:18

Re: Is TCP communication allowed in-game?
 
Quote:

Originally Posted by linuxboy (Post 1109941)
In order to ensure smooth operation of the robots, the Access Point on the field only allows communication between the robot and the driver station over certain ports, so while you will be able to communicate on all ports at your shop, those communications would be blocked on the field. However, if my knowledge of networks is correct, if you have another device on the robot itself (plugged into the bridge) you will be able to talk to the cRIO on all ports.

Correct. The data would just go out the Crio, through your on-robot router, then on to the on-robot laptop. This will be the case if the robot is in Access point mode, like the way we run it in testing at the shop, but since it connects to the field at competitions, it is not in access point mode, and is acting like gateway from the crio to the field. I dont know if you can communicate across the Ethernet ports on the router in this mode, so that will have to be investigated.

linuxboy 20-01-2012 18:33

Re: Is TCP communication allowed in-game?
 
Quote:

Originally Posted by dellagd (Post 1109981)
Correct. The data would just go out the Crio, through your on-robot router, then on to the on-robot laptop. This will be the case if the robot is in Access point mode, like the way we run it in testing at the shop, but since it connects to the field at competitions, it is not in access point mode, and is acting like gateway from the crio to the field. I dont know if you can communicate across the Ethernet ports on the router in this mode, so that will have to be investigated.

I'll see if I can simulate a field environment using custom iptables rules on a wireless router, but here is why I think it would work. Since the cRIO and an onboard computer would both be attached to the switch (robot radio) the switch will have both devices in its ARP table, and, instead of sending packets to the access point for further switching, it would do the communication locally, with the access point never seeing the data. The only way that I think this would be prevented, is if the access point performed an ARP attack on all the devices on the network, however, I doubt this is the case.

shuhao 20-01-2012 18:41

Quote:

Originally Posted by dellagd (Post 1109981)
Correct. The data would just go out the Crio, through your on-robot router, then on to the on-robot laptop. This will be the case if the robot is in Access point mode, like the way we run it in testing at the shop, but since it connects to the field at competitions, it is not in access point mode, and is acting like gateway from the crio to the field. I dont know if you can communicate across the Ethernet ports on the router in this mode, so that will have to be investigated.

That is a legitimate concern. There are more than one team who will rely on opencv and freenect, including ours

dellagd 22-01-2012 09:53

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