Quote:
Originally Posted by kmckay
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.