简体   繁体   中英

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 ; 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 . 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 . 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? . 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.

Your Configuration:
Flight Controller: PixHawk 2.1
Companion Computer: Raspberry Pi
Companion Computer OS: Ubuntu?
Companion Computer Drone 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?

In case of Ardupilot, I might be able to answer where you might be stumbling. (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)

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.
    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.
2. http://ardupilot.org/copter/docs/parameters.html#arming-check-arm-checks-to-peform-bitmask
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.

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

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. 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. 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 . 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. If this is not helpful . Test again cominication between rpi and pixhawk

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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