ios - M300 - 如何挑选镜头和拍照?SDK IOS
问题描述
我正在尝试使用 iOS SDK 使用 M300 RTK 拍照。我正在调整一个正常工作的 Mavic 2 Pro 应用程序,但无法使其与带有 H20 的 M300 RTK 一起工作。
我试过以下代码:
camera?.setFlatMode(DJIFlatCameraMode.photoSingle, withCompletion: { (e:Error?) in
// some error handling
// take the photo
camera?.startShootPhoto(completion: { (error:Error?) in
// other error handling
})
})
此代码不会发送任何错误,但无人机不会拍摄任何照片。PhotoInterval
我已经成功地使用了两次拍照,但现在设置了TimeIntervalSetting
回报DJI SDK has come across unknown error code(217). Please update SDK or contact DJI Developer Relations to know more information on this error
。
即使在拍照时,我也无法选择使用哪个镜头(H20 有两个镜头:变焦和广角),我尝试了以下代码但没有成功:
camera?.setFlatMode(DJIFlatCameraMode.photoInterval, withCompletion: { (e:Error?) in
// error handling...
camera?.setPhotoTimeIntervalSettings(DJICameraPhotoTimeIntervalSettings.init(captureCount: 2, timeIntervalInSeconds: 5), withCompletion: { (e:Error?) in
// error handling...
camera?.setCameraVideoStreamSource(DJICameraVideoStreamSource.zoom, withCompletion: { (e:Error?) in
// take the photo
camera?.startShootPhoto(completion: { (error:Error?) in
// error handling
})
})
})
})
知道我做错了什么吗?
谢谢!
解决方案
显然你需要使用 DJICamera.setCaptureStreamSources。我尝试使用 Mobile iOS SDK 和 ObjC 应用程序,但调用只是崩溃了。他们将此添加到新版本 4.14-trial1 中,但我也无法使其工作。
推荐阅读
- vue.js - VueJs:TypeError:Object(...)不是一个函数,“withScopeId”
- c# - 基于证书的 ASP.NET Core 用户认证
- csv - 我可以将存储在表中的值用作另一个表中的键吗?
- javascript - 在 html-collection 中查找具有特殊 src 的图像
- javascript - 如何检查firebase文档是否有一个有价值的字段?
- python - 如何在pytransition的条件函数中传递事件参数
- amazon-web-services - AWS 将文件上传到 S3 访问被拒绝,具有完全 s3 访问权限的用户 - React Native
- java - Hibernate 验证器和 Spring 版本的兼容性
- flutter - 错误“无法识别术语‘解锁文件’”
- ffmpeg - 复制摄像头和麦克风以跨多个程序使用