How was it commanded to Ingenuity to fly to 10 ft and land again?

Since Mars is multiple light minutes away from Earth, Ingenuity can't be controlled remotely like any drone. Was there a command given to Ingenuity to at a certain time rise to 10 feet and then land again or so?

Yes, pretty much. There is some kind of command language by which Ingenuity can be told what to do. I don't know if the details of that language are public (the framework for the flight software is!), but presumably it allows you to express things like 'at some time $$t$$, check that everything is well, and if it is then spin up blades, wait so long for them to be at speed or give up, then lift off, fly upwards to $$x\,\mathrm{m}$$, hover for $$s$$ seconds, descend, land, spindown'. But obviously with a lot more detail and handling of unexpected conditions. And beneath that language there will be a great mass of code which actually translates it into what has to happen to the motor, the swashplate servos and so on, all depending on the current actual state of the helicopter.

The important point is that the entire flight of the machine is autonomous: it's been told what to do in advance, but while it is doing it is has to make its own decisions.

• It's a bit of a stretch to say the software is public - the public part (fprime) is a framework for developing and operating software for partially-autonomous, remote-controlled devices. There's practically nothing specific to Ingenuity there - it could be used to write software (and later operate it) for probes, landers, robotic arms, rovers, whatever.
– SF.
Apr 20 at 12:57
• @SF, yes, you're right. I've clarified that, sorry (and I was confused: I didn't actually check the GH repo in any detail but believed what I'd read elsewhere).
– user21103
Apr 20 at 13:49
• Self leveling devices are now fairly common with R/C aircraft. It really is similar to how a person would fly it. Sensor inputs go to flight subroutines, and the flight is programmed to do a sequence of events while self maintainance subroutines are running. Just wonder how Martian GPS is doing these days. The command from Earth would be something like "Start 1st Flight Program". Apr 20 at 15:08
• Possibly helpful as a source for details:Mars Helicopter Technology Demonstrator (Canham et al. 2018, AIAA Atmospheric Flight Mechanics Conference, also here and archived)
– uhoh
Apr 21 at 1:21
• @RobertDiGiovanni: Well, we know that they changed the details of what the flight program was after the watchdog issues. So the flight programs themselves are sent (ahead of time) from Earth. I imagine that the command is also technically 'start first flight program at time $t$', because there's no communication with Earth while the program is happening.
– user21103
Apr 21 at 9:47