Full VirtualStick support in MSDK5?

Completed

Comments

8 comments

  • DJI Developer Support
    Actually the IVirtualStickManager was encapsulated by the KeySendVirtualStickFlightControlData, so I assume you want to directly operate those keys. Please refer to the code below. 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
  • Alexis Glass

    Ahh, ok. I didn't find that in the API reference documentation and somehow didn't turn up Brien Crean's previous post on the subject (which I now found when I searched specifically for KeySendVirtualStickFlightControlData).

    0
    Comment actions Permalink
  • DJI Developer Support
    I just wrote an article regards to what you are asking. Please have a read, https://sdk-forum.dji.net/hc/en-us/articles/8697869415577-Chapter-6-The-virtual-stick
    0
    Comment actions Permalink
  • Alexis Glass

    Thank you. One question -

    • The KeySendVirtualStickFlightControlData needs to called under 5Hz.


    I presume that you mean the interval between calls must be under 200ms and that the frequency of calls must therefore be greater than 5Hz, as is the case with V4. Is this correct?

    0
    Comment actions Permalink
  • DJI Developer Support
    Yes, it is the same as v4. The range is 5-25Hz but I found the dev team call it in 5Hz in source code. So I wrote 5Hz in the article.
    0
    Comment actions Permalink
  • Alexis Glass
    The range is 5-25Hz but I found the dev team call it in 5Hz in source code. 


    Does that mean that there's no benefit to calling at a frequency greater than 5Hz?

    0
    Comment actions Permalink
  • DJI Developer Support
    Of course, from 5 to 25Hz, there is no difference in terms of joystick movement, but this will consume lots of thread resource. So you want to use less thread resource as possible.
    0
    Comment actions Permalink
  • Usama Hamayun

    Hi , So are trying setup the frequncy for V5 and there is no KeySendVirtualStickFlightControlData   is APi References is this changed ? 

    or how we can setup this frequency? 

    0
    Comment actions Permalink

Please sign in to leave a comment.