I have a Pixhawk running the latest Ardupilot (actually a custom version with a handful of GCS_SEND_TEXT statements in) connected to a companion computer (my laptop) over a wireless telemetry link. I cannot get the thing to takeoff, and all my messages sent to Ardupilot seem identical to those as done by Mission Planner and QGroundControl (both these GCSs make my drone takeoff).
I am doing this:
- Wait for heartbeat from autopilot. Store the system and component ID.
- Request streaming of all data types (REQUEST_DATA_STREAM). Make sure I get MAVLINK_MSG_ID_LOCAL_POSITION_NED and MAVLINK_MSG_ID_GLOBAL_POSITION_INT.
- Send MAV_CMD_NAV_GUIDED_ENABLE to enable offboard mode.
- Set COPTER_MODE_GUIDED i.e. guided flight mode.
- Arm the autopilot. Arming switch is also enabled BTW.
- Send MAV_CMD_NAV_TAKEOFF
com.confirmation = true;
com.param3 = (float) 0; // param3 : horizontal navigation by pilot acceptable
com.param7 = (float) 100; // param7 : altitude [metres]
- Nothing happens. No props turn. It auto-disarms after a few seconds.
I am able to verify that the drone is armed and in guided flight mode as expected and that it has GPS lock. I have also tried setting the system time and sending 1Hz heartbeats, although neither of these are necessary to my knowledge.
I have looked at the source code and put a few GCS_SEND_TEXT statements in to help me check the flow of code. I am seeing ModeGuided::do_user_takeoff_start being called correctly and the function runs all the way through.
I have a feeling that the reason for failure is related to either
but as there is no feedback from these function I am a little stuck.
Please can some Arduboffin help me debug this? I am at a loose end.