Virtual Stick Implementation in MSDK V5

Completed

Comments

6 comments

  • DJI Developer Support
    The MSDK V5 has refactored the whole virtual stick function. The virtual stick is just like a virtual remote controller, you can get left and right stick and set their value. All values are from -660 to 660. You need to find a linear relationship between the stick value to the speed. Different aircraft will have different coefficient. The Mini 3 Pro will not support waypointMissions. The plan to support Mini 3 Pro for MSDK is about next year.
    0
    Comment actions Permalink
  • Brien Crean

    The Virtual Stick feature of version 4 of the MSDK was its most reliable feature across all drone models with a relatively easily accessible interface. I can't see how this refactor improves on the previous iteration of virtual stick? This will make it much more difficult to automate drone flight for drones like the mini 3. Access to an interface that can receive pitch, roll, yaw angles or velocities would be much more useful in my opinion since many people have already implemented solutions for this.

    Will the mini 3 only be controllable via the new virtual stick interface?

    0
    Comment actions Permalink
  • DJI Developer Support
    We are now preparing the guide to help you switch from MSDK 4.x vesion to 5.x version. The virtual stick function you have mention, we do have some flightControllerKeys that matches with the previous MSDK 4.x version. The doc is about going online in the end of June in both Chinese and English version. Here is a screenshot of it. The KeyVirtualStickEnabled and KeySendVirtualStickFlightControlData are what you want. I am going to write an article with it soon. ![](https://djisdksupport.zendesk.com/attachments/token/Qu7ARF15JuTKmX0D5I03ygaVs/?name=image.png)
    0
    Comment actions Permalink
  • Brien Crean

    Oh that sounds great, KeySendVirtualStickFlightControlData sounds like what I need thank you! I look forward to reading about it

    0
    Comment actions Permalink
  • Brien Crean

    I think I found the relevant key. I wasn't sure of the order of the 1st 4 (Double) parameters as they weren't named. But that can be easily discovered with some testing in the simulator

    val vsSendDataKey: DJIKey.ActionKey<VirtualStickFlightControlParam, EmptyMsg> = KeyTools.createKey(
                        FlightControllerKey.KeySendVirtualStickFlightControlData
                )
                djiSdkModel.setValue(
                        vsSendDataKey,
                        VirtualStickFlightControlParam(
                              0.0,  // Double: pitch in m/s ?
                              0.0,  // Double: roll in m/s ?
                              0.0,  // Double: yaw in degrees ?
                              50.0, // Double: altitude position in metres ?
                                VerticalControlMode.POSITION,
                                RollPitchControlMode.VELOCITY,
                                YawControlMode.ANGLE,
                                FlightCoordinateSystem.GROUND
                        )
                )
    0
    Comment actions Permalink
  • DJI Developer Support
    controlParam.setVerticalControlMode(verticalControlMode); controlParam.setRollPitchControlMode(rollPitchControlMode); controlParam.setYawControlMode(yawControlMode); controlParam.getRollPitchCoordinateSystem(rollPitchCoordinateSystem); controlParam.setVerticalThrottle(verticalThrottle); controlParam.setYaw(yaw); controlParam.setPitch(pitch); controlParam.setRoll(roll); KeyManager.getInstance().performAction(KeyTools.createKey(FlightControllerKey.KeySendVirtualStickFlightControlData), controlParam, Callback);
    0
    Comment actions Permalink

Please sign in to leave a comment.