View Single Post
  #13   Spotlight this post!  
Unread 12-12-2016, 17:30
BenBernard BenBernard is offline
Registered User
FRC #5687 (The Outliers)
Team Role: Mentor
 
Join Date: Jan 2016
Rookie Year: 2015
Location: Portland, ME
Posts: 37
BenBernard is an unknown quantity at this point
Re: network tables and the raspberry pi

Quote:
Originally Posted by kmckay View Post
Do you have a good source of code for reading the UDP into a robot program?
I'll let you judge whether it's "good" or not, but we do have both ends of the UDP communication in our github.

On the pi, we run pi-tracker and communicaton with the rio is through RobotProxy. RobotProxy starts a thread to listen for incoming UDP packets from the rio, and expose the incoming values. It also provides the Send method to send updates to the rio.

On the rio, the robot code uses the PiTrackerProxy exactly the same way: it starts a thread to listen for incoming packets from the pi while providing the collect method to send packets to the pi.

Note that the reason for this complicated mechanism was to more precisely correlate the timing of images to the position the robot was in when the picture was taken. For more on this, see Team 254's video and presentation.

We then compute a new "target" pose based on the image and pose when the image was taken, and use PID to get us there.
Reply With Quote