How to switch flight modes on the Mavic Mini with the MSDK
4308 5 2020-7-27
Uploading and Loding Picture ...(0/1)
o(^-^)o
DJI_Lisa
lvl.4
Hong Kong
Offline

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





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

iOS link is wrong:  https://developer.dji.com/api-re ... moteController.html
2020-7-27
Use props
DJI_Lisa
lvl.4
United States
Offline

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!
2020-7-27
Use props
hdrpano
lvl.4
Flight distance : 598458 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")
                   }
               })
           }
       }
    }
2020-7-28
Use props
hdrpano
lvl.4
Flight distance : 598458 ft
  • >>>
Switzerland
Offline

Watch my video how it works

2020-7-28
Use props
DJI_Lisa
lvl.4
United States
Offline

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!
2020-7-28
Use props
Advanced
You need to log in before you can reply Login | Register now

Credit Rules