大疆社区
大疆社区
wdcswd
已累计飞行 0 米
发布于2015-8-24
浏览3.8k
相关分类
SDK
Mobile-SDK
0
0
5
0

5 条评论

大疆社区
快来评论吧
大疆社区

已累计飞行 14382 米

我是单独用一个变量存了index, 然后update这个变量,同时读取这个变量。 但是在takeoff函数里面将它手动初始化,因为update的过程不含初始化什么的。

2015-8-28

大疆社区

已累计飞行 0 米

请问你是说的update是自带的哪个callback ?还是在哪个地方将index值重新赋值。

2015-8-28

大疆社区

已累计飞行 14382 米

是这样,飞机返回的信息没有update过就保持不变。 也就是说你飞到第三个航点,返航了,直到再次飞到下一个航点之前返回值永远是第三个航点。 我的做法是存储航点index的那个变量, 在每次takeoff的时候手动赋值成-1

2015-8-28

大疆社区

已累计飞行 0 米

谢谢,这个方法我也用过 ,只适合执行一次飞行任务,返航后再重复执行,index值就获取不到了。

2015-8-26

大疆社区

已累计飞行 0 米

如果你想获取到达航点的INDEX,建议参考官方DEMO中的这段代码(红色部分): mGroundStationExecutionPushInfoCallBack = new DJIGroundStationExecutionPushInfoCallBack() { @Override public void onResult(DJIGroundStationExecutionPushInfo info) { // TODO Auto-generated method stub StringBuffer sb = new StringBuffer(); switch(info.eventType.value()) { case EXECUTION_STATUS_UPLOAD_FINISH : { sb.append("Execution Type : " + info.eventType.toString()).append("\n"); sb.append("Validation : " + (info.isMissionValid ? "true" : "false")).append("\n"); sb.append("Estimated run time : " + info.estimateRunTime).append("\n"); break; } case EXECUTION_STATUS_FINISH : { sb.append("Execution Type : " + info.eventType.toString()).append("\n"); sb.append("Repeat : " + Integer.toString(info.isRepeat)).append("\n"); // sb.append("Reserve: " + GroundStationWayPointExecutionState.find(info.reserved).toString()).append("\n"); break; } case EXECUTION_STATUS_REACH_POINT : { sb.append("Execution Type : " + info.eventType.toString()).append("\n"); sb.append("WayPoint index : " + info.wayPointIndex).append("\n"); sb.append("Current State : " + GroundStationWayPointExecutionState.find(info.currentState).toString()).append("\n"); sb.append("Reserve : " + info.reserved).append("\n"); break; } } GsInfoString1 = sb.toString(); GsProtocolDemoActivity.this.runOnUiThread(new Runnable() { @Override public void run() { // TODO Auto-generated method stub mGroundStationTextView1.setText(GsInfoString1); } }); } }; DJIDrone.getDjiGroundStation().setGroundStationExecutionPushInfoCallBack(mGroundStationExecutionPushInfoCallBack);

2015-8-25

暂无更多评论

关于作者

已累计飞行 0 米

大疆社区

wdcswd

飞行学员

认证设备

暂无关联认证的设备