dronekit / dronekit-python

DroneKit-Python library for communicating with Drones via MAVLink.
https://readthedocs.org/projects/dronekit-python/
Apache License 2.0
1.62k stars 1.45k forks source link

connect() never returns when vehicle doesn't send parameters #1148

Open markus-k opened 2 years ago

markus-k commented 2 years ago

I'm trying to receive data from an INAV FlightController with DroneKit using a Raspberry Pi as a companion computer with DroneKit.

When calling connect(), it doesn't return though, even though messages are send from the FC. Some debugging revealed that it is waiting on Vehicle.initialize, more specifically the last while-loop waiting for parameters. Removing this loop makes connect() return and I can read position data using vehicle.location.global_frame.

From what I understand, INAV doesn't send parameter data over MAVLink.

Not sure if waiting for parameters is really required at that point, so maybe it could be removed? Or add a parameter to stop it from waiting on parameters?

Example code:

from dronekit import connect

MAVLINK_DEVICE = "/dev/serial0"
MAVLINK_BAUD = 115200

conn = connect(MAVLINK_DEVICE, baud=MAVLINK_BAUD, wait_ready=[])
# never returns, but shown debug messages like WARNING:autopilot:UNABLE TO ARM
EugeneFolkast commented 5 months ago

Have the same issue, didn't find any solution?

markus-k commented 5 months ago

Nope, pretty sure I gave up at that point with whatever I was trying to do back then.