Mobile-UXSDK-Android icon indicating copy to clipboard operation
Mobile-UXSDK-Android copied to clipboard

Blank FPVWidget

Open FaridHadi opened this issue 7 years ago • 11 comments

I have a problem of blank FPV when running my app on CrystalSky + Matrice 210. The problem disappears if I clear my app data.

Any kind of help would be appreciated.

using

  • 'com.dji:dji-uxsdk:4.5'
  • 'com.dji:dji-sdk-provided:4.5'
        
        super.onCreate(savedInstanceState)
        
        setContentView(R.layout.activity_default_layout)
        
        FPVWidget.videoSource = dji.ux.widget.FPVWidget.VideoSource.PRIMARY
       
        handler = Handler()

        spinnerUI()
        spinnerSectionsUI()

        val gimbals = DemoApplication.getAircraftInstance().gimbals

        for (gimbal in gimbals) {
            if (gimbal.index == 0 && gimbal.isConnected) {
                connectedGimbal = gimbal
            }
        }

        connectedGimbal?.let {
            it.setStateCallback {
                handler!!.post {
                    textPercentAlt.text = "pitch\n${it.attitudeInDegrees.pitch}"
                }
            }
        }

        DemoApplication.getCameraInstance()?.let {

            it.getLensInformation(object: CommonCallbacks.CompletionCallbackWith<String>{
                override fun onSuccess(p0: String?) {
                    Log.d("Wind", "lens info : ${p0!!}")
                }

                override fun onFailure(p0: DJIError?) {
                    Log.d("Wind", "lens info failed : ${p0!!.description}")
                }

            })

            it.setMediaFileCallback(this)
            it.setMode(SettingsDefinitions.CameraMode.SHOOT_PHOTO, {
                if (it != null) {
                    Log.e("Wind", "Error set mode")
                }
            })
        }

        DemoApplication.getAircraftInstance().flightController.flightAssistant!!.setVisionControlStateUpdatedcallback {
            DemoApplication.getAircraftInstance().flightController.flightAssistant!!.setVisionDetectionStateUpdatedCallback {
                it.isSensorBeingUsed
                distance0 = if (it.detectionSectors.indices.contains(0)) {
                    it.detectionSectors[0].obstacleDistanceInMeters
                } else {
                    null
                }

                distance1 = if (it.detectionSectors.indices.contains(1)) {
                    it.detectionSectors[1].obstacleDistanceInMeters
                } else {
                    null
                }

                distance2 = if (it.detectionSectors.indices.contains(2)) {
                    it.detectionSectors[2].obstacleDistanceInMeters
                } else {
                    null
                }

                distance3 = if (it.detectionSectors.indices.contains(3)) {
                    it.detectionSectors[3].obstacleDistanceInMeters
                } else {
                    null
                }
                val distances = floatArrayOf(distance0!!, distance1!!, distance2!!, distance3!!)
                val isLarger0 = distances.filter {
                    it > 0
                }
                distance = if (isLarger0.all { it <= 0.0F }) {
                    0F
                } else {
                    isLarger0.min()!!
                }
            }

        }

        DemoApplication.getAircraftInstance().flightController.setStateCallback {
            verticalClimb = if (it.velocityZ == 0F) {
                0f
            } else {
                it.velocityZ
            }

            flightCurrentLocation = it.aircraftLocation
            currentAltitude = flightCurrentLocation!!.altitude

            currentHeading = it.aircraftHeadDirection
        }

        btnCLimbUp.setOnClickListener(this)
        btnDescent.setOnClickListener(this)
    }
  • test using crystalsky system version 02.05.00.00
compileSdkVersion` 26
    buildToolsVersion '26.0.2'
    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        // Enabling multidex support.
        multiDexEnabled true
        ndk {
            abiFilters 'armeabi-v7a', 'x86', 'arm64-v8a'
        }
    }

  • DJI Product is Mavic pro and M210 + olympus 45mm m. zuiko
  • Android studio version 3.1.1
  • Code is edited from UILibrary sample code

Thank you

2018-04-25 18 29 35

FaridHadi avatar Apr 25 '18 10:04 FaridHadi

The same for me, I'm using implementation 'com.dji:dji-uxsdk:4.11.1' and Phantom Advanced 3

walkmn avatar Jan 30 '20 15:01 walkmn

Hi, Did you succeed in fixing this issue ? Same prob here, even when clearing app data / cache. Thank's in advance !

Caufmann avatar Nov 02 '20 09:11 Caufmann

@Caufmann - what camera are you using? Can you describe your entire environment? -MSDK and UX SDK Version -Gimbal/Camera Setup -M210 Firmware version -CrystalSky firmware version -Steps to reproduce the behavior

dji-lisafedane avatar Nov 02 '20 20:11 dji-lisafedane

Hi, thanks for your answer.

I fixed the problem, I can now see the video stream every time I launch my application.

The problem I got now is that every 5 to 10 secs, the bottom of the video stream freezes for 1sec (low frame rate / bad pixel definition / green pixels). I didn't manage to fix this issue for now.

Does this feel like a known issue ? Is there a way we can access to the video stream parameters programmatically ?

It doesn't seem to be related with a programming error as the video stream was also "freezing" only with the UXSDKDemo provided by DJI.

Thx

Using : Latest MSDK and UXSDK (no beta) M210V2 with Zenmuse X5S Crystal SKY Kernel : 3.10.0 / System version : 3.0.2.0

Steps to reproduce : Just call FPV Widget in your layout file

Caufmann avatar Nov 06 '20 09:11 Caufmann

If you use DJI Pilot App do you see it freezing?

dji-lisafedane avatar Nov 06 '20 18:11 dji-lisafedane

Hi, No i don't see it freezing using DJI Pilot. Thx,

Caufmann avatar Nov 09 '20 09:11 Caufmann

@Caufmann - thanks for answering that. We're investigating this now and I'll update the thread with what we find

dji-lisafedane avatar Nov 09 '20 23:11 dji-lisafedane

@Caufmann - how often does this behavior reproduce? 100%, 50% etc? And what is your test environment set-up? ie. Indoors, Outdoors, etc...

dji-lisafedane avatar Nov 09 '20 23:11 dji-lisafedane

Hi, Thanks for your reply.

This behaviour reproduces everytime I launch my custom app on the Crystal Sky. I'm testing this indoor.

Is this problem a known issue ?

Thank's

Caufmann avatar Nov 19 '20 14:11 Caufmann

This is not a known issue. Are you able to reproduce this behavior if you use the UX SDK Sample App?

dji-lisafedane avatar Nov 19 '20 20:11 dji-lisafedane

Yes, i am able to reproduce this behavior using the UX SDK Sample App

Is there a way we can acces the video stream parameters (framerate / video quality / etc) of the Zenmuse ?

Caufmann avatar Nov 26 '20 10:11 Caufmann