Mobile-SDK-Android-V5 icon indicating copy to clipboard operation
Mobile-SDK-Android-V5 copied to clipboard

Question about Thermal camera

Open Tin-moon opened this issue 1 year ago • 13 comments

Hello, can you help me, I have 2 questions:

  1. Is it possible to find out that the thermal camera is not disabled by the user?
  2. Is it possible to access files stored on the drone (photo)? SDK 5.9.0

The user turned off the thermal camera, and I'm looking for a way to turn it on or at least warn the user that it is turned off. Thanks

Tin-moon avatar Jun 11 '24 11:06 Tin-moon

Agent comment from yating.liao in Zendesk ticket #109453:

Is it possible to find out that the thermal camera is not disabled by the user? --> What do you think is the manifestation of disabling the thermal lens? For drones with thermal lenses, it is not possible to disable the thermal lens, but you can simply choose not to use it.

Is it possible to access files stored on the drone (photo)? --> The SDK can be used to access the photos taken by the drone.

°°°

dji-dev avatar Jun 12 '24 11:06 dji-dev

Is it possible to find out that the thermal camera is not disabled by the user? --> What do you think is the manifestation of disabling the thermal lens? For drones with thermal lenses, it is not possible to disable the thermal lens, but you can simply choose not to use it.

I mean this cases :

  • when we uncheck the visible picture capture option on DJI Pilot, app do not correct and don't take visible pictures
  • when we uncheck the thermal picture capture option on DJI Pilot, app do not correct and take thermal pictures

can I check this in my application and tell the user that it should be enabled, or in an ideal case, force it to be enabled myself?

Tin-moon avatar Jun 13 '24 06:06 Tin-moon

When we set the zoom on DJI Pilot, the app record the datas regarding the information on the main software. Which means we have zoom pictures.

But the mission file specifies the parameters that the photos should be WIDE

               template.payloadParam = listOf(
                    WaylinePayloadParam().also { param ->
                        param.imageFormat = listOf(CameraLensType.WIDE, CameraLensType.IR)
                    }
                )

Is it possible to switch this as well? or is there a problem when creating the mission file?

Tin-moon avatar Jun 13 '24 06:06 Tin-moon

Agent comment from yating.liao in Zendesk ticket #109453:

can I check this in my application and tell the user that it should be enabled, or in an ideal case, force it to be enabled myself? -->You can use KeyCaptureCameraStreamSettings to retrieve the photo storage settings of the drone, and then implement prompts and reset.https://sdk-forum.dji.net/hc/en-us/articles/27711939648025-How-to-configure-which-photos-are-stored-from-the-lenses?source=search&auth_token=eyJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50X2lkIjo5Nzg4MTcsInVzZXJfaWQiOjI3NTEzNjYyMzk2OTUzLCJ0aWNrZXRfaWQiOjEwOTQ1MywiY2hhbm5lbF9pZCI6NjMsInR5cGUiOiJTRUFSQ0giLCJleHAiOjE3MjA4NzQ4ODd9.jLFuJSSgJZI_IxYJNGpulIeg4q_FgjjPQWhck5rdmzg

Is it possible to switch this as well? or is there a problem when creating the mission file? -->Could you tell us what type of drone you are using? It is possible to set up photo storage individually in the waypoint mission file, but not all drones support this feature.

°°°

dji-dev avatar Jun 13 '24 12:06 dji-dev

Could you tell us what type of drone you are using? It is possible to set up photo storage individually in the waypoint mission file, but not all drones support this feature.

Mavic 3T

Tin-moon avatar Jun 13 '24 14:06 Tin-moon

Agent comment from yating.liao in Zendesk ticket #109453:

Mavic 3T does not support setting the photo capture type in waypoint missions. You need to use KeyCaptureCameraStreamSettings to configure the camera. In fact, Mavic 3T generates a maximum of two photos in one shot, one is a visible photo (wide or zoom), and the other is an infrared photo. Whether the visible photo stores content from the wide or zoom lens depends on whether the current video source is wide or zoom.

°°°

dji-dev avatar Jun 14 '24 07:06 dji-dev

Hi, сould you please also tell me which keys need to be used to change the values:

  • Force Wide and IR
  • Force mode 4k (12Mp),
  • Force mode auto for: iso, aperture and shutter time

Tin-moon avatar Jun 19 '24 08:06 Tin-moon

Agent comment from yating.liao in Zendesk ticket #109453:

Could you explain what "Force Wide and IR" refers to? Are you requesting the screen to display both wide and IR images simultaneously?

Set 4K Video:KeyVideoResolutionFrameRate{https://developer.dji.com/api-reference-v5/android-api/Components/IKeyManager/Key_Camera_CameraKey.html#key_camera_videoresolutionframerate_inline}

Set Auto exposure mode:KeyExposureMode{https://developer.dji.com/api-reference-v5/android-api/Components/IKeyManager/Key_Camera_CameraKey.html#key_camera_exposuremode_inline}

°°°

dji-dev avatar Jun 20 '24 08:06 dji-dev

Hi, I set the parameters, but I get the following result:

CameraKey.KeyCameraVideoStreamSourceRange error: ErrorImp{errorType='COMMON', errorCode='UNSUPPORTED' CameraKey.KeyPhotoResolution error: ErrorImp{errorType='CORE', errorCode='REQUEST_HANDLER_NOT_FOUND' CameraKey.KeyISORange error: ErrorImp{errorType='CORE', errorCode='REQUEST_HANDLER_NOT_FOUND' CameraKey.KeyExposureMode error: ErrorImp{errorType='CORE', errorCode='INVALID_PARAMERTERS' CameraKey.KeyVideoResolutionFrameRate error: ErrorImp{errorType='CORE', errorCode='SYSTEM_ERROR'

can you tell me what could be the problem?

Tin-moon avatar Jun 20 '24 20:06 Tin-moon

Agent comment from yating.liao in Zendesk ticket #109453:

Could you tell me about how you have been configured?

°°°

dji-dev avatar Jun 21 '24 07:06 dji-dev

Agent comment from yating.liao in Zendesk ticket #109453:Could you tell me about how you have been configured?

°°°

Hi

    private fun setCameraSettings() {
        OLog.e(TAG, "setCameraSettings")

        DJISDKModel.getInstance().also { djiSdkModel ->

            val cameraIndex = ComponentIndexType.LEFT_OR_MAIN

            djiSdkModel.setValue(
                KeyTools.createKey(CameraKey.KeyVideoResolutionFrameRate, cameraIndex),
                VideoResolutionFrameRate(VideoResolution.RESOLUTION_3840x2160, VideoFrameRate.RATE_30FPS)
            )
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe({
                    Log.e(TAG, "CameraKey.KeyVideoResolutionFrameRate Ok")
                }, {
                    Log.e(TAG, "CameraKey.KeyVideoResolutionFrameRate error: ${it.message} | ${it.stackTraceToString()}")
                }).addDisposable()

            djiSdkModel.setValue(
                KeyTools.createKey(CameraKey.KeyPhotoResolution, cameraIndex),
                PhotoResolution.RESOLUTION_12MP
            )
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe({
                    Log.e(TAG, "CameraKey.KeyPhotoResolution Ok")
                }, {
                    Log.e(TAG, "CameraKey.KeyPhotoResolution error: ${it.message} | ${it.stackTraceToString()}")
                }).addDisposable()

            djiSdkModel.setValue(
                KeyTools.createKey(CameraKey.KeyShutterSpeed, cameraIndex),
                CameraShutterSpeed.SHUTTER_SPEED_AUTO
            )
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe({
                    Log.e(TAG, "CameraKey.KeyShutterSpeed Ok")
                }, {
                    Log.e(TAG, "CameraKey.KeyShutterSpeed error: ${it.message} | ${it.stackTraceToString()}")
                }).addDisposable()

            djiSdkModel.setValue(
                KeyTools.createKey(CameraKey.KeyExposureMode, cameraIndex),
                CameraExposureMode.SHUTTER_PRIORITY
            )
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe({
                    Log.e(TAG, "CameraKey.KeyExposureMode Ok")
                }, {
                    Log.e(TAG, "CameraKey.KeyExposureMode error: ${it.message} | ${it.stackTraceToString()}")
                }).addDisposable()

            djiSdkModel.setValue(
                KeyTools.createKey(CameraKey.KeyISORange, cameraIndex),
                listOf(CameraISO.ISO_AUTO)
            )
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe({
                    Log.e(TAG, "CameraKey.KeyISORange Ok")
                }, {
                    Log.e(TAG, "CameraKey.KeyISORange error: ${it.message} | ${it.stackTraceToString()}")
                }).addDisposable()

            djiSdkModel.setValue(
                KeyTools.createKey(CameraKey.KeyAperture, cameraIndex),
                CameraAperture.F_AUTO
            )
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe({
                    OLog.e(TAG, "CameraKey.KeyAperture Ok")
                }, {
                    OLog.e(TAG, "CameraKey.KeyAperture error: ${it.message} | ${it.stackTraceToString()}")
                }).addDisposable()

            djiSdkModel.setValue(
                KeyTools.createKey(CameraKey.KeyCameraVideoStreamSourceRange, cameraIndex),
                listOf(CameraVideoStreamSourceType.WIDE_CAMERA, CameraVideoStreamSourceType.INFRARED_CAMERA)
            )
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe({
                    OLog.e(TAG, "CameraKey.KeyCameraVideoStreamSourceRange Ok")
                }, {
                    OLog.e(TAG, "CameraKey.KeyCameraVideoStreamSourceRange error: ${it.message} | ${it.stackTraceToString()}")
                }).addDisposable()

        }
    }

Tin-moon avatar Jun 21 '24 07:06 Tin-moon

HI

djiSdkModel.setValue(
                KeyTools.createCameraKey(CameraKey.KeyCaptureCameraStreamSettings, cameraIndex, lensType),
                CameraStreamSettingsInfo(true, listOf(CameraVideoStreamSourceType.WIDE_CAMERA, CameraVideoStreamSourceType.INFRARED_CAMERA))
            )
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread())
                .subscribe({
                    OLog.e(TAG, "CameraKey.KeyCaptureCameraStreamSettings Ok")
                }, {
                    OLog.e(TAG, "CameraKey.KeyCaptureCameraStreamSettings error: ${it.message}")
                }).addDisposable()

get error

CameraKey.KeyCaptureCameraStreamSettings error: ErrorImp{errorType='CORE', errorCode='SYSTEM_ERROR', innerCode='', description='null', hint='error code = -7'}

Tin-moon avatar Jun 24 '24 07:06 Tin-moon

Agent comment from yating.liao in Zendesk ticket #109453:

I recommend to look at this article first:https://sdk-forum.dji.net/hc/en-us/articles/27711939648025-How-to-configure-which-photos-are-stored-from-the-lenses

The WIDE_CAMERA cannot be set in the Mavic 3 Enterprise Series.

°°°

dji-dev avatar Jun 26 '24 03:06 dji-dev