简体   繁体   English

如何通过dronekit python用Pixhawk和覆盆子武装和起飞无人机

[英]How can I arm and takeoff the drone with Pixhawk and raspberry by dronekit python

We have bought a Pixhawk 2.1 flight controller , and we are working on a university project ;我们买了一个 Pixhawk 2.1 飞行控制器,我们正在做一个大学项目; the project is that we have to solve a puzzle by a drone ( which contains a raspberry pi 3 ) and send the right way coordinates to a small car .该项目是我们必须通过无人机(其中包含一个 raspberry pi 3)解决一个难题,并将正确的方向坐标发送到一辆小型汽车。 Our problem is that we shouldn't use any remote controller on the drone .我们的问题是我们不应该在无人机上使用任何遥控器。 So the drone should fly to a specific altitude and then should start looking for the puzzle and solve it .所以无人机应该飞到一个特定的高度,然后应该开始寻找谜题并解决它。

We have tried to use dronekit python .我们尝试使用dronekit python。 We could connect to the drone by the code but we couldn't make it arm and take off .我们可以通过代码连接到无人机,但我们无法让它武装起飞。

Is Pixhawk 2.1 support arming and take off with out using any ground station or remote control? Pixhawk 2.1 是否支持布防和起飞,无需使用任何地面站或遥控器? . . If it does we hope that you send us a code and the method .如果是这样,我们希望您向我们发送代码和方法。 Because we have search a lot and the project dead line is very near .因为我们搜索了很多,而且项目的截止日期很近。

Thank you for your time ...感谢您的时间 ...

I apologize for messaging here since I do not have 50 reputation to comment.我很抱歉在这里发消息,因为我没有 50 声望可以发表评论。

Your Configuration:您的配置:
Flight Controller: PixHawk 2.1飞行控制器:PixHawk 2.1
Companion Computer: Raspberry Pi配套电脑:树莓派
Companion Computer OS: Ubuntu?配套计算机操作系统:Ubuntu?
Companion Computer Drone API: dronekit配套计算机无人机 API:dronekit

What is missing for a better analysis: The Autopilot consists of the Flight Controller and the Code.更好的分析缺少什么:自动驾驶仪由飞行控制器和代码组成。 In your case is it Ardupilot or PX4?在您的情况下是 Ardupilot 还是 PX4?

In case of Ardupilot, I might be able to answer where you might be stumbling.在 Ardupilot 的情况下,我可能会回答你可能会绊倒的地方。 (PX4 is similar but in case you are using dronekit, I highly recommend using Ardupilot/copter instead of PX4; This is an opinion based on experience) (PX4 与此类似,但如果您使用的是dronekit,我强烈建议您使用 Ardupilot/copter 而不是 PX4;这是基于经验的意见)

Try the following in order按顺序尝试以下操作

  1. in connection string if wait_ready = false then it is never going to arm in the first place hence you are caught in a loop.在连接字符串中,如果 wait_ready = false 则它永远不会首先启动,因此您陷入了循环。
    This is mainly since the checks done to check if it is ready is similar to the ones done in arming.这主要是因为检查它是否准备好的检查类似于在布防中所做的检查。

The only case in which the wait_ready = false arms is when the arming check masks are used to avoid the checks. wait_ready = false arm 的唯一情况是使用启动检查掩码来避免检查。
2. http://ardupilot.org/copter/docs/parameters.html#arming-check-arm-checks-to-peform-bitmask 2. http://ardupilot.org/copter/docs/parameters.html#arming-check-arm-checks-to-peform-b​​itmask
shows the list of checks done by the autopilot while arming long with the mask to turn off certain checks.显示自动驾驶仪在长时间佩戴面罩以关闭某些检查时完成的检查列表。
This should allow you to go through a list of systems for regular checks in case of failure.这应该允许您查看系统列表,以便在出现故障时进行定期检查。
This should be similar in PX4 with variations in terminologies and ordering but the underlying logic will be highly similar.这在 PX4 中应该是相似的,但术语和顺序有所不同,但底层逻辑将非常相似。

Another thing that might not be clear is the order of operations.另一件可能不清楚的事情是操作的顺序。

Your source code ( or code in general) -> using Dronekit on the computer talks to the autopilot through Ardupilot/PX4 -> The Auto pilot then pilots the drone as per the instructions您的源代码(或一般代码)-> 在计算机上使用 Dronekit 通过 Ardupilot/PX4 与自动驾驶仪对话-> 自动驾驶仪然后按照说明驾驶无人机

Here is the caveat about programming a drone.这是有关对无人机进行编程的警告。

You are in almost all cases programming instructions to the autopilot (Flight controller which interacts using Adrupilot/PX4) who then performs the actions.在几乎所有情况下,您都在向自动驾驶仪(使用 Adrupilot/PX4 交互的飞行控制器)编写指令,然后自动驾驶仪执行操作。 The autopilot in all its wisdom may refuse to perform any of the actions if those actions fail its checks.如果这些动作没有通过检查,自动驾驶仪可能会拒绝执行任何动作。
This refusal on the Autopilots part to perform the actions does not show up as an error because it is not an error. Autopilots 部分拒绝执行操作不会显示为错误,因为它不是错误。 You gave it a valid action and it just didn't feel like performing it since you failed its checks.你给了它一个有效的动作,它只是不想执行它,因为你没有通过它的检查。

This is what might be happening in you case.这就是您的情况可能会发生的情况。

To control the drone using raspberry , pixhawk should comminucate with GPS .要使用 raspberry 控制无人机,pixhawk 应该与 GPS 通信。 If you trying to arm it in a closed area probably it wont arm .如果您试图在封闭区域内布防它,它可能不会布防。 Because , your code should contain like "guided" mode it require GPS.因为,您的代码应该包含需要 GPS 的“引导”模式。 If this is not helpful .如果这没有帮助。 Test again cominication between rpi and pixhawk再次测试 rpi 和 pixhawk 之间的连接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM