Download Thumbnails from Rolling spider


#1

Product: [Rolling Spider]
Product version: [X.X.X]
SDK version: [Sample]
Use of libARController: [YES/NO] (Only for ARSDK)
SDK platform: [Android]
Reproductible with the official app: [YES/NO/Not tried]

Hi,

I am a beginner and I have got stuck at this point.

I want to download thumbnails not the full size pictures from my rolling spider. So I tried to make some modifications to the SDCardModule included in the Android SDKSample. I have tried with the codes provided online but it is especially for Bebop drone so I cannot use it for Rolling Spider. Is there anyone can help me with this problem? Please!

Thanks in advance!


#2

Hi,

To get the thumbnails in the SDK Sample, you just have to change the call to mediasDownloader.getAvailableMediasSync() in the SDCardModule.java file (line 206): Change the argument from false to true and the thumbnails will be downloaded for each ARDataTransferMedia in the list.

You can then get the thumbnails for each media with the media.getThumbnail() method. This methods returns a byte[] which should be decoded as a jpeg image. The following code is an example of how to display a thumbnail in an ImageView:

public void displayThumbnail(ARDataTranferMedia media, ImageView iw) {
    byte [] data = media.getThumbnail();
    Bitmap b = BitmapFactory.decodeByteArray(data, 0, data.length);
    iw.setImageBitmap(b);
}

Regards,
Nicolas.


#3

Hi Nicolas,

Thank you very much for your reply. I’m going to try it today and to see how it works.

Best,
Yishu


#4

Hi Nicolas,

Sorry for the late feedback. I tried following your instruction and thumbnails can be got now. Thank you so much!

Regards,
Xiaoxiao_Su


#5

Hi, I have a question. When you download the thumbnails, can drone hover? or you download thumbnails after drone has landed?


#6

Hi,

Now I just make the thumbnails show on the screen and have not achieved exactly downloading them and saving them to the local directory.I may do this task later.

However, you can download pictures when the drone is hovering just to set the mDownloadBt always enabled,i.e., in the MiniDroneActivity, to change “false” in “mDownloadBt.setEnabled(false);” to “true” (line 118, 363, 369 and 373).

I hope I have explained it clearly and this will work for you.

Best regards,
Xiaoxiao_Su


#7

Thank you so much!! I achieve it opening a new BLE connection to the drone to download thumbnails and stopping device controller. I close this connection after download thumbnails, then start again device controller. In your way I haven’t to close connection and open another connection to download thumbnails, right?


#8

Hi,

Sorry for the late reply. I think your method is more stable? Yes, my method doesn’t need to open a new BLE connection but will become unstable when battery is low(cannot finish the downloading). One can make the Rolling Spider to download pictures when hovering but it cannot afford keeping doing that because its battery will die very soon.

Can you download the thumbnails and store them in your mobile phone? Can you tell me how did you do that? Thanks in advance!

Best,
Xiaoxiao_Su


#9

Hi, I have did how say you in the previous post. I have stopped the control device that sends command to pilote the drone, then I download only the last thumbnail I have taked. So I preserve battery life and download and store the thumbnail.