Hey to all,
Im working on the PhotoGrammetry solution device for PixHawk, and fighting with MAVLink (or maybe more with my PixHawk 2.4.8 (china clone) running on FW 3.3.3 (latest FW does not work properly at all)
I need to get the current status of the drone, like “ON_GROUND” or “IN_FLIGHT” from Telem1/2 port via MAVLink protocol.
Only MSG_ID which should contain this info is:
EXTENDED_SYS_STATE message with MAV_LANDED_STATE enum, but I’m not able to get these messages to be sent via Telem1/2 port.
Requesting of data stream does not work (ACK returns 3 - UNSUPPORTED), and in the manual configuration, I did not find any item which will enable sending of this message ID → did I miss something?
Code I tried to request data_stream:
#1)
mavlink_message_t command;
mavlink_command_long_t c;
c.param1 = EXTENDED_SYS_STATE;
c.param2 = 1000;
c.command = MAV_CMD_SET_MESSAGE_INTERVAL;
c.target_system = 1;
c.target_component = 0;
mavlink_msg_command_long_encode(255, 0, &command, &c);
write(uartA_strm, &command, sizeof(command));
#2)
mavlink_message_t command;
mavlink_request_data_stream_t rq;
rq.req_message_rate=1;
rq.req_stream_id = EXTENDED_SYS_STATE;
rq.start_stop = 1;
mavlink_msg_request_data_stream_encode(255, 0, &command, &rq);
write(uartA_strm, &command, sizeof(command));
Can somebody give some hint on how to recognize that drone is flying or on the ground?