Thread: UDP Server
View Single Post
  #3   Spotlight this post!  
Unread 13-08-2012, 23:01
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: UDP Server

Quote:
Originally Posted by divixsoft View Post
Thanks for the link, and sorry for the late repley. But I would really appreciate it if you could explain to me how this worked. I open the file they uploaded in netBeans, and loaded the libraries, but I didn't know what the classpath was and there was abunch of errors everywhere. Also if you could explain to me how the whole network thing worked I would greatly appreciate it. I know this is a lot to ask, so thanks in advance.
I assume you're talking about the code the 341 posted ("DaisyCV"). I would suggest PMing Jared with questions, as he was the one who wrote it.

In terms of how sending images over the network works in general, most teams this year connected their cameras directly to the WiFi bridge on the robot, so the camera was part of the same network as the driver station and the cRIO. Thus, the driver station laptop can request images directly from the camera (the WPIlib libraries for all three languages contain code to do this), then the driver station can process these images. It's possible to write programs in any of the three languages to run on the driver station, or you could even use a language not supported by FIRST if you are feeling adventurous.

You'll want to do as much processing on the driver station as you can to get the information into as compressed a form as possible, which will reduce the amount of network traffic. Ideally, you should only be sending back (pan, tilt, distance) triplets, (pan, motorSpeed), or something similar (obviously, the required information will depend on your robot's design).

The only challenge remaining, then, is how to send the results of the processing back to the cRIO. You can roll your own communication channel using a raw UDP connection, but you can also use the SmartDashboard facilities built into WPIlib, which is what 341 did, which give you an easy way to communicate data values between the driver station and the cRIO, which is what it looks like 341 did (you can see them writing the values on lines 285-289 of DaisyCVWidget.java).
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote