Currently I’m working on receiving Mavlink Arm/Disarm command sent from qgc and receive on my STM32 board.
My current program flow is as follow:
Sends Arm command from qgc to STM32
STM32 checks and confirms the command is of “MAV_CMD_COMPONENT_ARM_DISARM”. Thus performs its Arm routines and changes heartbeat field system_mode (to MAV_MODE_FLAG_SAFETY_ARMED).
On qgc, it switches to [Arm status]
The screen shows error saying that: ”Aircraft did not respond to command: MAV_CMD_COMPONENT_ARM_DISARM” (Sorry I’m usingJapanese version of qgc)
I have done several research on Internet and try everything in my ability by changing to various parameter on heart message, but still don’t succeed on acknowledging it correctly from STM32.
I would be thankful if someone can give me guidance how to solve this.
Thanks for your hint, this seems like a correct way to go.
I am trying to acknowledge the command by using mavlink_msg_command_ack_pack(), but the error still occurs. Below is my code:
I guess probably something isn’t right with the last two arguments for target system_id and component_id (qgroundcontrol’s id).
Do you have any idea regarding this?
Immediately sending back acknowledge message doesn’t work, as a temporary fix I have to put it into 10Hz loop to continuously send acknowledge commmd and the pop-up disappeared now.
I am able to acknowledge Arm command successfully but not in a proper manner.
Does any have idea with how should I reply the command after receiving Arm command from Qgc (what timing…)? Replying immediately doesn’t work in my case.