【QGroundControl二次开发】一.开发环境准备(Windows)
【QGroundControl二次开发】二.使用QT编译QGC(Windows)
【QGroundControl二次开发】三.QGC修改标题和logo(Windows)
一. 环境准备
二. 生成新的MAVLINK协议
在MAVlink源码下找到message_definitions/common.xml,修改其中的内容。
例如:
<message id="12" name="DISTANCE_SENSOR">
<description>Dedicated Raspberry PI Detects distance of the obstacle in front of the sensor</description>
<field type="uint64_t" name="time_usec" units="us">Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.</field>
<field type="uint8_t" name="sensor_type" enum="MAV_DISTANCE_SENSOR">Class id of the distance sensor type.</field>
<field type="uint16_t[72]" name="distances" units="cm" invalid="[UINT16_MAX]">Distance of obstacles around the vehicle with index 0 corresponding to north + angle_offset, unless otherwise specified in the frame. A value of 0 is valid and means that the obstacle is practically touching the sensor. A value of max_distance +1 means no obstacle is present. A value of UINT16_MAX for unknown/not used. In a array element, one unit corresponds to 1cm.</field>
<field type="uint8_t" name="increment" units="deg">Angular width in degrees of each array element. Increment direction is clockwise. This field is ignored if increment_f is non-zero.</field>
<field type="uint16_t" name="min_distance" units="cm">Minimum distance the sensor can measure.</field>
<field type="uint16_t" name="max_distance" units="cm">Maximum distance the sensor can measure.</field>
<extensions/>
<field type="float" name="increment_f" units="deg">Angular width in degrees of each array element as a float. If non-zero then this value is used instead of the uint8_t increment field. Positive is clockwise direction, negative is counter-clockwise.</field>
<field type="float" name="angle_offset" units="deg">Relative angle offset of the 0-index element in the distances array. Value of 0 corresponds to forward. Positive is clockwise direction, negative is counter-clockwise.</field>
<field type="uint8_t" name="frame" enum="MAV_FRAME">Coordinate frame of reference for the yaw rotation and offset of the sensor data. Defaults to MAV_FRAME_GLOBAL, which is north aligned. For body-mounted sensors use MAV_FRAME_BODY_FRD, which is vehicle front aligned.</field>
</message>
使用mavgenerate编译成所需语言。
python -m mavgenerate
XMl: 选择刚才修改后的common.xml。
Out: 输出路径
点击Generate, 显示如下即为成功。
生成内容如下: