ar drone tcp status update 2

1 view
Skip to first unread message

Sunny Gautam

unread,
May 26, 2013, 5:54:32 PM5/26/13
to moon...@googlegroups.com
Hey guys,

Sorry for the fact it is taking awhile, I have been able to stream the AR Drone video to my laptop by TCP'ing each image buffer which takes about 0.3-0.5 sec max but usually much faster per image). Problem I'm getting right now is that some images are perfect and others are a bit distorted. I found the problem is that the computer doesn't always receive all of the bytes of data and so it has to either reread the data or the AR Drone needs to re-send the data. I will be adding and testing the proper code tonight and uploading everything I have tonight as tomorrow I will be in Ohio for a couple days. 

I have attached five sample images that were all streamed consecutively of a video playing on my Nexus. They were streamed by the AR Drone and TCP'ed consecutively to my computer and then saved as YUV files which I then converted to BMP for your convenience. You can tell they are all different images from different times due to the changes in the video on the nexus. You can also see the problem that happens during streaming. 

Best regards,
Sunny Gautam
image0.bmp
image1.bmp
image2.bmp
image3.bmp
image4.bmp

Sam Liu

unread,
May 26, 2013, 8:37:46 PM5/26/13
to moon...@googlegroups.com
Great work dude. Interesting. Do you think it has to do with the way we're retrieving the image buffer? I'm thinking this could be because of race conditions (we're retrieving the data the same time that the firmware is updating the data) -- we might need to use locking of some sort.

Can you push all your code to github?

Sam

Sunny Gautam

unread,
May 26, 2013, 8:53:56 PM5/26/13
to moon...@googlegroups.com
I kinda thought the same thing at first. I tested by using the sleep function before retrieving the image and I get the same results. My reasoning that the sleep function should work is that the video stream is working on a different thread and shouldn't be interrupted by the sleep function. Either way, that didn't work. I found that the computer was not reading all of the bytes in the data stream, so that is definitely a major part if not the whole problem. I know how to fix this (read the missing number of bytes from the data stream before moving on to reading the next section of the image). 

I went through your video and found that the resolution was really low and could not read the code on your terminal but I will see again later tonight after some testing if I understand how to pull the code onto github. The following is the files I have created/modified for the streaming TCP tests just in case you want to look at the code now.

Regards,
Sunny   
main_video.c
video.c
video.h
client5.c
Reply all
Reply to author
Forward
0 new messages