dronekit / dronekit-python

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

Dronekit error on PX4 -mode 67371008 not available on mavlink definition #724

Open hamishwillee opened 7 years ago

hamishwillee commented 7 years ago

PX4 dronekit example here doesn't work.

Specifically

  1. Running on ubuntu in a VM
  2. Dronekit set up as in that doc, from master.
  3. Using JMAVSIM SITL as per Here. This is recent daily master, but problem has been reported for months with SITL and HITL

The script connects and the vehicle takes off. But Dronekit gets stuck on first step takeoff.

It reports

Executing mission
Exception in message handler for HEARTBEAT
mode 67371008 not available on mavlink definition

The vehicle actually does fly and follow the mission, so the bug here is the error messaging, which is scary and unhelpful.

peterbarker commented 7 years ago

Agreed, the WP index is out-of-bounds is probably not related.

Make sure the autopilot is recognised as px4 by adding debug here: https://github.com/dronekit/dronekit-python/blob/master/dronekit/__init__.py#L1551

If it is crossing the PX4 codepath, then @squilter or @sanderux might be able to help by fixing interpret_px4_mode in pymavlink

sanderux commented 7 years ago

This error seems to be related to a flightmode that is not recognized. This should have been fixed in the lates pymavlink. What versions dronekit and pymavlink are you running?

hamishwillee commented 7 years ago

The latest you get by following the example instructions and rebuilding dronekit: dronekit (2.9.1) pymavlink (2.0.6)

sanderux commented 7 years ago

Pymavlink should be 2.2.2 i believe, can you try upgrading?

hamishwillee commented 7 years ago

Thanks @sanderux - pymavlink v2.2.3 works. Created https://github.com/dronekit/dronekit-python/pull/728 to up the number. @peterbarker can you merge if there is no reason for us "not" to do so.