Ardupilot + speedybee f405 controlled by Dronekit python on Raspberry Pi


#1

hello guys,

actually I was working on a autonomous drone project that is instructed based on computer vision and yolo using dronekit

i am able to simulate my codes of flight in Gazebo 7 on ros2 humble , that was on iris-gimbal. now when it came to reality, i bought a f405 V4 with 4 in 1 esc stack of Speedybee and booted ardupilot…i calibrated sensors like gps M10, elrs and battery of 5k mah with 920kv motors baring a raspi and a noir 5mp camera.

problem:

it’s was working fine with RC… when I armed it using dronekit code it didn’t, that was on guided mode giving prearm: need position estimate error , however gps is working well, so i disabled arming checks, it ran into some failsafe , then i disabled Failsafe parameters too except few , shifted to stabilize mood, it armed… but it didn’t took off for vehicle.simple_takeoff() command though the speed of propellers increased…gps in 3d fix connecting 12 sats, I checked the messages in mission planner…it has an error, failed to initialise MAVFTP …in alt_hold mood it armed but didn’t took off…

i shifted to qgroundcontrol too, in that prearm: need position estimate required is the error seen

intrestingly, it’s arming and took off in stabilise mood using RC and then i shifted to loiter mood when it’s flying…it drifted in same altitude…

could you please suggest me a way to come out of this problem, I have several missions planned on basic_functions.py code i wrote in dronekit python.

i will send you necessary pics or codes if you need too.


#2

Regarding the position estimate error, and since it flys ok by RC, it suggests there is an issue with dronekit communicating with the flight controller. I assume you have checked all connections, use latest fw and calibrated the imu and compass in the field. Perhaps there are some GPS parameters to check, and ensure you have the home position set correctly.

The “failed to initialize MAVFTP” error is related to the MAVLink FTP protocol used to fetch vehicle parameters. This can sometimes hang or fail if there’s a communication issue [https://discuss.ardupilot.org/t/what-is-this-mavftp-param-and-why-is-mp-freezing-while-checking-for-it/71646 “1”].

Verify that your serial connections are stable and properly configured.

All I can think of.


#3

hey i actually figured out the issue…it’s the problem with the compass

the problem is the RushFpv M10 gps has a built-in compass, that didn’t get detected in mission planner sensors at all as it was once.
i update the firmware, re shouldered the gps too
i kept it a bit higher to avoid magnetic inference too. Finally picked a new HMC5883L compass and attached to the FC , finally it got detected but…

current problem: the compass or gps glitch error and followed by a glitch cleared log is repeating in my console of raspi editor running dronekit python codes. i checked mission planner and qgroundcontrol too, it got same errors and a failsafe trigger disarming it in 20 sec as set.

when I tried to re-calibrate it, compass calibration thread failed to initialise error is raised in qgroundcontrol and no change seen when start button is clicked in mission planner too, both aren’t responding.

first of all, i couldn’t take off , and i have pid controlled custom methods of basic functions are a big question :pensive:!