Skip to content

Commit b1b536f

Browse files
committed
actuator request esc settings
1 parent d4a2ac7 commit b1b536f

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

src/AutoPilotPlugins/PX4/ActuatorComponent.qml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ SetupPage {
107107
}
108108
}
109109

110+
// Left Column
110111
ColumnLayout {
111112
spacing: ScreenTools.defaultFontPixelHeight
112113
implicitWidth: _leftColumnWidth
@@ -396,12 +397,24 @@ SetupPage {
396397
}
397398
}
398399
}
399-
400400
} // Column
401-
402401
} // Column
403402
} // Rectangle
404-
}
403+
404+
// TODO: add ESC Settings section
405+
QGCLabel {
406+
text: qsTr("ESC Settings")
407+
font.pointSize: ScreenTools.mediumFontPointSize
408+
}
409+
410+
// Rectangle {
411+
// implicitWidth: _leftColumnWidth
412+
// implicitHeight: actuatorTesting.height + (_margins * 2)
413+
// color:
414+
// }
415+
416+
417+
} // Column
405418

406419
// Right column
407420
Column {

src/Vehicle/Actuators/ActuatorActions.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ QString Config::typeToLabel() const
2020
case Type::set3DModeOff: return QCoreApplication::translate("ActuatorAction", "3D mode: Off");
2121
case Type::setSpinDirection1: return QCoreApplication::translate("ActuatorAction", "Set Spin Direction 1");
2222
case Type::setSpinDirection2: return QCoreApplication::translate("ActuatorAction", "Set Spin Direction 2");
23+
case Type::requestEscSettings: return QCoreApplication::translate("ActuatorAction", "Request ESC Settings");
2324
}
2425
return "";
2526
}

src/Vehicle/Actuators/ActuatorActions.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ struct Config {
2525
set3DModeOff = ACTUATOR_CONFIGURATION_3D_MODE_OFF, ///< motors: disable 3D mode (reversible)
2626
setSpinDirection1 = ACTUATOR_CONFIGURATION_SPIN_DIRECTION1, ///< motors: set spin direction 1
2727
setSpinDirection2 = ACTUATOR_CONFIGURATION_SPIN_DIRECTION2, ///< motors: set spin direction 2
28+
requestEscSettings = 6, // TODO: add to mavlink spec
2829
};
2930

3031
QString typeToLabel() const;

src/Vehicle/Actuators/Actuators.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ bool Actuators::parseJson(const QJsonDocument &json)
451451
for (const auto& actionName : supportedActionsObj.keys()) {
452452
QJsonObject actionObj = supportedActionsObj.value(actionName).toObject();
453453
ActuatorActions::Config action{};
454+
qDebug() << "Available Action: " << actionName;
454455
bool knownAction = true;
455456
if (actionName == "beep") {
456457
action.type = ActuatorActions::Config::Type::beep;
@@ -462,6 +463,8 @@ bool Actuators::parseJson(const QJsonDocument &json)
462463
action.type = ActuatorActions::Config::Type::setSpinDirection1;
463464
} else if (actionName == "set-spin-direction2") {
464465
action.type = ActuatorActions::Config::Type::setSpinDirection2;
466+
} else if (actionName == "request-esc-settings") {
467+
action.type = ActuatorActions::Config::Type::requestEscSettings;
465468
} else {
466469
knownAction = false;
467470
qCWarning(ActuatorsConfigLog) << "Unknown 'supported-actions':" << actionName;

0 commit comments

Comments
 (0)