Just wondering how would I tell that my drone is ready for arming using Mavlink? I mean, I can keep trying to arm it but it seems a bit unscientific.
I have heard about EKF_STATUS_FLAGS in the past but I’d previously read that these were not implemented yet. What flags should I be checking in MAVLINK_MSG_ID_EKF_STATUS_REPORT if any?
Hopefully someone knows the answer and it’s not too complicated. Thanks!
Note that the vehicle may still not be able to actually arm; there are some checks we do not make until the user actually tries to arm as they change the state of the vehicle - for example, we only try to start logging (and sometimes tell fancy GPS units to start logging) when the user tries to arm the vehicle.
I think EKF origin must be one of those omitted checks as I see the prearm “onboard_control_sensors_health” bit set when in fact EKF origin (home) is not set. My SITL test has this output (you can see where I set guided mode and try to arm in bold):
AP: GPS 1: detected as u-blox at 230400 baud Got COMMAND_ACK: DO_SET_MODE: ACCEPTED Mode GUIDED pre-arm fail Got COMMAND_ACK: COMPONENT_ARM_DISARM: FAILED
AP: PreArm: GPS: waiting for home
AP: PreArm: GPS: waiting for home
AP: EKF3 IMU1 origin set
AP: EKF3 IMU0 origin set
AP: EKF3 IMU0 is using GPS
AP: EKF3 IMU1 is using GPS
pre-arm good
Flight battery warning
I had some issues with SITL for 4.1.3 so I am just looking at 4.1.2 right now… I cannot get the SITL drone to send me EKF_STATUS_REPORT messages despite successfully requesting other message types with MAV_CMD_SET_MESSAGE_INTERVAL (e.g. ATTITUDE messages come in fine).
I can see that QGroundControl does not have this problem - I can see lots of EKF_STATUS_REPORT messages coming in. I had a google and searched the forums to sanity check things. I looked at the source code and got as far as seeing the message supposedly sent in GCS_MAVLINK::try_send_message() when all things are working.
Is there something else I must do in order to receive these messages? Cheers.
There is this at the top of ardupilotmega/ardupilotmega.h:
#ifndef MAVLINK_H
#error Wrong include order: MAVLINK_ARDUPILOTMEGA.H MUST NOT BE DIRECTLY USED. Include mavlink.h from the same directory instead or set ALL AND EVERY defines from MAVLINK.H manually accordingly, including the #define MAVLINK_H call.
#endif
although I have never actually seen that error message when compiling.