Got COMMAND_ACK: NAV_TAKEOFF: FAILED

I am having trouble using the takeoff 200 command (or MAV_CMD_NAV_TAKEOFF message via Pymavlink) in ArduPlane SITL. The aircraft refuses to initiate the takeoff sequence and consistently returns an error.

Command sequence I am using:

mode FBWA
arm throttle
takeoff 200
>> Got COMMAND_ACK: NAV_TAKEOFF: FAILED

(Note: I receive the same error in GUIDED, FBWB, and AUTO modes, or when sending the command via Pymavlink.)

Takeoff only works in the following two ways:

mode TAKEOFF
arm throttle
(Aircraft takes off successfully)

OR

mode FBWA
arm throttle
rc 3 3000
(Aircraft takes off successfully)

Why does ArduPlane reject this basic takeoff command or MAV_CMD_NAV_TAKEOFF message in other modes? What is the root cause of this “FAILED” acknowledgment, and how can I resolve it?

Thanks in advance.

Have you already found Automatic Takeoff — Plane documentation ?

I hope to understand the bigger context/point of your question:

  • Is it about what features are possible, vs what you’d like to be possible? (something like “I wish takeoff worked in more modes. Why doesn’t it?”)
  • Is it that according to your reading of the docs, what you’re trying to do should work, but does not? (something like “Because I read XXX, I think that YYY should happen, but instead I observe ZZZ. Is it a bug or am I misunderstanding?”)

On a different point:

What is the root cause of this “FAILED” acknowledgment, and how can I resolve it?

Since you’re in SITL, this is a great chance to practice source diving + “debugging” techniques. (Maybe “debug” is a misnomer in your case, but it’s still the same techniques.) Is that something you’ve already started?

I’ve read the documentation, but I couldn’t find clear information directly related to my question. I also asked several AI tools multiple times and explicitly stated that I am working with Plane. Despite that, I was consistently guided to expect that after arm throttle in Guided and the other modes I mentioned, the aircraft should take off when issuing the takeoff [altitude] command — or when sending MAV_CMD_NAV_TAKEOFF via pymavlink.

Based on this, I expected it to work. However, in every attempt I received the “FAILED” error mentioned in the title.

Since this message is also listed on the following page, I initially did not think the AI tools were misleading me:

Even though this message is documented there, I have not been able to get this command to work in practice in any way. I hope I have made my question/problem clearer now.

Responding point-by-point:

I’ve read the documentation, but I couldn’t find clear information directly related to my question.

Excellent. As you can probably guess, there are folks who ask for help without first making their best attempt. When someone doesn’t demonstrate how much of an attempt they have made independently, folks like me have a first-reaction to question how far they got on their own.

It’s common that the docs don’t answer every specific question that you’d have. So I am not surprised.

I’m also not surprised that AIs hallucinate. I encounter this very often. (Despite this, they are still very useful!) Basing your expectation on what AIs told you is generally unwise. But–as you did–trying out what they told you to see if it works was a great choice! Sadly it didn’t work out this time.

Since this message is also listed on the following page, I initially did not think the AI tools were misleading me:

Read carefully the disclaimer at the top of the page. That explains why a message you find there may not actually work the way(s) you expect.

Even though this message is documented there, I have not been able to get this command to work in practice in any way. I hope I have made my question/problem clearer now.

Wait, perhaps I have misunderstood! Is “this command” the MAV_CMD_NAV_TAKEOFF command? From the Automatic Takeoff page, I presume (without verifying!) that the NAV_TAKEOFF mission command would correspond to a MAV_CMD_NAV_TAKEOFF command sent to the plane. And of course, that happens in AUTO mode, with the command coming from a mission, and not from pymavlink’s takeoff helper.

It’s an important distinction (to me) whether you’re actually trying to understand the takeoff command (what it does under-the-hood, in what way(s) is that supported by Plane, etc.) or whether you just want help getting SITL to takeoff (which it sounds like you’ve already solved using the TAKEOFF mode, so I’m guessing not this).

And assuming you want to understand the takeoff command, I can keep helping there. What’s your familiarity with source-diving and debugging code to understand the details of what it does?

I suggest you to not use code generated by AIs on a real vehicle without cross verifying with the corresponding documentation yourself. Recently I was trying to make a copter move in guided and AI repeatedly kept tell me that local body frame referenced position navigation is not possible using just optical flow. But I saw that it is possible from the documentation and I went ahead and did it

1 Like

First of all, in my personal opinion, I don’t think the documentation is very instructional for someone like me who is starting from scratch. It presents so many modes, messages, and parameters all at once, which can be quite confusing when you read them together. Because of this, I discover or notice something new every time I look at it.

​To answer your questions: currently, I am not at a level where I can dive into and understand the source code of such a large project. It feels very heavy and complex. I believe I will overcome this over time.

​As for your second question: yes, I managed to get the plane airborne, but for some reason, it feels like I’m doing something by chance or incompletely. Because of its name, the MAV_CMD_NAV_TAKEOFF message feels like it should be an essential message for takeoff.

in my personal opinion, I don’t think the documentation is very instructional for someone like me who is starting from scratch.

100% agree. In case you were wondering: It’s not you, it’s the documentation. The only thing worse than complicated, long, potentially-wrong documentation is having no documentation.

<not yet at a level to understand the whole code…> I believe I will overcome this over time.

Great! I’ll make my offer explicit: I’d love to help if I can! Something valuable I might provide is to distinguish when is hard/weird/complicated, and you shouldn’t spend time (yet) on it vs when it is something you could reasonably figure out yourself. (Of course making such a judgement means I get a sense of where you’re starting from.)

If you’re comfortable, share your learning journey publicly by sharing what you’re trying to learn, what’s confusing you, what you’ve learned/tried already, etc. in asks for help. And then you’re welcome to tag me! I’ll respond if I’m able. (Worst case: Sorry, I don’t know / can’t help.)

If you’re not comfortable doing that publicly, DM me (here or Discord) and we can do the same privately.

Reasonable folks may disagree on this point, but I feel strongly: A wonderful place to engage with a project as a newcomer is to propose improvements to the documentation. Start as gently as you’re willing: fixing typos is the easiest level. Or reorganizing the existing information for clarity’s sake.

As a beginner, you have something that folks who wrote it don’t: the viewpoint of the intended audience. Don’t undervalue it.

OFC always get a subject matter expert to approve. Sometimes you’ll spend a bunch of time on something that’s ultimately wrong/rejected… and that doesn’t feel good. But “dead ends” like that are IMO part of the learning process. And not that bad, if you know they’re possible/likely.

It rejects the command because the way takeoff is implement in MavProxy doesn’t make sense for a plane. AFAIK it uses guided mode to takeoff vertically.

You need to use takeoff mode or auto mission with takeoff waypoint.

1 Like

Thank you so much for your understanding and your very kind offer! To give you a bit more context, I am currently part of a university team participating in a national UAV competition. While my teammates are focused on the GCS and computer vision, I am responsible for the flight software development.

Because of this, I would be more than happy to accept your help—especially in distinguishing between what’s worth my time right now for the competition and what might be too advanced for me at this stage.

I am definitely up for connecting on Discord. What is your username, or should I send you mine?

Thanks a lot for the info. It seems to be exactly as you said. While I was searching the forum, I came across the exact information shown in this screenshot. I guess that’s the case.

I am definitely up for connecting on Discord. What is your username, or should I send you mine?

Discord usernames sometimes confuse me… I am hunt0rgm which is what I think you need. I am aliased as hunt0r , originally known as Hunter#5349, in case either of those are needed.