Log in

View Full Version : Anyone know how to offload code to driver station? [xPost]


rebug
08-01-2012, 16:21
http://www.reddit.com/r/chiefdelphi/comments/o8cq3/anyone_know_how_to_offload_code_to_driver_station/

sjspry
10-01-2012, 03:10
Yes, our team did it last year. It is possible to transmit data over TCP/UDP to the robot and back through some open, but normally unused, ports allowed for the competition (they are found in the manual -- others might be open in practice, but only a few are guaranteed). I don't know the numbers specifically, but there is one port open for TCP for the camera, and one without an assigned purpose. Seeing as our team wrote its own dashboard, we had those and the one reserved for the dash.

So it basically turns into writing your processing program on the driver station, and then talking to the robot via TCP. I have some Java code, but the only important part is the usage of the networking library.

Sunstroke
10-01-2012, 09:12
Yes, our team did it last year. It is possible to transmit data over TCP/UDP to the robot and back through some open, but normally unused, ports allowed for the competition (they are found in the manual -- others might be open in practice, but only a few are guaranteed). I don't know the numbers specifically, but there is one port open for TCP for the camera, and one without an assigned purpose. Seeing as our team wrote its own dashboard, we had those and the one reserved for the dash.

So it basically turns into writing your processing program on the driver station, and then talking to the robot via TCP. I have some Java code, but the only important part is the usage of the networking library.

Might I suggest using the new NetworkTable classes found in the robot to do your communication?

I've attached the .jar (well, a .zip containing the .jar) that you need to use a NetworkTable on any computer.

The cool thing about NetworkTable is that there is only one line of setup (NetworkTable.setTeam(...)) and then you just specify a table (like NetworkTable.getTable("random name I came up with")) and that table will exist on both the robot and the computer, and any change you make to it will reflect across both.

Even more crazy, if you use NetworkTable.getTable("SmartDashboard") and you install the SmartDashboard on your classmate, then you will be able to see what values are there on the SmartDashboard.