Autonomous drone, no GPS

I’m trying to build an autonomous drone with RPI zero as companion PC with DroneKit.
Right now my quad has optical flow connected and tuned, able to maintain alt and pos. I’m trying to figure out how to send commands to the drone.
I tried using GUIDED_NOGPS mode and as soon as I send takeoff command, using vehicle.message_factory.set_attitude_target_encode the drone drift fast to the side. I read that it might be something related to the need of defining EKF home but couldn’t find a way to define home without the use of lon and lat. I guess that the problem really related to the EKF, as soon I connect to the drone I receive an alert: EKF3 imu0 stopped aiding

The full script i use send the takeoff command:


Is there something i missed?
Help will be very appreciated.


I found one of the issues- The drone was too close to the ground that the optical flow couldn’t measure good enough. I printed legs for the drone to give some distance from the ground and now i can arm while on GUIDED mode. Still cant takeoff. the simple_takeoff command don’t increase the thrust in order to ascend.

Was the vehicle configured using the ArduPilot methodic configurator software and a gps receiver first?

And are you aware of GSoC 2024: High Altitude Non-GPS Navigation ?

I used the preconfigured ArduPilot software that i could find in the internet. One that works for my FC.
I don’t use GPS so I didn’t do anything special in that field.
I’m not aware of GSoC, and i’m not sure it is helpful for me because I use Optical Flow and not a camera and my working altitude will be 5m max.

Then search for "ArduPilot methodic configurator software "
Install it, learn it and use it.

Thanks for the suggestion. Reading about this software now.
I’m not fully understand how this software will help with my problem. Using the controller the drone flies good without any problem.
I just need to make it takeoff using RPI and DroneKit.
Can you explain which feature in this software can help me?

You told you have not enough thrust. That is either an harware issue ( section 1 of the blog post) or a confirmation issue.

Anyway use the software, you will learn useful things and be faster and more efficient

1 Like

Generally the drone has the thrust desired to fly. Only while I’m using the controller.
If I try GUIDED mode with RPI as companion PC, the drone doesnt increase the thrust.

Then you either don’t have required thrust and we’re compensating with reduced inputs or you have bad configuration that prevents the autopilot from utilizing full thrust of the setup.

I thought that the simple_takeoff command from dronekit supposed to set the thrust as needed for the ascending. If it’s not, what should i add in the code in order for taking off?


I bet dollars to donuts that you haven’t gone through with complete setup and tuning process or you haven’t read the documentation of applicable dronekit API.

Please post a .bin log of the flight.

Nice to meet the kind people in Ardupilot forum. It will be nicer without the disrespect.
I read all the relevant ArduPilot documentation and worked a lot on tuning the drone.
Yes, I tuned the optical flow and the PIDs.
Yes, I read the DroneKit documentation, tried the recommended take off script (shockingly, it didnt work).
As I wrote above, The drone flies well when it controlled by the controller, the dronekit command don’t change the thrust from the idle value.

Apologies for being snarky.

Please post the log. Ardupilot typically is quite good at communicating issues.
I suspect some conditions required for simple_takeoff to work are not met.

Hi, sorry for the delay, busy days studying.
Attaching few logs where i could arm the drone but not taking off using the RPI