Comments

3 comments

  • DJI Developer Support
    M2EA设置焦距使用的代码如下图。您是使用的lens类来进行对焦距的设置吗?设置的焦距是否在范围呢? ![](https://djisdksupport.zendesk.com/attachments/token/Gtcxe1wtJ1gBbNhCJWbjMKnKY/?name=inline-1799462665.png)
    0
    Comment actions Permalink
  • xxx
    getFocalLengthStep设置倍率返回Camera received invalid parameters(255)
    0
    Comment actions Permalink
  • DJI Developer Support
    getFocalLengthStep获取到的是焦距之间的最小步长。你可以测试一下在setHybridZoomFocalLength中传入当前焦距加上或者减去最小步长的焦距值。参考代码如下: Lens lens = camera.getLens(0); lens.getHybridZoomFocalLength(new CommonCallbacks.CompletionCallbackWith() { @Override public void onSuccess(Integer integer) { lens.getHybridZoomSpec(new CommonCallbacks.CompletionCallbackWith() { @Override public void onSuccess(SettingsDefinitions.HybridZoomSpec hybridZoomSpec) { Log.d("HybridZoom", "onSuccess: Max_Focal_Length:"+hybridZoomSpec.getMaxHybridFocalLength()+"Min_Focal_length:"+hybridZoomSpec.getMinHybridFocalLength()); int focal_length = integer+hybridZoomSpec.getFocalLengthStep(); if(focal_length > hybridZoomSpec.getMaxHybridFocalLength()) { focal_length = hybridZoomSpec.getMaxHybridFocalLength(); } camera.getLens(0).setHybridZoomFocalLength(focal_length, new CommonCallbacks.CompletionCallback() { @Override public void onResult(DJIError djiError) { if(djiError != null) { ToastUtils.setResultToToast("setHybridZoomFocalLength error:"+djiError.getDescription()); } else { ToastUtils.setResultToToast("setHybridZoomFocalLength Success"); } } }); } @Override public void onFailure(DJIError djiError) { Log.d("HybridZoom", "getHybridZoomSpec onFailure: error:"+djiError.getDescription()); } }); } @Override public void onFailure(DJIError djiError) { Log.d("HybridZoom", "getHybridZoomFocalLength onFailure: error:"+djiError.getDescription()); } });
    0
    Comment actions Permalink

Please sign in to leave a comment.