I transmit a custom mavlink message from px4 flight controller to qgc station, but the message received by qgc is wrong.
The mavlink protocal version is v1.0.
My custom mavlink message is as follows :
The custom mavlink message includes the common.xml. And I use mavgenerate.py tool to generate C style mavlink message code.
Now there is a strange phenomenon. It is the QGC station can received the custom mavlink message. But “MAVLink Inspector” and “Analyze” widgets can’t recongnize correctly data values of “PWM_INPUT” item.
What I can confirm are as follows :
(1) From the end of PX4/Firmware :
mavlink_msg_pwm_input.h : Add this header file into mavlink/v1.0/comon folder and include this file in the common.h file.
mavlink_messages.cpp : Class MavlinkStreamPWMINPUT defined by referencing Class MavlinkStreamAttitude is a custom class.
mavlink_messages.cpp : Transmit data by invoking send() method in Class MavlinkStreamPWMINPUT.
mavlink_messages.cpp : All the members of pwm_input(time_boot_ms, pulse_width, period) print correct data values.
mavlink_main.cpp : I also configure the transmission speed throuth invoking configure_stream(“PWMINPUT”, Hz.0f) method according to different MAVLINK_MODE_xx in task_main method .
(2) From the end of QGC station :
mavlink_msg_pwm_input.h : Add this header file into mavlink/v1.0/comon/ folder and include this file in the common.h file.
After including the pwm_input related header file, MAVLink Inspector and Analyze widgets can recongnize the PWM_INPUT mavlink message but can’t analyze correct member data values.
UAS.cc : The specific performance of PWM_INPUT.time_boot_ms, PWM_INPUT.pulse_width, PWM_INPUT.period print incorrect data values(As follows).
By preliminary observation and judgment, the qDebug values of the pwm_input’s members and the data shown via MAVLink Inspector and Analyze are the same.
What is the wrong? Can you tell me the reason? Thanks very much!