mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-31 16:52:10 +01:00
Merge remote-tracking branch 'origin/rel-14.10' into next
This commit is contained in:
commit
d70d94aef4
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -16,19 +16,19 @@ Item {
|
|||||||
property variant flightmodeColors : ["gray", "green", "green", "green", "green", "green", "green", "red",
|
property variant flightmodeColors : ["gray", "green", "green", "green", "green", "green", "green", "red",
|
||||||
"cyan", "cyan", "cyan", "cyan", "cyan", "cyan", "cyan", "cyan", "cyan"]
|
"cyan", "cyan", "cyan", "cyan", "cyan", "cyan", "cyan", "cyan", "cyan"]
|
||||||
|
|
||||||
// Manual,Rate,Attitude,AxisLock,WeakLeveling,VirtualBar,Acro+,Rattitude,RelayRate,RelayAttitude,
|
// Manual,Rate,Attitude,AxisLock,WeakLeveling,VirtualBar,Acro+,Rattitude,
|
||||||
// AltitudeHold,AltitudeVario,CruiseControl + Auto mode (VTOL/Wing pathfollower)
|
// AltitudeHold,AltitudeVario,CruiseControl + Auto mode (VTOL/Wing pathfollower)
|
||||||
// grey : 'disabled' modes
|
// grey : 'disabled' modes
|
||||||
|
|
||||||
property variant thrustmodeColors : ["green", "grey", "grey", "grey", "grey", "grey", "grey", "grey", "grey", "grey",
|
property variant thrustmodeColors : ["green", "grey", "grey", "grey", "grey", "grey", "grey", "grey",
|
||||||
"green", "green", "green", "cyan"]
|
"green", "green", "green", "cyan"]
|
||||||
|
|
||||||
// SystemSettings.AirframeType 3 - 18 : VtolPathFollower, check ThrustControl
|
// SystemSettings.AirframeType 3 - 18 : VtolPathFollower, check ThrustControl
|
||||||
|
|
||||||
property var thrust_mode: FlightStatus.FlightMode < 7 ? StabilizationDesired.StabilizationMode_Thrust :
|
property var thrust_mode: FlightStatus.FlightMode < 7 ? StabilizationDesired.StabilizationMode_Thrust :
|
||||||
FlightStatus.FlightMode > 7 && SystemSettings.AirframeType > 2 && SystemSettings.AirframeType < 19
|
FlightStatus.FlightMode > 7 && SystemSettings.AirframeType > 2 && SystemSettings.AirframeType < 19
|
||||||
&& VtolPathFollowerSettings.ThrustControl == 1 ? 13 :
|
&& VtolPathFollowerSettings.ThrustControl == 1 ? 11 :
|
||||||
FlightStatus.FlightMode > 7 && SystemSettings.AirframeType < 3 ? 13: 0
|
FlightStatus.FlightMode > 7 && SystemSettings.AirframeType < 3 ? 11: 0
|
||||||
|
|
||||||
|
|
||||||
property real flight_time: Math.round(SystemStats.FlightTime / 1000)
|
property real flight_time: Math.round(SystemStats.FlightTime / 1000)
|
||||||
@ -224,12 +224,12 @@ Item {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
color: FlightStatus.FlightMode < 1 ? "grey" : warnings.thrustmodeColors[thrust_mode.toString()]
|
color: FlightStatus.FlightMode < 1 ? "grey" : warnings.thrustmodeColors[thrust_mode.toString()]
|
||||||
|
|
||||||
// Manual,Rate,Attitude,AxisLock,WeakLeveling,VirtualBar,Acro+,Rattitude,RelayRate,RelayAttitude,
|
// Manual,Rate,Attitude,AxisLock,WeakLeveling,VirtualBar,Acro+,Rattitude,
|
||||||
// AltitudeHold,AltitudeVario,CruiseControl
|
// AltitudeHold,AltitudeVario,CruiseControl
|
||||||
// grey : 'disabled' modes
|
// grey : 'disabled' modes
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: ["MANUAL"," "," ", " ", " ", " ", " ", " ", " ", " ",
|
text: ["MANUAL"," "," ", " ", " ", " ", " ", " ",
|
||||||
"ALT HOLD", "ALT VARIO", "CRUISECTRL", "AUTO"][thrust_mode.toString()]
|
"ALT HOLD", "ALT VARIO", "CRUISECTRL", "AUTO"][thrust_mode.toString()]
|
||||||
font {
|
font {
|
||||||
family: "Arial"
|
family: "Arial"
|
||||||
|
@ -2344,7 +2344,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
<message>
|
<message>
|
||||||
<location/>
|
<location/>
|
||||||
<source>Go</source>
|
<source>Go</source>
|
||||||
<translation type="unfinished">Y aller</translation>
|
<translation>Y aller</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../../../src/plugins/opmap/opmap_widget.ui"/>
|
<location filename="../../../src/plugins/opmap/opmap_widget.ui"/>
|
||||||
@ -6180,9 +6180,8 @@ p, li { white-space: pre-wrap; }
|
|||||||
<translation>Options de Configuration et Calibration</translation>
|
<translation>Options de Configuration et Calibration</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location/>
|
|
||||||
<source>Start Configuration Wizard</source>
|
<source>Start Configuration Wizard</source>
|
||||||
<translation>Démarrer l'Assistant de Configuration</translation>
|
<translation type="vanished">Démarrer l'Assistant de Configuration</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location/>
|
<location/>
|
||||||
@ -6489,6 +6488,11 @@ Applique et Enregistre tous les paramètres sur la SD</translation>
|
|||||||
<source>Settings Bank</source>
|
<source>Settings Bank</source>
|
||||||
<translation>Banque Paramètres</translation>
|
<translation>Banque Paramètres</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<location/>
|
||||||
|
<source>Start Transmitter Setup Wizard</source>
|
||||||
|
<translation>Démarrer l'Assistant Configuration Émetteur</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>MixerCurve</name>
|
<name>MixerCurve</name>
|
||||||
@ -6731,15 +6735,24 @@ Applique et Enregistre tous les paramètres sur la SD</translation>
|
|||||||
<translation>Test en Temps Réel</translation>
|
<translation>Test en Temps Réel</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location/>
|
|
||||||
<source>Setup "RapidESC" here: usual value is 500 Hz for multirotor airframes.
|
<source>Setup "RapidESC" here: usual value is 500 Hz for multirotor airframes.
|
||||||
</source>
|
</source>
|
||||||
<translation>Configurer ici "TurboPWM" : 500Hz est une valeur classique pour les multirotors.</translation>
|
<translation type="vanished">Configurer ici "TurboPWM" : 500Hz est une valeur classique pour les multirotors.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>500</source>
|
||||||
|
<translation type="vanished">500</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location/>
|
<location/>
|
||||||
<source>500</source>
|
<source>Setup "RapidESC" here: usual value is 490 Hz for multirotor airframes.
|
||||||
<translation>500</translation>
|
</source>
|
||||||
|
<translation>Configurer ici "RapidESC" : 490Hz est une valeur classique pour les multirotors.</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location/>
|
||||||
|
<source>490</source>
|
||||||
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
@ -11159,13 +11172,21 @@ Double clic sur la légende ou le tracé pour afficher/cacher la légende.</tran
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
<source>Standard ESC (50 Hz)</source>
|
<source>Standard ESC (%1 Hz)</source>
|
||||||
<translation>Contrôleur Standard (50 Hz)</translation>
|
<translation>Contrôleur Standard (%1 Hz)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+3"/>
|
<location line="+3"/>
|
||||||
|
<source>Rapid ESC (%1 Hz)</source>
|
||||||
|
<translation>Contrôleur Rapide (%1 Hz)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Standard ESC (50 Hz)</source>
|
||||||
|
<translation type="vanished">Contrôleur Standard (50 Hz)</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
<source>Rapid ESC (500 Hz)</source>
|
<source>Rapid ESC (500 Hz)</source>
|
||||||
<translation>Contrôleur Rapide (500Hz)</translation>
|
<translation type="vanished">Contrôleur Rapide (500Hz)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location line="+9"/>
|
<location line="+9"/>
|
||||||
@ -15265,8 +15286,8 @@ A noter : Pour le GPS OpenPilot v8, veuillez choisir l'option GPS U-Blox.</
|
|||||||
<location filename="../../../src/plugins/setupwizard/pages/esccalibrationpage.cpp" line="+49"/>
|
<location filename="../../../src/plugins/setupwizard/pages/esccalibrationpage.cpp" line="+49"/>
|
||||||
<location line="+49"/>
|
<location line="+49"/>
|
||||||
<location line="+32"/>
|
<location line="+32"/>
|
||||||
|
<location line="+7"/>
|
||||||
<location line="+9"/>
|
<location line="+9"/>
|
||||||
<location line="+11"/>
|
|
||||||
<source>%1 µs</source>
|
<source>%1 µs</source>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -112,6 +112,13 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
|
|||||||
planeimg = new QGraphicsSvgItem();
|
planeimg = new QGraphicsSvgItem();
|
||||||
planeimg->setSharedRenderer(renderer);
|
planeimg->setSharedRenderer(renderer);
|
||||||
|
|
||||||
|
UAVDataObject *system = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(QString("SystemSettings")));
|
||||||
|
Q_ASSERT(system);
|
||||||
|
QPointer<UAVObjectField> field = system->getField(QString("AirframeType"));
|
||||||
|
|
||||||
|
UAVDataObject *mixer = dynamic_cast<UAVDataObject *>(getObjectManager()->getObject(QString("MixerSettings")));
|
||||||
|
Q_ASSERT(mixer);
|
||||||
|
|
||||||
if (frameType == "FixedWing" || frameType == "Aileron") {
|
if (frameType == "FixedWing" || frameType == "Aileron") {
|
||||||
planeimg->setElementId("aileron");
|
planeimg->setElementId("aileron");
|
||||||
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Aileron"));
|
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Aileron"));
|
||||||
@ -129,6 +136,9 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
|
|||||||
|
|
||||||
m_aircraft->elevonSlider1->setEnabled(false);
|
m_aircraft->elevonSlider1->setEnabled(false);
|
||||||
m_aircraft->elevonSlider2->setEnabled(false);
|
m_aircraft->elevonSlider2->setEnabled(false);
|
||||||
|
|
||||||
|
m_aircraft->elevonSlider1->setValue(100);
|
||||||
|
m_aircraft->elevonSlider2->setValue(100);
|
||||||
} else if (frameType == "FixedWingElevon" || frameType == "Elevon") {
|
} else if (frameType == "FixedWingElevon" || frameType == "Elevon") {
|
||||||
planeimg->setElementId("elevon");
|
planeimg->setElementId("elevon");
|
||||||
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Elevon"));
|
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Elevon"));
|
||||||
@ -147,6 +157,15 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
|
|||||||
|
|
||||||
m_aircraft->elevonSlider1->setEnabled(true);
|
m_aircraft->elevonSlider1->setEnabled(true);
|
||||||
m_aircraft->elevonSlider2->setEnabled(true);
|
m_aircraft->elevonSlider2->setEnabled(true);
|
||||||
|
|
||||||
|
// Get values saved if frameType = current frameType set on board
|
||||||
|
if (field->getValue().toString() == "FixedWingElevon") {
|
||||||
|
m_aircraft->elevonSlider1->setValue(getMixerValue(mixer, "MixerValueRoll"));
|
||||||
|
m_aircraft->elevonSlider2->setValue(getMixerValue(mixer, "MixerValuePitch"));
|
||||||
|
} else {
|
||||||
|
m_aircraft->elevonSlider1->setValue(100);
|
||||||
|
m_aircraft->elevonSlider2->setValue(100);
|
||||||
|
}
|
||||||
} else if (frameType == "FixedWingVtail" || frameType == "Vtail") {
|
} else if (frameType == "FixedWingVtail" || frameType == "Vtail") {
|
||||||
planeimg->setElementId("vtail");
|
planeimg->setElementId("vtail");
|
||||||
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Vtail"));
|
setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Vtail"));
|
||||||
@ -168,7 +187,17 @@ void ConfigFixedWingWidget::setupUI(QString frameType)
|
|||||||
|
|
||||||
m_aircraft->elevonSlider1->setEnabled(true);
|
m_aircraft->elevonSlider1->setEnabled(true);
|
||||||
m_aircraft->elevonSlider2->setEnabled(true);
|
m_aircraft->elevonSlider2->setEnabled(true);
|
||||||
|
|
||||||
|
// Get values saved if frameType = current frameType set on board
|
||||||
|
if (field->getValue().toString() == "FixedWingVtail") {
|
||||||
|
m_aircraft->elevonSlider1->setValue(getMixerValue(mixer, "MixerValueYaw"));
|
||||||
|
m_aircraft->elevonSlider2->setValue(getMixerValue(mixer, "MixerValuePitch"));
|
||||||
|
} else {
|
||||||
|
m_aircraft->elevonSlider1->setValue(100);
|
||||||
|
m_aircraft->elevonSlider2->setValue(100);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QGraphicsScene *scene = new QGraphicsScene();
|
QGraphicsScene *scene = new QGraphicsScene();
|
||||||
scene->addItem(planeimg);
|
scene->addItem(planeimg);
|
||||||
scene->setSceneRect(planeimg->boundingRect());
|
scene->setSceneRect(planeimg->boundingRect());
|
||||||
@ -240,26 +269,13 @@ void ConfigFixedWingWidget::refreshWidgetsValues(QString frameType)
|
|||||||
setComboCurrentIndex(m_aircraft->fwRudder1ChannelBox, fixed.FixedWingYaw1);
|
setComboCurrentIndex(m_aircraft->fwRudder1ChannelBox, fixed.FixedWingYaw1);
|
||||||
setComboCurrentIndex(m_aircraft->fwRudder2ChannelBox, fixed.FixedWingYaw2);
|
setComboCurrentIndex(m_aircraft->fwRudder2ChannelBox, fixed.FixedWingYaw2);
|
||||||
|
|
||||||
if (frameType == "FixedWingElevon") {
|
// Get mixing values for GUI sliders (values stored onboard)
|
||||||
// If the airframe is elevon, restore the slider setting
|
if (frameType == "FixedWingElevon" || frameType == "Elevon") {
|
||||||
// Find the channel number for Elevon1 (FixedWingRoll1)
|
m_aircraft->elevonSlider1->setValue(getMixerValue(mixer, "MixerValueRoll"));
|
||||||
int channel = m_aircraft->fwAileron1ChannelBox->currentIndex() - 1;
|
m_aircraft->elevonSlider2->setValue(getMixerValue(mixer, "MixerValuePitch"));
|
||||||
if (channel > -1) {
|
} else if (frameType == "FixedWingVtail" || frameType == "Vtail") {
|
||||||
// If for some reason the actuators were incoherent, we might fail here, hence the check.
|
m_aircraft->elevonSlider1->setValue(getMixerValue(mixer, "MixerValueYaw"));
|
||||||
m_aircraft->elevonSlider1->setValue(
|
m_aircraft->elevonSlider2->setValue(getMixerValue(mixer, "MixerValuePitch"));
|
||||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL) * 100);
|
|
||||||
m_aircraft->elevonSlider2->setValue(
|
|
||||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH) * 100);
|
|
||||||
}
|
|
||||||
} else if (frameType == "FixedWingVtail") {
|
|
||||||
int channel = m_aircraft->fwElevator1ChannelBox->currentIndex() - 1;
|
|
||||||
if (channel > -1) {
|
|
||||||
// If for some reason the actuators were incoherent, we might fail here, hence the check.
|
|
||||||
m_aircraft->elevonSlider1->setValue(
|
|
||||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW) * 100);
|
|
||||||
m_aircraft->elevonSlider2->setValue(
|
|
||||||
getMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH) * 100);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -404,37 +420,48 @@ bool ConfigFixedWingWidget::setupFrameElevon(QString airframeType)
|
|||||||
|
|
||||||
// 1. Assign the servo/motor/none for each channel
|
// 1. Assign the servo/motor/none for each channel
|
||||||
|
|
||||||
double value;
|
double pitch;
|
||||||
|
double roll;
|
||||||
|
double yaw;
|
||||||
|
|
||||||
// motor
|
// motor
|
||||||
int channel = m_aircraft->fwEngineChannelBox->currentIndex() - 1;
|
int channel = m_aircraft->fwEngineChannelBox->currentIndex() - 1;
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_MOTOR);
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_MOTOR);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127);
|
||||||
|
|
||||||
// rudders
|
// Yaw mixer value, currently no slider (should be added for Rudder response ?)
|
||||||
|
yaw = 127;
|
||||||
|
setMixerValue(mixer, "MixerValueYaw", 100);
|
||||||
|
|
||||||
channel = m_aircraft->fwRudder1ChannelBox->currentIndex() - 1;
|
channel = m_aircraft->fwRudder1ChannelBox->currentIndex() - 1;
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, 127);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, yaw);
|
||||||
|
|
||||||
channel = m_aircraft->fwRudder2ChannelBox->currentIndex() - 1;
|
channel = m_aircraft->fwRudder2ChannelBox->currentIndex() - 1;
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, -127);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, -yaw);
|
||||||
|
|
||||||
// ailerons
|
// ailerons
|
||||||
channel = m_aircraft->fwAileron1ChannelBox->currentIndex() - 1;
|
channel = m_aircraft->fwAileron1ChannelBox->currentIndex() - 1;
|
||||||
if (channel > -1) {
|
if (channel > -1) {
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
// Compute mixer absolute values
|
||||||
value = (double)(m_aircraft->elevonSlider2->value() * 1.27);
|
pitch = (double)(m_aircraft->elevonSlider2->value() * 1.27);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, value);
|
roll = (double)(m_aircraft->elevonSlider1->value() * 1.27);
|
||||||
value = (double)(m_aircraft->elevonSlider1->value() * 1.27);
|
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, value);
|
|
||||||
|
|
||||||
|
// Store sliders values onboard
|
||||||
|
setMixerValue(mixer, "MixerValuePitch", m_aircraft->elevonSlider2->value());
|
||||||
|
setMixerValue(mixer, "MixerValueRoll", m_aircraft->elevonSlider1->value());
|
||||||
|
|
||||||
|
// First servo (left aileron)
|
||||||
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
||||||
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, -pitch);
|
||||||
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, roll);
|
||||||
|
|
||||||
|
// Second servo (right aileron)
|
||||||
channel = m_aircraft->fwAileron2ChannelBox->currentIndex() - 1;
|
channel = m_aircraft->fwAileron2ChannelBox->currentIndex() - 1;
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
||||||
value = (double)(m_aircraft->elevonSlider2->value() * 1.27);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, pitch);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, value);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, roll);
|
||||||
value = (double)(m_aircraft->elevonSlider1->value() * 1.27);
|
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, -value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_aircraft->fwStatusLabel->setText("Mixer generated");
|
m_aircraft->fwStatusLabel->setText("Mixer generated");
|
||||||
@ -474,46 +501,54 @@ bool ConfigFixedWingWidget::setupFrameVtail(QString airframeType)
|
|||||||
|
|
||||||
// 1. Assign the servo/motor/none for each channel
|
// 1. Assign the servo/motor/none for each channel
|
||||||
|
|
||||||
|
double pitch;
|
||||||
|
double roll;
|
||||||
|
double yaw;
|
||||||
|
|
||||||
// motor
|
// motor
|
||||||
int channel = m_aircraft->fwEngineChannelBox->currentIndex() - 1;
|
int channel = m_aircraft->fwEngineChannelBox->currentIndex() - 1;
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_MOTOR);
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_MOTOR);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127);
|
||||||
|
|
||||||
// rudders
|
|
||||||
channel = m_aircraft->fwRudder1ChannelBox->currentIndex() - 1;
|
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, 127);
|
|
||||||
|
|
||||||
channel = m_aircraft->fwRudder2ChannelBox->currentIndex() - 1;
|
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, -127);
|
|
||||||
|
|
||||||
// ailerons
|
// ailerons
|
||||||
channel = m_aircraft->fwAileron1ChannelBox->currentIndex() - 1;
|
channel = m_aircraft->fwAileron1ChannelBox->currentIndex() - 1;
|
||||||
if (channel > -1) {
|
if (channel > -1) {
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
// Roll mixer value, currently no slider (should be added for Ailerons response ?)
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, 127);
|
roll = 127;
|
||||||
|
// Store Roll fixed value onboard
|
||||||
|
setMixerValue(mixer, "MixerValueRoll", 100);
|
||||||
|
|
||||||
|
// First Aileron (left)
|
||||||
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
||||||
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, roll);
|
||||||
|
|
||||||
|
// Second Aileron (right)
|
||||||
channel = m_aircraft->fwAileron2ChannelBox->currentIndex() - 1;
|
channel = m_aircraft->fwAileron2ChannelBox->currentIndex() - 1;
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, -127);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, roll);
|
||||||
}
|
}
|
||||||
|
|
||||||
// vtail
|
// vtail (pitch / yaw mixing)
|
||||||
channel = m_aircraft->fwElevator1ChannelBox->currentIndex() - 1;
|
channel = m_aircraft->fwElevator1ChannelBox->currentIndex() - 1;
|
||||||
if (channel > -1) {
|
if (channel > -1) {
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
// Compute mixer absolute values
|
||||||
double value = (double)(m_aircraft->elevonSlider2->value() * 1.27);
|
pitch = (double)(m_aircraft->elevonSlider2->value() * 1.27);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, value);
|
yaw = (double)(m_aircraft->elevonSlider1->value() * 1.27);
|
||||||
value = (double)(m_aircraft->elevonSlider1->value() * 1.27);
|
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, value);
|
|
||||||
|
|
||||||
|
// Store sliders values onboard
|
||||||
|
setMixerValue(mixer, "MixerValuePitch", m_aircraft->elevonSlider2->value());
|
||||||
|
setMixerValue(mixer, "MixerValueYaw", m_aircraft->elevonSlider1->value());
|
||||||
|
|
||||||
|
// First Vtail servo
|
||||||
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
||||||
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, -pitch);
|
||||||
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, yaw);
|
||||||
|
|
||||||
|
// Second Vtail servo
|
||||||
channel = m_aircraft->fwElevator2ChannelBox->currentIndex() - 1;
|
channel = m_aircraft->fwElevator2ChannelBox->currentIndex() - 1;
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_SERVO);
|
||||||
value = (double)(m_aircraft->elevonSlider2->value() * 1.27);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, pitch);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, value);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, yaw);
|
||||||
value = (double)(m_aircraft->elevonSlider1->value() * 1.27);
|
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, -value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_aircraft->fwStatusLabel->setText("Mixer generated");
|
m_aircraft->fwStatusLabel->setText("Mixer generated");
|
||||||
|
@ -807,18 +807,13 @@ void ConfigMultiRotorWidget::setupQuadMotor(int channel, double pitch, double ro
|
|||||||
|
|
||||||
Q_ASSERT(mixer);
|
Q_ASSERT(mixer);
|
||||||
|
|
||||||
// Normalize mixer values, allow a well balanced mixer saved
|
|
||||||
pitch = (pitch < 0) ? qFloor(pitch * 127) : qCeil(pitch * 127);
|
|
||||||
roll = (roll < 0) ? qFloor(roll * 127) : qCeil(roll * 127);
|
|
||||||
yaw = (yaw < 0) ? qFloor(yaw * 127) : qCeil(yaw * 127);
|
|
||||||
|
|
||||||
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_MOTOR);
|
setMixerType(mixer, channel, VehicleConfig::MIXERTYPE_MOTOR);
|
||||||
|
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE1, 127);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE2, 0);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_THROTTLECURVE2, 0);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, roll);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_ROLL, roll * 127);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, pitch);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_PITCH, pitch * 127);
|
||||||
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, yaw);
|
setMixerVectorValue(mixer, channel, VehicleConfig::MIXERVECTOR_YAW, yaw * 127);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "uavobjectmanager.h"
|
#include "uavobjectmanager.h"
|
||||||
#include "uavobject.h"
|
#include "uavobject.h"
|
||||||
#include "systemsettings.h"
|
#include "systemsettings.h"
|
||||||
|
#include <QtCore/qmath.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@ -254,6 +255,9 @@ void VehicleConfig::setMixerVectorValue(UAVDataObject *mixer, int channel, Mixer
|
|||||||
UAVObjectField *field = mixer->getField(mixerVectors.at(channel));
|
UAVObjectField *field = mixer->getField(mixerVectors.at(channel));
|
||||||
Q_ASSERT(field);
|
Q_ASSERT(field);
|
||||||
|
|
||||||
|
// Normalize mixer values
|
||||||
|
value = (value < 0) ? qFloor(value) : qCeil(value);
|
||||||
|
|
||||||
if (field) {
|
if (field) {
|
||||||
field->setDouble(value, elementName);
|
field->setDouble(value, elementName);
|
||||||
}
|
}
|
||||||
|
@ -58,13 +58,24 @@ ConfigInputWidget::ConfigInputWidget(QWidget *parent) :
|
|||||||
skipflag(false),
|
skipflag(false),
|
||||||
nextDelayedTimer(),
|
nextDelayedTimer(),
|
||||||
nextDelayedTick(0),
|
nextDelayedTick(0),
|
||||||
nextDelayedLatestActivityTick(0)
|
nextDelayedLatestActivityTick(0),
|
||||||
|
accessoryDesiredObj0(NULL),
|
||||||
|
accessoryDesiredObj1(NULL),
|
||||||
|
accessoryDesiredObj2(NULL)
|
||||||
{
|
{
|
||||||
manualCommandObj = ManualControlCommand::GetInstance(getObjectManager());
|
manualCommandObj = ManualControlCommand::GetInstance(getObjectManager());
|
||||||
manualSettingsObj = ManualControlSettings::GetInstance(getObjectManager());
|
manualSettingsObj = ManualControlSettings::GetInstance(getObjectManager());
|
||||||
flightModeSettingsObj = FlightModeSettings::GetInstance(getObjectManager());
|
flightModeSettingsObj = FlightModeSettings::GetInstance(getObjectManager());
|
||||||
flightStatusObj = FlightStatus::GetInstance(getObjectManager());
|
flightStatusObj = FlightStatus::GetInstance(getObjectManager());
|
||||||
receiverActivityObj = ReceiverActivity::GetInstance(getObjectManager());
|
receiverActivityObj = ReceiverActivity::GetInstance(getObjectManager());
|
||||||
|
accessoryDesiredObj0 = AccessoryDesired::GetInstance(getObjectManager(), 0);
|
||||||
|
accessoryDesiredObj1 = AccessoryDesired::GetInstance(getObjectManager(), 1);
|
||||||
|
accessoryDesiredObj2 = AccessoryDesired::GetInstance(getObjectManager(), 2);
|
||||||
|
|
||||||
|
// Only instance 0 is present if the board is not connected.
|
||||||
|
// The other instances are populated lazily.
|
||||||
|
Q_ASSERT(accessoryDesiredObj0);
|
||||||
|
|
||||||
ui = new Ui_InputWidget();
|
ui = new Ui_InputWidget();
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
@ -398,10 +409,6 @@ void ConfigInputWidget::goToWizard()
|
|||||||
flightModeSettingsData.Arming = FlightModeSettings::ARMING_ALWAYSDISARMED;
|
flightModeSettingsData.Arming = FlightModeSettings::ARMING_ALWAYSDISARMED;
|
||||||
flightModeSettingsObj->setData(flightModeSettingsData);
|
flightModeSettingsObj->setData(flightModeSettingsData);
|
||||||
|
|
||||||
accessoryDesiredObj0 = AccessoryDesired::GetInstance(getObjectManager(), 0);
|
|
||||||
accessoryDesiredObj1 = AccessoryDesired::GetInstance(getObjectManager(), 1);
|
|
||||||
accessoryDesiredObj2 = AccessoryDesired::GetInstance(getObjectManager(), 2);
|
|
||||||
|
|
||||||
// Use faster input update rate.
|
// Use faster input update rate.
|
||||||
fastMdata();
|
fastMdata();
|
||||||
|
|
||||||
@ -1293,15 +1300,54 @@ void ConfigInputWidget::moveTxControls()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AccessoryDesired *ConfigInputWidget::getAccessoryDesiredInstance(int instance)
|
||||||
|
{
|
||||||
|
switch (instance) {
|
||||||
|
case 0:
|
||||||
|
if (accessoryDesiredObj0 == NULL) {
|
||||||
|
accessoryDesiredObj0 = AccessoryDesired::GetInstance(getObjectManager(), 0);
|
||||||
|
}
|
||||||
|
return accessoryDesiredObj0;
|
||||||
|
|
||||||
|
case 1:
|
||||||
|
if (accessoryDesiredObj1 == NULL) {
|
||||||
|
accessoryDesiredObj1 = AccessoryDesired::GetInstance(getObjectManager(), 1);
|
||||||
|
}
|
||||||
|
return accessoryDesiredObj1;
|
||||||
|
|
||||||
|
case 2:
|
||||||
|
if (accessoryDesiredObj2 == NULL) {
|
||||||
|
accessoryDesiredObj2 = AccessoryDesired::GetInstance(getObjectManager(), 2);
|
||||||
|
}
|
||||||
|
return accessoryDesiredObj2;
|
||||||
|
|
||||||
|
default:
|
||||||
|
Q_ASSERT(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
float ConfigInputWidget::getAccessoryDesiredValue(int instance)
|
||||||
|
{
|
||||||
|
AccessoryDesired *accessoryDesiredObj = getAccessoryDesiredInstance(instance);
|
||||||
|
|
||||||
|
if (accessoryDesiredObj == NULL) {
|
||||||
|
Q_ASSERT(false);
|
||||||
|
return 0.0f;
|
||||||
|
}
|
||||||
|
|
||||||
|
AccessoryDesired::DataFields data = accessoryDesiredObj->getData();
|
||||||
|
|
||||||
|
return data.AccessoryVal;
|
||||||
|
}
|
||||||
|
|
||||||
void ConfigInputWidget::moveSticks()
|
void ConfigInputWidget::moveSticks()
|
||||||
{
|
{
|
||||||
QTransform trans;
|
QTransform trans;
|
||||||
|
|
||||||
manualCommandData = manualCommandObj->getData();
|
manualCommandData = manualCommandObj->getData();
|
||||||
flightStatusData = flightStatusObj->getData();
|
flightStatusData = flightStatusObj->getData();
|
||||||
accessoryDesiredData0 = accessoryDesiredObj0->getData();
|
|
||||||
accessoryDesiredData1 = accessoryDesiredObj1->getData();
|
|
||||||
accessoryDesiredData2 = accessoryDesiredObj2->getData();
|
|
||||||
|
|
||||||
switch (transmitterMode) {
|
switch (transmitterMode) {
|
||||||
case mode1:
|
case mode1:
|
||||||
@ -1342,9 +1388,10 @@ void ConfigInputWidget::moveSticks()
|
|||||||
m_txFlightMode->setElementId("flightModeRight");
|
m_txFlightMode->setElementId("flightModeRight");
|
||||||
m_txFlightMode->setTransform(m_txFlightModeROrig, false);
|
m_txFlightMode->setTransform(m_txFlightModeROrig, false);
|
||||||
}
|
}
|
||||||
m_txAccess0->setTransform(QTransform(m_txAccess0Orig).translate(accessoryDesiredData0.AccessoryVal * ACCESS_MAX_MOVE * 10, 0), false);
|
|
||||||
m_txAccess1->setTransform(QTransform(m_txAccess1Orig).translate(accessoryDesiredData1.AccessoryVal * ACCESS_MAX_MOVE * 10, 0), false);
|
m_txAccess0->setTransform(QTransform(m_txAccess0Orig).translate(getAccessoryDesiredValue(0) * ACCESS_MAX_MOVE * 10, 0), false);
|
||||||
m_txAccess2->setTransform(QTransform(m_txAccess2Orig).translate(accessoryDesiredData2.AccessoryVal * ACCESS_MAX_MOVE * 10, 0), false);
|
m_txAccess1->setTransform(QTransform(m_txAccess1Orig).translate(getAccessoryDesiredValue(1) * ACCESS_MAX_MOVE * 10, 0), false);
|
||||||
|
m_txAccess2->setTransform(QTransform(m_txAccess2Orig).translate(getAccessoryDesiredValue(2) * ACCESS_MAX_MOVE * 10, 0), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConfigInputWidget::dimOtherControls(bool value)
|
void ConfigInputWidget::dimOtherControls(bool value)
|
||||||
@ -1534,7 +1581,7 @@ void ConfigInputWidget::simpleCalibration(bool enable)
|
|||||||
manualSettingsData.ChannelMax[i] = manualCommandData.Channel[i];
|
manualSettingsData.ChannelMax[i] = manualCommandData.Channel[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
fastMdata();
|
fastMdataSingle(manualCommandObj, &manualControlMdata);
|
||||||
|
|
||||||
connect(manualCommandObj, SIGNAL(objectUnpacked(UAVObject *)), this, SLOT(updateCalibration()));
|
connect(manualCommandObj, SIGNAL(objectUnpacked(UAVObject *)), this, SLOT(updateCalibration()));
|
||||||
} else {
|
} else {
|
||||||
@ -1543,7 +1590,7 @@ void ConfigInputWidget::simpleCalibration(bool enable)
|
|||||||
manualCommandData = manualCommandObj->getData();
|
manualCommandData = manualCommandObj->getData();
|
||||||
manualSettingsData = manualSettingsObj->getData();
|
manualSettingsData = manualSettingsObj->getData();
|
||||||
|
|
||||||
restoreMdata();
|
restoreMdataSingle(manualCommandObj, &manualControlMdata);
|
||||||
|
|
||||||
for (unsigned int i = 0; i < ManualControlCommand::CHANNEL_NUMELEM; i++) {
|
for (unsigned int i = 0; i < ManualControlCommand::CHANNEL_NUMELEM; i++) {
|
||||||
manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i];
|
manualSettingsData.ChannelNeutral[i] = manualCommandData.Channel[i];
|
||||||
|
@ -116,9 +116,6 @@ private:
|
|||||||
AccessoryDesired *accessoryDesiredObj0;
|
AccessoryDesired *accessoryDesiredObj0;
|
||||||
AccessoryDesired *accessoryDesiredObj1;
|
AccessoryDesired *accessoryDesiredObj1;
|
||||||
AccessoryDesired *accessoryDesiredObj2;
|
AccessoryDesired *accessoryDesiredObj2;
|
||||||
AccessoryDesired::DataFields accessoryDesiredData0;
|
|
||||||
AccessoryDesired::DataFields accessoryDesiredData1;
|
|
||||||
AccessoryDesired::DataFields accessoryDesiredData2;
|
|
||||||
|
|
||||||
ManualControlSettings *manualSettingsObj;
|
ManualControlSettings *manualSettingsObj;
|
||||||
ManualControlSettings::DataFields manualSettingsData;
|
ManualControlSettings::DataFields manualSettingsData;
|
||||||
@ -171,6 +168,9 @@ private:
|
|||||||
void wzNextDelayedStart();
|
void wzNextDelayedStart();
|
||||||
void wzNextDelayedCancel();
|
void wzNextDelayedCancel();
|
||||||
|
|
||||||
|
AccessoryDesired *getAccessoryDesiredInstance(int instance);
|
||||||
|
float getAccessoryDesiredValue(int instance);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void wzNext();
|
void wzNext();
|
||||||
void wzNextDelayed();
|
void wzNextDelayed();
|
||||||
|
@ -116,8 +116,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>774</width>
|
<width>772</width>
|
||||||
<height>505</height>
|
<height>514</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
@ -366,7 +366,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Start Configuration Wizard</string>
|
<string>Start Transmitter Setup Wizard</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@ -542,8 +542,8 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>758</width>
|
<width>724</width>
|
||||||
<height>542</height>
|
<height>497</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_7" rowstretch="1,0,0,0">
|
<layout class="QGridLayout" name="gridLayout_7" rowstretch="1,0,0,0">
|
||||||
@ -2044,8 +2044,8 @@ Setup the flight mode channel on the RC Input tab if you have not done so alread
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>565</width>
|
<width>407</width>
|
||||||
<height>159</height>
|
<height>138</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
@ -282,7 +282,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Setup "RapidESC" here: usual value is 500 Hz for multirotor airframes.
|
<string>Setup "RapidESC" here: usual value is 490 Hz for multirotor airframes.
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -322,7 +322,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>500</string>
|
<string>490</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
@ -345,7 +345,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Setup "RapidESC" here: usual value is 500 Hz for multirotor airframes.
|
<string>Setup "RapidESC" here: usual value is 490 Hz for multirotor airframes.
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -385,7 +385,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>500</string>
|
<string>490</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
@ -430,7 +430,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Setup "RapidESC" here: usual value is 500 Hz for multirotor airframes.
|
<string>Setup "RapidESC" here: usual value is 490 Hz for multirotor airframes.
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -470,7 +470,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>500</string>
|
<string>490</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
@ -493,7 +493,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Setup "RapidESC" here: usual value is 500 Hz for multirotor airframes.
|
<string>Setup "RapidESC" here: usual value is 490 Hz for multirotor airframes.
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -533,7 +533,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>500</string>
|
<string>490</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
@ -566,7 +566,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Setup "RapidESC" here: usual value is 500 Hz for multirotor airframes.
|
<string>Setup "RapidESC" here: usual value is 490 Hz for multirotor airframes.
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -606,7 +606,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>500</string>
|
<string>490</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
@ -629,7 +629,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="toolTip">
|
<property name="toolTip">
|
||||||
<string>Setup "RapidESC" here: usual value is 500 Hz for multirotor airframes.
|
<string>Setup "RapidESC" here: usual value is 490 Hz for multirotor airframes.
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
@ -669,7 +669,7 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>500</string>
|
<string>490</string>
|
||||||
</property>
|
</property>
|
||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -36,7 +36,7 @@ bool OutputCalibrationUtil::c_prepared = false;
|
|||||||
ActuatorCommand::Metadata OutputCalibrationUtil::c_savedActuatorCommandMetaData;
|
ActuatorCommand::Metadata OutputCalibrationUtil::c_savedActuatorCommandMetaData;
|
||||||
|
|
||||||
OutputCalibrationUtil::OutputCalibrationUtil(QObject *parent) :
|
OutputCalibrationUtil::OutputCalibrationUtil(QObject *parent) :
|
||||||
QObject(parent), m_outputChannel(-1), m_safeValue(1000)
|
QObject(parent), m_safeValue(1000)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
OutputCalibrationUtil::~OutputCalibrationUtil()
|
OutputCalibrationUtil::~OutputCalibrationUtil()
|
||||||
@ -93,15 +93,17 @@ void OutputCalibrationUtil::stopOutputCalibration()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OutputCalibrationUtil::startChannelOutput(quint16 channel, quint16 safeValue)
|
void OutputCalibrationUtil::startChannelOutput(quint16 channel, quint16 safeValue) {
|
||||||
|
QList<quint16> channels;
|
||||||
|
channels.append(channel);
|
||||||
|
startChannelOutput(channels, safeValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
void OutputCalibrationUtil::startChannelOutput(QList<quint16> channels, quint16 safeValue)
|
||||||
{
|
{
|
||||||
if (c_prepared) {
|
if (c_prepared) {
|
||||||
if (m_outputChannel < 0 && channel < ActuatorCommand::CHANNEL_NUMELEM) {
|
m_outputChannels = channels;
|
||||||
// Start output...
|
m_safeValue = safeValue;
|
||||||
m_outputChannel = channel;
|
|
||||||
m_safeValue = safeValue;
|
|
||||||
qDebug() << "Output for channel " << m_outputChannel + 1 << " started.";
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "OutputCalibrationUtil not started.";
|
qDebug() << "OutputCalibrationUtil not started.";
|
||||||
}
|
}
|
||||||
@ -110,15 +112,9 @@ void OutputCalibrationUtil::startChannelOutput(quint16 channel, quint16 safeValu
|
|||||||
void OutputCalibrationUtil::stopChannelOutput()
|
void OutputCalibrationUtil::stopChannelOutput()
|
||||||
{
|
{
|
||||||
if (c_prepared) {
|
if (c_prepared) {
|
||||||
if (m_outputChannel >= 0) {
|
setChannelOutputValue(m_safeValue);
|
||||||
qDebug() << "Stopping output for channel " << m_outputChannel + 1 << "...";
|
m_outputChannels.clear();
|
||||||
// Stop output...
|
qDebug() << "OutputCalibrationUtil output stopped.";
|
||||||
setChannelOutputValue(m_safeValue);
|
|
||||||
qDebug() << "Settings output for channel " << m_outputChannel + 1 << " to " << m_safeValue;
|
|
||||||
qDebug() << "Output for channel " << m_outputChannel + 1 << " stopped.";
|
|
||||||
|
|
||||||
m_outputChannel = -1;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
qDebug() << "OutputCalibrationUtil not started.";
|
qDebug() << "OutputCalibrationUtil not started.";
|
||||||
}
|
}
|
||||||
@ -127,15 +123,20 @@ void OutputCalibrationUtil::stopChannelOutput()
|
|||||||
void OutputCalibrationUtil::setChannelOutputValue(quint16 value)
|
void OutputCalibrationUtil::setChannelOutputValue(quint16 value)
|
||||||
{
|
{
|
||||||
if (c_prepared) {
|
if (c_prepared) {
|
||||||
if (m_outputChannel >= 0) {
|
ActuatorCommand *actuatorCommand = getActuatorCommandObject();
|
||||||
|
ActuatorCommand::DataFields data = actuatorCommand->getData();
|
||||||
|
foreach (quint32 channel, m_outputChannels) {
|
||||||
// Set output value
|
// Set output value
|
||||||
qDebug() << "Setting output value for channel " << m_outputChannel << " to " << value << ".";
|
if (channel <= ActuatorCommand::CHANNEL_NUMELEM){
|
||||||
ActuatorCommand *actuatorCommand = getActuatorCommandObject();
|
qDebug() << "OutputCalibrationUtil setting output value for channel " << channel << " to " << value << ".";
|
||||||
ActuatorCommand::DataFields data = actuatorCommand->getData();
|
data.Channel[channel] = value;
|
||||||
data.Channel[m_outputChannel] = value;
|
} else {
|
||||||
actuatorCommand->setData(data);
|
qDebug() << "OutputCalibrationUtil could not set output value for channel " << channel
|
||||||
} else {
|
<< " to " << value << "." << "Channel out of bounds" << channel << ".";
|
||||||
qDebug() << "OutputCalibrationUtil not started.";
|
}
|
||||||
}
|
}
|
||||||
|
actuatorCommand->setData(data);
|
||||||
|
} else {
|
||||||
|
qDebug() << "OutputCalibrationUtil not started.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -44,13 +44,14 @@ public:
|
|||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void startChannelOutput(quint16 channel, quint16 safeValue);
|
void startChannelOutput(quint16 channel, quint16 safeValue);
|
||||||
|
void startChannelOutput(QList<quint16> channels, quint16 safeValue);
|
||||||
void stopChannelOutput();
|
void stopChannelOutput();
|
||||||
void setChannelOutputValue(quint16 value);
|
void setChannelOutputValue(quint16 value);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static bool c_prepared;
|
static bool c_prepared;
|
||||||
static ActuatorCommand::Metadata c_savedActuatorCommandMetaData;
|
static ActuatorCommand::Metadata c_savedActuatorCommandMetaData;
|
||||||
qint16 m_outputChannel;
|
QList<quint16> m_outputChannels;
|
||||||
quint16 m_safeValue;
|
quint16 m_safeValue;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -102,17 +102,19 @@ void EscCalibrationPage::startButtonClicked()
|
|||||||
MixerSettings *mSettings = MixerSettings::GetInstance(uavoManager);
|
MixerSettings *mSettings = MixerSettings::GetInstance(uavoManager);
|
||||||
Q_ASSERT(mSettings);
|
Q_ASSERT(mSettings);
|
||||||
QString mixerTypePattern = "Mixer%1Type";
|
QString mixerTypePattern = "Mixer%1Type";
|
||||||
|
|
||||||
OutputCalibrationUtil::startOutputCalibration();
|
OutputCalibrationUtil::startOutputCalibration();
|
||||||
for (quint32 i = 0; i < ActuatorSettings::CHANNELADDR_NUMELEM; i++) {
|
for (quint32 i = 0; i < ActuatorSettings::CHANNELADDR_NUMELEM; i++) {
|
||||||
UAVObjectField *field = mSettings->getField(mixerTypePattern.arg(i + 1));
|
UAVObjectField *field = mSettings->getField(mixerTypePattern.arg(i + 1));
|
||||||
Q_ASSERT(field);
|
Q_ASSERT(field);
|
||||||
if (field->getValue().toString() == field->getOptions().at(VehicleConfigurationHelper::MIXER_TYPE_MOTOR)) {
|
if (field->getValue().toString() == field->getOptions().at(VehicleConfigurationHelper::MIXER_TYPE_MOTOR)) {
|
||||||
OutputCalibrationUtil *output = new OutputCalibrationUtil();
|
m_outputChannels << i;
|
||||||
output->startChannelOutput(i, OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS);
|
|
||||||
output->setChannelOutputValue(HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS);
|
|
||||||
m_outputs << output;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
m_outputUtil.startChannelOutput(m_outputChannels, OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS);
|
||||||
|
QThread::msleep(100);
|
||||||
|
m_outputUtil.setChannelOutputValue(HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS);
|
||||||
|
|
||||||
ui->stopButton->setEnabled(true);
|
ui->stopButton->setEnabled(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -124,35 +126,29 @@ void EscCalibrationPage::stopButtonClicked()
|
|||||||
ui->outputHigh->setEnabled(false);
|
ui->outputHigh->setEnabled(false);
|
||||||
|
|
||||||
// Set to low pwm out
|
// Set to low pwm out
|
||||||
foreach(OutputCalibrationUtil * output, m_outputs) {
|
m_outputUtil.setChannelOutputValue(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS);
|
||||||
output->setChannelOutputValue(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS);
|
|
||||||
}
|
|
||||||
ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
|
ui->outputLevel->setText(QString(tr("%1 µs")).arg(LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QThread::msleep(2000);
|
QThread::msleep(2000);
|
||||||
|
|
||||||
// Ramp down to off pwm out
|
// Ramp down to off pwm out
|
||||||
for (int i = LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS; i >= OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS; i -= 10) {
|
for (int i = LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS; i >= OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS; i -= 10) {
|
||||||
foreach(OutputCalibrationUtil * output, m_outputs) {
|
m_outputUtil.setChannelOutputValue(i);
|
||||||
output->setChannelOutputValue(i);
|
|
||||||
}
|
|
||||||
ui->outputLevel->setText(QString(tr("%1 µs")).arg(i));
|
ui->outputLevel->setText(QString(tr("%1 µs")).arg(i));
|
||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
QThread::msleep(200);
|
QThread::msleep(200);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stop output
|
// Stop output
|
||||||
foreach(OutputCalibrationUtil * output, m_outputs) {
|
m_outputUtil.stopChannelOutput();
|
||||||
output->stopChannelOutput();
|
|
||||||
delete output;
|
|
||||||
}
|
|
||||||
OutputCalibrationUtil::stopOutputCalibration();
|
OutputCalibrationUtil::stopOutputCalibration();
|
||||||
|
|
||||||
ui->outputLevel->setText(QString(tr("%1 µs")).arg(OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
|
ui->outputLevel->setText(QString(tr("%1 µs")).arg(OFF_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS));
|
||||||
ui->outputHigh->setEnabled(false);
|
ui->outputHigh->setEnabled(false);
|
||||||
ui->outputLow->setEnabled(true);
|
ui->outputLow->setEnabled(true);
|
||||||
ui->nonconnectedLabel->setEnabled(true);
|
ui->nonconnectedLabel->setEnabled(true);
|
||||||
ui->connectedLabel->setEnabled(false);
|
ui->connectedLabel->setEnabled(false);
|
||||||
m_outputs.clear();
|
m_outputChannels.clear();
|
||||||
m_isCalibrating = false;
|
m_isCalibrating = false;
|
||||||
resetAllSecurityCheckboxes();
|
resetAllSecurityCheckboxes();
|
||||||
enableButtons(true);
|
enableButtons(true);
|
||||||
|
@ -58,8 +58,8 @@ private:
|
|||||||
static const int HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1900;
|
static const int HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1900;
|
||||||
Ui::EscCalibrationPage *ui;
|
Ui::EscCalibrationPage *ui;
|
||||||
bool m_isCalibrating;
|
bool m_isCalibrating;
|
||||||
|
OutputCalibrationUtil m_outputUtil;
|
||||||
QList<OutputCalibrationUtil *> m_outputs;
|
QList<quint16> m_outputChannels;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // ESCCALIBRATIONPAGE_H
|
#endif // ESCCALIBRATIONPAGE_H
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 6.4 KiB After Width: | Height: | Size: 5.5 KiB |
@ -370,10 +370,10 @@ QString SetupWizard::getSummaryText()
|
|||||||
summary.append("<b>").append(tr("Speed Controller (ESC) type: ")).append("</b>");
|
summary.append("<b>").append(tr("Speed Controller (ESC) type: ")).append("</b>");
|
||||||
switch (getEscType()) {
|
switch (getEscType()) {
|
||||||
case ESC_STANDARD:
|
case ESC_STANDARD:
|
||||||
summary.append(tr("Standard ESC (50 Hz)"));
|
summary.append(tr("Standard ESC (%1 Hz)").arg(VehicleConfigurationHelper::LEGACY_ESC_FREQUENCY));
|
||||||
break;
|
break;
|
||||||
case ESC_RAPID:
|
case ESC_RAPID:
|
||||||
summary.append(tr("Rapid ESC (500 Hz)"));
|
summary.append(tr("Rapid ESC (%1 Hz)").arg(VehicleConfigurationHelper::RAPID_ESC_FREQUENCY));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
summary.append(tr("Unknown"));
|
summary.append(tr("Unknown"));
|
||||||
|
@ -690,6 +690,10 @@ void VehicleConfigurationHelper::applyMixerConfiguration(mixerChannelSettings ch
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VehicleConfigurationSource::VEHICLE_FIXEDWING:
|
case VehicleConfigurationSource::VEHICLE_FIXEDWING:
|
||||||
|
mSettings->setMixerValueRoll(100);
|
||||||
|
mSettings->setMixerValuePitch(100);
|
||||||
|
mSettings->setMixerValueYaw(100);
|
||||||
|
break;
|
||||||
case VehicleConfigurationSource::VEHICLE_HELI:
|
case VehicleConfigurationSource::VEHICLE_HELI:
|
||||||
case VehicleConfigurationSource::VEHICLE_SURFACE:
|
case VehicleConfigurationSource::VEHICLE_SURFACE:
|
||||||
// TODO: Implement mixer / sliders settings for other vehicle types?
|
// TODO: Implement mixer / sliders settings for other vehicle types?
|
||||||
@ -1790,7 +1794,7 @@ void VehicleConfigurationHelper::setupElevon()
|
|||||||
channels[0].pitch = -100;
|
channels[0].pitch = -100;
|
||||||
channels[0].yaw = 0;
|
channels[0].yaw = 0;
|
||||||
|
|
||||||
// Elevon Servo 1 (Chan 2)
|
// Elevon Servo 2 (Chan 2)
|
||||||
channels[1].type = MIXER_TYPE_SERVO;
|
channels[1].type = MIXER_TYPE_SERVO;
|
||||||
channels[1].throttle1 = 0;
|
channels[1].throttle1 = 0;
|
||||||
channels[1].throttle2 = 0;
|
channels[1].throttle2 = 0;
|
||||||
@ -1828,7 +1832,7 @@ void VehicleConfigurationHelper::setupDualAileron()
|
|||||||
channels[0].type = MIXER_TYPE_SERVO;
|
channels[0].type = MIXER_TYPE_SERVO;
|
||||||
channels[0].throttle1 = 0;
|
channels[0].throttle1 = 0;
|
||||||
channels[0].throttle2 = 0;
|
channels[0].throttle2 = 0;
|
||||||
channels[0].roll = -100;
|
channels[0].roll = 100;
|
||||||
channels[0].pitch = 0;
|
channels[0].pitch = 0;
|
||||||
channels[0].yaw = 0;
|
channels[0].yaw = 0;
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ public:
|
|||||||
bool setupVehicle(bool save = true);
|
bool setupVehicle(bool save = true);
|
||||||
bool setupHardwareSettings(bool save = true);
|
bool setupHardwareSettings(bool save = true);
|
||||||
static const qint16 LEGACY_ESC_FREQUENCY = 50;
|
static const qint16 LEGACY_ESC_FREQUENCY = 50;
|
||||||
static const qint16 RAPID_ESC_FREQUENCY = 500;
|
static const qint16 RAPID_ESC_FREQUENCY = 490;
|
||||||
static const qint16 ANALOG_SERVO_FREQUENCY = 50;
|
static const qint16 ANALOG_SERVO_FREQUENCY = 50;
|
||||||
static const qint16 DIGITAL_SERVO_FREQUENCY = 333;
|
static const qint16 DIGITAL_SERVO_FREQUENCY = 333;
|
||||||
static const int MIXER_TYPE_NONE = 0;
|
static const int MIXER_TYPE_NONE = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user