评论

5 条评论

  • DJI Developer Support
    Could you tell me what SDK you are using? Or what aircraft are you using?
    0
    评论操作 固定链接
  • MountainTreeBook

    Hi, 

    dji-sdk:4.16 and Mavic 2. 

    0
    评论操作 固定链接
  • DJI Developer Support
    After successful registration, you can get the connected aircraft by getProduct(note that you need to convert the product object to aircraft), then get the gimbal object by aircraft.getGimbal, and then set the listeners to the obtained gimbal object, the code is as follows: aircraft.getGimbal().setStateCallback(new GimbalState.Callback() { @Override public void onUpdate(@NonNull GimbalState gimbalState) { stringBuffer.delete(0, stringBuffer.length()); stringBuffer.append("PitchInDegrees: "). append(gimbalState.getAttitudeInDegrees().getPitch()).append("\n"); stringBuffer.append("RollInDegrees: "). append(gimbalState.getAttitudeInDegrees().getRoll()).append("\n"); stringBuffer.append("YawInDegrees: "). append(gimbalState.getAttitudeInDegrees().getYaw()).append("\n"); showStringBufferResult(); }}); The same logic is used for IOS , only the interface used is different.
    0
    评论操作 固定链接
  • MountainTreeBook

    thank you, this to be put inside main activity?

    0
    评论操作 固定链接
  • DJI Developer Support
    It can be placed in any activity, but it should be noted that setting the listener again will overwrite the previous one.
    0
    评论操作 固定链接

请先登录再写评论。