gpt4 book ai didi

ios - 使用 DJI UXSDKDemo (iOS) 记录数据的最佳方法

转载 作者:行者123 更新时间:2023-12-01 18:37:19 26 4
gpt4 key购买 nike

我想从下面的两个类中提取值并将它们记录在一个文件中。提取这些值的最佳方法是什么?属性(property)观察员会工作并且有效吗?是否有一个主循环或时钟可以用来持续调用和记录这些数据?任何帮助,将不胜感激。谢谢

    //IMU
EXTERN_KEY NSString *const DJIFlightControllerParamIMUState;
EXTERN_KEY NSString *const DJIFlightControllerParamIMUsCount;

EXTERN_KEY NSString *const DJIFlightControllerParamIMUStateGyroscopeState;
EXTERN_KEY NSString *const DJIFlightControllerParamIMUAccelerometerState;
EXTERN_KEY NSString *const DJIFlightControllerParamIMUStateCalibrationProgress;
EXTERN_KEY NSString *const DJIFlightControllerParamIMUStateCalibrationState;

这相关吗?
 @class DJIFlightHubManager;


/**
* Delegate to receive updated states related to DJI FlightHub.
*/
@protocol DJIFlightHubManagerDelegate <NSObject>


/**
* Updates states for the uploading progress of flight data.
*
* @param flightHubManager The FlightHub Manager updates the state.
* @param state The updated state. When it is `DJIFlightHubUploadStateRejectedByServer`, refer to error for more detail.
* @param error The returned error when the upload request is rejected by the server. Use the error to check the reason.
*/
- (void)flightHubManager:(DJIFlightHubManager *)flightHubManager didUpdateUploadState:(DJIFlightHubUploadState)state error:(nullable NSError *)error;

@end

最佳答案

在这种情况下,DJIFlighthubManager 将不相关 - 它对应于我们的 FlightHub device

对于您要写入文件的每个键,您需要先获取并监听状态,然后将数据写入文件。这是一个例子:

DJIFlightControllerKey *exampleKey = [DJIFlightControllerKey keyWithParam:DJIFlightControllerParamIMUState];

// Will get called once to get current value of the key
[[DJISDKManager keyManager] getValueForKey:exampleKey withCompletion:^(DJIKeyedValue * _Nullable value, NSError * _Nullable error) {

}];

// Called only when the value for the key changes
[[DJISDKManager keyManager] startListeningForChangesOnKey:exampleKey withListener:self andUpdateBlock:^(DJIKeyedValue * _Nullable oldValue, DJIKeyedValue * _Nullable newValue) {

}];

`

关于ios - 使用 DJI UXSDKDemo (iOS) 记录数据的最佳方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50767318/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com