我目前正致力于让DJI产品自主执行航点任务,并从DJI教程(https://developer.dji.com/mobile-sdk/documentation/ios-tutorials/GSDemo.html)进行调整。所以我试图将所有流程集成到一个功能中。以下是我必须整合的两个完成块:
pg_dump --cluster=9.6/main books > books.out
和
pg_lsclusters
为了使第二个成功运行,第一个必须首先完全执行。这似乎不是一个难题,但在尝试添加延迟或调度后我无法弄明白。
任何帮助都表示赞赏。谢谢。
答案 0 :(得分:1)
来自the iOS version of the docs you linked,-[DJIWaypointMissionOperator uploadMissionWithCompletion:]
的文档说:
如果成功启动,请使用
addListenerToUploadEvent:withQueue:andBlock
接收详细进度。
所以,你会做这样的事情:
[[self missionOperator] uploadMissionWithCompletion:^(NSError * _Nullable error) {
if (error)
{
ShowMessage(@"Upload Mission failed", error.description, @"", nil, @"OK");
}
else
{
ShowMessage(@"Upload Mission Started", @"", @"", nil, @"OK");
[[self missionOperator] addListenerToUploadEvent:self
withQueue:nil
andBlock:^(DJIWaypointMissionUploadEvent *event){
if (event.currentState == DJIWaypointMissionStateReadyToExecute)
{
[[self missionOperator] startMissionWithCompletion:^(NSError * _Nullable error) {
if (error)
{
ShowMessage(@"Start Mission Failed", error.description, @"", nil, @"OK");
}
else
{
ShowMessage(@"Mission Started", @"", @"", nil, @"OK");
}
}];
}
else if (event.error)
{
ShowMessage(@"Upload Mission failed", event.error.description, @"", nil, @"OK");
}
}];
}
}];
答案 1 :(得分:0)
您的代码看起来正确。我遇到了同样的问题,任务上传完毕后,我的missionOperator的currentState
会还原为DJIWaypointMissionStateReadyToUpload
而不是DJIWaypointMissionStateReadyToExecute
。该任务已通过有效性检查,但实际上由于对各个航路点(cornerRadiusInMeters
属性)的无效弯道要求而无效。
从文档中:
/**
* Corner radius of the waypoint. When the flight path mode is
* `DJIWaypointMissionFlightPathCurved` the flight path near a waypoint will be a
* curve (rounded corner) with radius [0.2,1000]. When there is a corner radius,
* the aircraft will never go through the waypoint. By default, the radius is 0.2
* m. If the corner is made of three adjacent waypoints (Short for A,B,C) . Then
* the radius of A(short for Ra) plus radius of B(short for Rb) must be smaller
* than the distance between A and B. The radius of the first and the last
* waypoint in a mission does not affect the flight path and it should keep the
* default value (0.2m).
*/
希望这对某人有帮助。