Sunday, October 18, 2015

Capturing Parrot Jumping Sumo video packets in Python's UDPServer

One of the key goals of my sumo-charge project has been to have the Sumo auto-dock by driving towards a "landmark" (a barcode in my case).

To do this I obviously need access to the video stream from the Sumo. The video UDP packets are the same format as the rest of the response data, but for some reason I was not receiving them using Python's UDPServer.

After much flailing around on Google I fired up Wireshark and discovered those packets were being sent still, so it was definitely a problem with my UDP server. Digging deeper (thanks, stack overflow) I discovered that the maximum packet size in UDPServer was hard-coded to less than the size of the video packets.

The size of the video packets sent by the Sumo is established in the reply during the initialisation handshake to TCP port 44444, in the 'arstream_fragment_size' field (65000 in this instance):

To receive the video packets you need to update your UDPServer instance's 'max_packet_size' with the same value:

No comments:

Post a Comment