QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PX4TuningComponentCopterPosition.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.Controls
7import QGroundControl.FactControls
8
9ColumnLayout {
10 property real _availableHeight: availableHeight
11 property real _availableWidth: availableWidth
12 property Fact _mcPosMode: controller.getParameterFact(-1, "MPC_POS_MODE", false)
13
14 GridLayout {
15 columns: 2
16
17 QGCLabel {
18 text: qsTr("Position control mode (set this to 'simple' during tuning):")
19 visible: _mcPosMode
20 }
21 FactComboBox {
22 fact: _mcPosMode
23 indexModel: false
24 visible: _mcPosMode
25 }
26 }
27
28 PIDTuning {
29 id: pidTuning
30 availableWidth: _availableWidth
31 availableHeight: _availableHeight - pidTuning.y
32
33 property var horizontal: QtObject {
34 property string name: qsTr("Horizontal")
35 property string plotTitle: qsTr("Horizontal (Y direction, sidewards)")
36 property var plot: [
37 { name: "Response", value: globals.activeVehicle.localPosition.y.value },
38 { name: "Setpoint", value: globals.activeVehicle.localPositionSetpoint.y.value }
39 ]
40 property var params: ListModel {
41 ListElement {
42 title: qsTr("Proportional gain (MPC_XY_P)")
43 description: qsTr("Increase for more responsiveness, reduce if the position overshoots (there is only a setpoint when hovering, i.e. when centering the stick).")
44 param: "MPC_XY_P"
45 min: 0
46 max: 2
47 step: 0.05
48 }
49 }
50 }
51 property var vertical: QtObject {
52 property string name: qsTr("Vertical")
53 property var plot: [
54 { name: "Response", value: globals.activeVehicle.localPosition.z.value },
55 { name: "Setpoint", value: globals.activeVehicle.localPositionSetpoint.z.value }
56 ]
57 property var params: ListModel {
58 ListElement {
59 title: qsTr("Proportional gain (MPC_Z_P)")
60 description: qsTr("Increase for more responsiveness, reduce if the position overshoots (there is only a setpoint when hovering, i.e. when centering the stick).")
61 param: "MPC_Z_P"
62 min: 0
63 max: 2
64 step: 0.05
65 }
66 }
67 }
68 title: "Position"
69 tuningMode: Vehicle.ModeVelocityAndPosition
70 unit: "m"
71 axis: [ horizontal, vertical ]
72 chartDisplaySec: 50
73 }
74}