DroneKit任务未发送到无人机 [英] DroneKit mission not sent to drone

查看:232
本文介绍了DroneKit任务未发送到无人机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Drone-Kit android创建简单的任务.

I'm trying to create simple mission using Drone-Kit android.

Mission myMission = new Mission();
myMission.clear();
Takeoff to = new Takeoff();
ReturnToLaunch rtl = new ReturnToLaunch();
//set Altitude in meters
rtl.setReturnAltitude(2);
to.setTakeoffAltitude(2);
myMission.addMissionItem(to);
myMission.addMissionItem(rtl);
MissionApi.getApi(this.drone).setMission(myMission,true);

问题在于有时它起作用,有时却不起作用... 我不知道为什么它不起作用...我在代码中没有收到任何错误.

The problem is that sometimes it works, and sometimes it's doesn't... I don't know why it not working... I'm not getting any errors in the code.

我在听

AttributeEvent.MISSION_UPDATED

AttributeEvent.MISSION_SENT

AttributeEvent.MISSION_RECEIVED

,但是运行代码时仅触发AttributeEvent.MISSION_UPDATED. 即使它被发射了,这也不意味着任务正确更新了. 我正在使用Mission Planer检查任务. 我只是不明白为什么它有时会工作,有时却没有.

but only the AttributeEvent.MISSION_UPDATED is fired when I run the code. And even if its fired, this doesn't mean that the mission updated correctly. I'm checking the mission with Mission Planer. I just don't understand why it is working sometimes and sometimes not.

我确实确保了无人机已连接到该应用程序. 另外,我确保无人机可以正常使用并且可以武装. 我真的被困在这里...任何帮助将不胜感激.

I did make sure that the drone connected to the app. Also I made sure that the drone is OK and arm-able. I really stuck here... and any help will be appreciated.

推荐答案

如果有人遇到相同的问题,我将回答我的问题.

I will answer my question, in case someone have the same problem.

我已经联系了开发人员,似乎我并不是唯一拥有此错误的人. 似乎将ReturnToLaunch添加到Mission时,API中发生了某些事情,任务没有发送到无人机.我从Mission中删除ReturnToLaunch对象后,所有对象均正常工作.

I have contacted the developers, and it seems that I'm not the only one who have this BUG. It seems that when you add ReturnToLaunch to Mission something happening in the API and the mission is not sent to the drone. As soon as I removed ReturnToLaunch object from the Mission all worked properly.

全面工作:为解决此问题,在完成Mission后,我将无人机设置为RTL模式.

Work-Around: To overcome the issue, I am putting the drone in RTL mode, when the Mission is done.

这篇关于DroneKit任务未发送到无人机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆