- 不用编译qgc的源码,仅仅需要编写一个QML UIs文件
- 这个小工具窗口可以被加载,并且从重启之后仍然可以使用,而且不受操作系统的限制
- 主要有两个用途 1查询显示(接收) 2自定义发送命令(mavlink message)
编写QML文件
import QtQuick 2.2
import QGroundControl.Controls 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.ScreenTools 1.0
import QGroundControl.Controllers 1.0
Rectangle {
anchors.fill: parent
color: qgcPal.window
CustomCommandWidgetController {
id: controller
factPanel: panel
}
QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
Column {
spacing: ScreenTools.defaultFontPixelHeight
QGCButton {
text: "Set Home to current position"
onClicked: controller.sendCommand(179, 50, 0, 1, 0, 0, 0, 0, 0, 0)
}
FactTextField {
fact: controller.getParameterFact(-1, "MAV_SYS_ID")
}
}
}
参考文档
QGroundControl Developers Guide