M300RTK yaw and pitch values are jumping
530 0 2022-2-7
Uploading and Loding Picture ...(0/1)
o(^-^)o
knightsfield
lvl.2
Flight distance : 2520 ft
South Korea
Offline

Hello,

I'm using Mobile SDK iOS version.
Just want to get yaw and pitch values of the M300RTK's gimbal but they are jumping like as this .(The top two values are pitch and yaw)

The code on Mavic 2 Pro, Enterprise dual and air 2 is working well.

The code is like as following,

static func fetchGimbal() -> DJIGimbal? {
        if let product = product() {
            if let aircraft = product as? DJIAircraft {
                return aircraft.gimbal
            }
            if let handheld = product as? DJIHandheld {
                return handheld.gimbal
            }
        }

        return nil
}

:

override func viewDidLoad() {
        super.viewDidLoad()

        fetchGimbal()?.delegate = self
}

:

func gimbal(_ gimbal: DJIGimbal, didUpdate state: DJIGimbalState) {

        gimbalAttinDegrees = state.attitudeInDegrees
        currentDroneYaw = gimbalAttinDegrees!.yaw
        currentDronePitch = gimbalAttinDegrees!.pitch

        DispatchQueue.main.async {
                self.lblYaw.text = String(format:"%.6lf", self.currentDroneYaw)               
                self.lblPitch.text = String(format:"%.6lf", self.currentDronePitch)
        }
}

:


-------------------------
DJI Mobile SDK : latest version (4.15.2)
Device : M300RTK  / Firmware : latest version / camera : H20
DJI Assistant 2 Enterprise : latest version

What is wrong ?

Thanks.




2022-2-7
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules