Please select Into the mobile phone version | Continue to access the computer ver.
How to switch flight modes on the Mavic Mini with the MSDK
153 5 7-27 11:38
Uploading and Loding Picture ...(0/1)
o(^-^)o
DJI_Lisa
Second Officer
South Africa
Online

The Mavic Mini does not have a physical toggle on the RC to switch between flight modes (Position, Sport, or CineSmooth mode) and instead, switching is done in the DJI Fly app on the top left hand side of the FPV view.  So how do developers set this up using the SDK?

It can be done with the introduction of a new set of APIs under the Remote Controller class called: SoftSwitchJoyStickMode which has both a getter and setter:


*Just to note - SDK enum name "tripod mode" is the same as CineSmooth
*Also, please note that the UX SDK does support this functionality but does not have the UI built out yet - you'll still need to build it using the MSDK for now





7-27 11:38
Use props
MitchRSM
lvl.4
Flight distance : 149534 ft
  • >>>
San Marino
Offline

iOS link is wrong:  https://developer.dji.com/api-re ... moteController.html
7-27 15:24
Use props
DJI_Lisa
Second Officer
United States
Online

MitchRSM Posted at 7-27 15:24
iOS link is wrong:  https://developer.dji.com/api-reference/ios-api/Components/RemoteController/DJIRemoteController.html

thanks for catching that!
7-27 17:21
Use props
hdrpano
lvl.4
Flight distance : 443593 ft
  • >>>
Switzerland
Offline

I do that with a segment control switch: (iOS swift)  

@IBAction func remoteSwitchMiniAction(_ sender: UISegmentedControl) {
        let RC = ProductCommunicationManager.shared.fetchRemoteController()
        var SoftMode : DJIRCSoftSwitchJoyStickMode = ._P
      
        switch Int(sender.selectedSegmentIndex) {
        case 0:
            SoftMode = ._S
        case 1:
            SoftMode = ._P
        case 2:
            SoftMode = ._T
        default:
            SoftMode = ._P
        }
        if RC != nil {
           if self.aircraftModel == DJIAircraftModelNameMavicMini {
               print("Aircraft is Mini")
               RC?.setSoftSwitchJoyStickMode(SoftMode, completion: { (error: Error?) in
                   if error != nil {
                       print("Error set for Mini");
                   } else {
                    print("Set switch \(SoftMode.rawValue)for Mini")
                   }
               })
           }
       }
    }
7-28 01:09
Use props
hdrpano
lvl.4
Flight distance : 443593 ft
  • >>>
Switzerland
Offline

Watch my video how it works

7-28 07:53
Use props
DJI_Lisa
Second Officer
United States
Online

hdrpano Posted at 7-28 01:09
I do that with a segment control switch: (iOS swift)  

@IBAction func remoteSwitchMiniAction(_ sender: UISegmentedControl) {

Looks great - thanks for posting this!
7-28 09:24
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules