34 #include <actuatorsettings.h>
35 #include <attitudesettings.h>
36 #include <mixersettings.h>
37 #include <systemsettings.h>
38 #include <manualcontrolsettings.h>
39 #include <sensorsettings.h>
40 #include <stabilizationsettings.h>
47 const float VehicleConfigurationHelper::DEFAULT_ENABLED_ACCEL_TAU = 0.1;
50 : m_configSource(configSource)
51 , m_uavoManager(nullptr)
52 , m_transactionOK(false)
53 , m_transactionTimeout(false)
54 , m_currentTransactionObjectID(-1)
57 Q_ASSERT(m_configSource);
60 Q_ASSERT(m_uavoManager);
66 clearModifiedObjects();
69 if (!saveChangesToController(save)) {
74 applyHardwareConfiguration();
75 applyVehicleConfiguration();
76 applyActuatorConfiguration();
77 applyFlighModeConfiguration();
80 applySensorBiasConfiguration();
83 applyStabilizationConfiguration();
84 applyManualControlDefaults();
86 bool result = saveChangesToController(save);
87 emit
saveProgress(m_modifiedObjects.count() + 1, ++m_progress,
88 result ? tr(
"Done!") : tr(
"Failed!"));
95 clearModifiedObjects();
96 applyHardwareConfiguration();
97 applyManualControlDefaults();
99 bool result = saveChangesToController(save);
100 emit
saveProgress(m_modifiedObjects.count() + 1, ++m_progress,
101 result ? tr(
"Done!") : tr(
"Failed!"));
105 void VehicleConfigurationHelper::addModifiedObject(
UAVDataObject *
object, QString description)
107 m_modifiedObjects << new QPair<UAVDataObject *, QString>(object, description);
110 void VehicleConfigurationHelper::clearModifiedObjects()
112 for (
int i = 0;
i < m_modifiedObjects.count();
i++) {
113 QPair<UAVDataObject *, QString> *pair = m_modifiedObjects.at(
i);
116 m_modifiedObjects.clear();
125 void VehicleConfigurationHelper::applyHardwareConfiguration()
128 Q_ASSERT(boardPlugin);
138 Q_ASSERT(hwSettings);
140 addModifiedObject(hwSettings, tr(
"Writing hardware settings"));
144 void VehicleConfigurationHelper::applyVehicleConfiguration()
182 void VehicleConfigurationHelper::applyActuatorConfiguration()
184 ActuatorSettings *actSettings = ActuatorSettings::GetInstance(m_uavoManager);
187 Q_ASSERT(boardPlugin);
193 ActuatorSettings::DataFields
data = actSettings->getData();
196 data.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_FALSE;
198 for (quint16
i = 0;
i < ActuatorSettings::TIMERUPDATEFREQ_NUMELEM;
i++) {
235 data.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_TRUE;
241 data.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_TRUE;
248 data.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_TRUE;
257 data.MotorsSpinWhileArmed = ActuatorSettings::MOTORSSPINWHILEARMED_TRUE;
263 for (quint16
i = 0;
i < ActuatorSettings::CHANNELMAX_NUMELEM;
i++) {
264 if (
i < max_motors) {
265 data.ChannelMin[
i] = actuatorSettings[
i].channelMin;
266 data.ChannelNeutral[
i] = actuatorSettings[
i].channelNeutral;
267 data.ChannelMax[
i] = actuatorSettings[
i].channelMax;
273 data.TimerUpdateFreq[bankNum] = updateFrequency;
276 data.ChannelMin[
i] = 0;
277 data.ChannelNeutral[
i] = 0;
278 data.ChannelMax[
i] = 0;
282 actSettings->setData(data);
283 addModifiedObject(actSettings, tr(
"Writing actuator settings"));
296 void VehicleConfigurationHelper::applyFlighModeConfiguration()
298 ManualControlSettings *controlSettings = ManualControlSettings::GetInstance(m_uavoManager);
300 Q_ASSERT(controlSettings);
302 ManualControlSettings::DataFields data = controlSettings->getData();
303 data.Stabilization1Settings[0] = ManualControlSettings::STABILIZATION1SETTINGS_ATTITUDE;
304 data.Stabilization1Settings[1] = ManualControlSettings::STABILIZATION1SETTINGS_ATTITUDE;
305 data.Stabilization1Settings[2] = ManualControlSettings::STABILIZATION1SETTINGS_AXISLOCK;
306 data.Stabilization2Settings[0] = ManualControlSettings::STABILIZATION2SETTINGS_ATTITUDE;
307 data.Stabilization2Settings[1] = ManualControlSettings::STABILIZATION2SETTINGS_ATTITUDE;
308 data.Stabilization2Settings[2] = ManualControlSettings::STABILIZATION2SETTINGS_RATE;
309 data.Stabilization3Settings[0] = ManualControlSettings::STABILIZATION3SETTINGS_RATE;
310 data.Stabilization3Settings[1] = ManualControlSettings::STABILIZATION3SETTINGS_RATE;
311 data.Stabilization3Settings[2] = ManualControlSettings::STABILIZATION3SETTINGS_RATE;
312 data.FlightModeNumber = 3;
313 data.FlightModePosition[0] = ManualControlSettings::FLIGHTMODEPOSITION_LEVELING;
314 data.FlightModePosition[1] = ManualControlSettings::FLIGHTMODEPOSITION_ACRO;
315 data.FlightModePosition[2] = ManualControlSettings::FLIGHTMODEPOSITION_STABILIZED1;
316 data.FlightModePosition[3] = ManualControlSettings::FLIGHTMODEPOSITION_ALTITUDEHOLD;
317 data.FlightModePosition[4] = ManualControlSettings::FLIGHTMODEPOSITION_POSITIONHOLD;
318 data.FlightModePosition[5] = ManualControlSettings::FLIGHTMODEPOSITION_MANUAL;
319 controlSettings->setData(data);
320 addModifiedObject(controlSettings, tr(
"Writing flight mode settings"));
327 void VehicleConfigurationHelper::applySensorBiasConfiguration()
333 AttitudeSettings *attitudeSettings = AttitudeSettings::GetInstance(m_uavoManager);
334 Q_ASSERT(attitudeSettings);
335 if (attitudeSettings)
336 addModifiedObject(attitudeSettings, tr(
"Writing board rotation settings"));
338 SensorSettings *sensorSettings = SensorSettings::GetInstance(m_uavoManager);
339 Q_ASSERT(sensorSettings);
341 addModifiedObject(sensorSettings, tr(
"Writing gyro bias"));
344 void VehicleConfigurationHelper::applyStabilizationConfiguration()
346 StabilizationSettings *stabSettings = StabilizationSettings::GetInstance(m_uavoManager);
347 Q_ASSERT(stabSettings);
349 StabilizationSettings defaultSettings;
350 stabSettings->setData(defaultSettings.getData());
351 addModifiedObject(stabSettings, tr(
"Writing stabilization settings"));
357 MixerSettings *mSettings = MixerSettings::GetInstance(m_uavoManager);
362 QString mixerTypePattern =
"Mixer%1Type";
363 QString mixerVectorPattern =
"Mixer%1Vector";
364 for (
int i = 0;
i < 10;
i++) {
365 UAVObjectField *field = mSettings->getField(mixerTypePattern.arg(
i + 1));
369 field = mSettings->getField(mixerVectorPattern.arg(
i + 1));
371 field->
setValue((channels[
i].throttle1 * 128) / 100, 0);
372 field->
setValue((channels[
i].throttle2 * 128) / 100, 1);
373 field->
setValue((channels[
i].roll * 128) / 100, 2);
374 field->
setValue((channels[
i].pitch * 128) / 100, 3);
375 field->
setValue((channels[
i].yaw * 128) / 100, 4);
382 mSettings->setData(mSettings->getData());
383 addModifiedObject(mSettings, tr(
"Writing mixer settings"));
386 void VehicleConfigurationHelper::applyMultiGUISettings(SystemSettings::AirframeTypeOptions airframe,
389 SystemSettings *sSettings = SystemSettings::GetInstance(m_uavoManager);
392 SystemSettings::DataFields data = sSettings->getData();
393 data.AirframeType = airframe;
395 for (
int i = 0;
i < (int)(SystemSettings::AIRFRAMECATEGORYSPECIFICCONFIGURATION_NUMELEM);
i++) {
396 data.AirframeCategorySpecificConfiguration[
i] = guiConfig.
UAVObject[
i];
399 sSettings->setData(data);
400 addModifiedObject(sSettings, tr(
"Writing vehicle settings"));
403 void VehicleConfigurationHelper::applyManualControlDefaults()
405 ManualControlSettings *mcSettings = ManualControlSettings::GetInstance(m_uavoManager);
407 Q_ASSERT(mcSettings);
408 ManualControlSettings::DataFields cData = mcSettings->getData();
410 ManualControlSettings::ChannelGroupsOptions channelType =
411 ManualControlSettings::CHANNELGROUPS_PWM;
420 qint16 minVal = 1000;
421 qint16 maxVal = 2000;
425 channelType = ManualControlSettings::CHANNELGROUPS_PWM;
428 channelType = ManualControlSettings::CHANNELGROUPS_PPM;
434 channelType = ManualControlSettings::CHANNELGROUPS_SBUS;
441 channelType = ManualControlSettings::CHANNELGROUPS_DSM;
447 channelType = ManualControlSettings::CHANNELGROUPS_HOTTSUM;
451 channelType = ManualControlSettings::CHANNELGROUPS_IBUS;
456 channelType = ManualControlSettings::CHANNELGROUPS_TBSCROSSFIRE;
463 channelType = ManualControlSettings::CHANNELGROUPS_SRXL;
467 channelType = ManualControlSettings::CHANNELGROUPS_NONE;
473 qint16 neutralVal = minVal + (maxVal - minVal) / 2;
474 qint16 throttleNeutralVal =
static_cast<qint16
>(minVal + (maxVal - minVal) * 0.04);
476 for (
unsigned int i = 0;
i < ManualControlSettings::CHANNELGROUPS_NUMELEM;
i++) {
477 cData.ChannelGroups[
i] = channelType;
478 cData.ChannelNumber[
i] = 0;
479 cData.ChannelMin[
i] = minVal;
480 cData.ChannelMax[
i] = maxVal;
481 cData.ChannelNeutral[
i] = neutralVal;
484 cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_THROTTLE] = 1;
485 cData.ChannelNeutral[ManualControlSettings::CHANNELNEUTRAL_THROTTLE] = throttleNeutralVal;
486 cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_ROLL] = 2;
487 cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_YAW] = 3;
488 cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_PITCH] = 4;
489 cData.ChannelNumber[ManualControlSettings::CHANNELGROUPS_FLIGHTMODE] = 5;
491 mcSettings->setData(cData);
492 addModifiedObject(mcSettings, tr(
"Writing manual control defaults"));
495 bool VehicleConfigurationHelper::saveChangesToController(
bool save)
497 qDebug() <<
"Saving modified objects to controller. " << m_modifiedObjects.count()
498 <<
" objects in found.";
499 const int OUTER_TIMEOUT = 3000 * 20;
500 const int INNER_TIMEOUT = 2000;
507 QTimer outerTimeoutTimer;
508 outerTimeoutTimer.setSingleShot(
true);
510 QTimer innerTimeoutTimer;
511 innerTimeoutTimer.setSingleShot(
true);
514 QOverload<int, bool>::of(&VehicleConfigurationHelper::uavoTransactionCompleted));
515 connect(&innerTimeoutTimer, &QTimer::timeout, &m_eventLoop, &QEventLoop::quit);
516 connect(&outerTimeoutTimer, &QTimer::timeout,
this,
517 &VehicleConfigurationHelper::saveChangesTimeout);
519 outerTimeoutTimer.start(OUTER_TIMEOUT);
520 for (
int i = 0;
i < m_modifiedObjects.count();
i++) {
521 QPair<UAVDataObject *, QString> *objPair = m_modifiedObjects.at(
i);
522 m_transactionOK =
false;
524 QString objDescription = objPair->second;
527 emit
saveProgress(m_modifiedObjects.count() + 1, ++m_progress, objDescription);
529 m_currentTransactionObjectID = obj->
getObjID();
532 QOverload<UAVObject *, bool>::of(
533 &VehicleConfigurationHelper::uavoTransactionCompleted));
534 while (!m_transactionOK && !m_transactionTimeout) {
536 innerTimeoutTimer.start(INNER_TIMEOUT);
540 if (!m_transactionOK) {
543 innerTimeoutTimer.stop();
546 this, QOverload<UAVObject *, bool>::of(
547 &VehicleConfigurationHelper::uavoTransactionCompleted));
548 if (m_transactionOK) {
549 qDebug() <<
"Object " << obj->
getName() <<
" was successfully updated.";
551 m_transactionOK =
false;
552 m_currentTransactionObjectID = obj->
getObjID();
554 while (!m_transactionOK && !m_transactionTimeout) {
556 innerTimeoutTimer.start(INNER_TIMEOUT);
560 if (!m_transactionOK) {
563 innerTimeoutTimer.stop();
565 m_currentTransactionObjectID = -1;
569 if (!m_transactionOK) {
570 qDebug() <<
"Transaction timed out when trying to save: " << obj->
getName();
572 qDebug() <<
"Object " << obj->
getName() <<
" was successfully saved.";
576 <<
"Trying to save a UAVDataObject that is read only or is not a settings object.";
578 if (m_transactionTimeout) {
579 qDebug() <<
"Transaction timed out when trying to save " << m_modifiedObjects.count()
585 outerTimeoutTimer.stop();
586 disconnect(&outerTimeoutTimer, &QTimer::timeout,
this,
587 &VehicleConfigurationHelper::saveChangesTimeout);
588 disconnect(&innerTimeoutTimer, &QTimer::timeout, &m_eventLoop, &QEventLoop::quit);
590 QOverload<int, bool>::of(&VehicleConfigurationHelper::uavoTransactionCompleted));
592 qDebug() <<
"Finished saving modified objects to controller. Success = " << m_transactionOK;
594 return m_transactionOK;
597 void VehicleConfigurationHelper::uavoTransactionCompleted(
int oid,
bool success)
599 if (oid == m_currentTransactionObjectID) {
600 m_transactionOK = success;
605 void VehicleConfigurationHelper::uavoTransactionCompleted(
UAVObject *
object,
bool success)
608 uavoTransactionCompleted(object->
getObjID(), success);
612 void VehicleConfigurationHelper::saveChangesTimeout()
614 m_transactionOK =
false;
615 m_transactionTimeout =
true;
619 void VehicleConfigurationHelper::resetVehicleConfig()
622 MixerSettings *mSettings = MixerSettings::GetInstance(m_uavoManager);
633 QString mixerTypePattern =
"Mixer%1Type";
634 QString mixerVectorPattern =
"Mixer%1Vector";
635 for (
int i = 1;
i <= 10;
i++) {
640 field = mSettings->getField(mixerVectorPattern.arg(
i));
648 addModifiedObject(mSettings, tr(
"Preparing mixer settings"));
651 void VehicleConfigurationHelper::resetGUIData()
653 SystemSettings *sSettings = SystemSettings::GetInstance(m_uavoManager);
656 SystemSettings::DataFields data = sSettings->getData();
657 data.AirframeType = SystemSettings::AIRFRAMETYPE_CUSTOM;
658 for (quint32
i = 0;
i < SystemSettings::AIRFRAMECATEGORYSPECIFICCONFIGURATION_NUMELEM;
i++) {
659 data.AirframeCategorySpecificConfiguration[
i] = 0;
661 sSettings->setData(data);
662 addModifiedObject(sSettings, tr(
"Preparing vehicle settings"));
665 void VehicleConfigurationHelper::setupTriCopter()
675 channels[0].
type = MIXER_TYPE_MOTOR;
678 channels[0].
roll = 100;
679 channels[0].
pitch = 50;
682 channels[1].
type = MIXER_TYPE_MOTOR;
685 channels[1].
roll = -100;
686 channels[1].
pitch = 50;
689 channels[2].
type = MIXER_TYPE_MOTOR;
692 channels[2].
roll = 0;
693 channels[2].
pitch = -100;
696 channels[3].
type = MIXER_TYPE_SERVO;
699 channels[3].
roll = 0;
700 channels[3].
pitch = 0;
701 channels[3].
yaw = 100;
703 guiSettings.
multi.VTOLMotorNW = 1;
704 guiSettings.
multi.VTOLMotorNE = 2;
705 guiSettings.
multi.VTOLMotorS = 3;
706 guiSettings.
multi.TRIYaw = 4;
708 applyMixerConfiguration(channels);
709 applyMultiGUISettings(SystemSettings::AIRFRAMETYPE_TRI, guiSettings);
716 for (
int i = 0;
i < (int)(SystemSettings::AIRFRAMECATEGORYSPECIFICCONFIGURATION_NUMELEM);
i++) {
723 void VehicleConfigurationHelper::setupQuadCopter()
727 SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_QUADP;
731 frame = SystemSettings::AIRFRAMETYPE_QUADP;
732 channels[0].
type = MIXER_TYPE_MOTOR;
735 channels[0].
roll = 0;
736 channels[0].
pitch = 100;
737 channels[0].
yaw = -50;
739 channels[1].
type = MIXER_TYPE_MOTOR;
742 channels[1].
roll = -100;
743 channels[1].
pitch = 0;
744 channels[1].
yaw = 50;
746 channels[2].
type = MIXER_TYPE_MOTOR;
749 channels[2].
roll = 0;
750 channels[2].
pitch = -100;
751 channels[2].
yaw = -50;
753 channels[3].
type = MIXER_TYPE_MOTOR;
756 channels[3].
roll = 100;
757 channels[3].
pitch = 0;
758 channels[3].
yaw = 50;
760 guiSettings.
multi.VTOLMotorN = 1;
761 guiSettings.
multi.VTOLMotorE = 2;
762 guiSettings.
multi.VTOLMotorS = 3;
763 guiSettings.
multi.VTOLMotorW = 4;
768 frame = SystemSettings::AIRFRAMETYPE_QUADX;
769 channels[0].
type = MIXER_TYPE_MOTOR;
772 channels[0].
roll = 50;
773 channels[0].
pitch = 50;
774 channels[0].
yaw = -50;
776 channels[1].
type = MIXER_TYPE_MOTOR;
779 channels[1].
roll = -50;
780 channels[1].
pitch = 50;
781 channels[1].
yaw = 50;
783 channels[2].
type = MIXER_TYPE_MOTOR;
786 channels[2].
roll = -50;
787 channels[2].
pitch = -50;
788 channels[2].
yaw = -50;
790 channels[3].
type = MIXER_TYPE_MOTOR;
793 channels[3].
roll = 50;
794 channels[3].
pitch = -50;
795 channels[3].
yaw = 50;
797 guiSettings.
multi.VTOLMotorNW = 1;
798 guiSettings.
multi.VTOLMotorNE = 2;
799 guiSettings.
multi.VTOLMotorSE = 3;
800 guiSettings.
multi.VTOLMotorSW = 4;
807 applyMixerConfiguration(channels);
808 applyMultiGUISettings(frame, guiSettings);
811 void VehicleConfigurationHelper::setupHexaCopter()
815 SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_HEXA;
819 frame = SystemSettings::AIRFRAMETYPE_HEXA;
821 channels[0].
type = MIXER_TYPE_MOTOR;
824 channels[0].
roll = 0;
825 channels[0].
pitch = 33;
826 channels[0].
yaw = -33;
828 channels[1].
type = MIXER_TYPE_MOTOR;
831 channels[1].
roll = -50;
832 channels[1].
pitch = 33;
833 channels[1].
yaw = 33;
835 channels[2].
type = MIXER_TYPE_MOTOR;
838 channels[2].
roll = -50;
839 channels[2].
pitch = -33;
840 channels[2].
yaw = -33;
842 channels[3].
type = MIXER_TYPE_MOTOR;
845 channels[3].
roll = 0;
846 channels[3].
pitch = -33;
847 channels[3].
yaw = 33;
849 channels[4].
type = MIXER_TYPE_MOTOR;
852 channels[4].
roll = 50;
853 channels[4].
pitch = -33;
854 channels[4].
yaw = -33;
856 channels[5].
type = MIXER_TYPE_MOTOR;
859 channels[5].
roll = 50;
860 channels[5].
pitch = 33;
861 channels[5].
yaw = 33;
863 guiSettings.
multi.VTOLMotorN = 1;
864 guiSettings.
multi.VTOLMotorNE = 2;
865 guiSettings.
multi.VTOLMotorSE = 3;
866 guiSettings.
multi.VTOLMotorS = 4;
867 guiSettings.
multi.VTOLMotorSW = 5;
868 guiSettings.
multi.VTOLMotorNW = 6;
873 frame = SystemSettings::AIRFRAMETYPE_HEXACOAX;
875 channels[0].
type = MIXER_TYPE_MOTOR;
878 channels[0].
roll = 100;
879 channels[0].
pitch = 25;
880 channels[0].
yaw = -66;
882 channels[1].
type = MIXER_TYPE_MOTOR;
885 channels[1].
roll = 100;
886 channels[1].
pitch = 25;
887 channels[1].
yaw = 66;
889 channels[2].
type = MIXER_TYPE_MOTOR;
892 channels[2].
roll = -100;
893 channels[2].
pitch = 25;
894 channels[2].
yaw = -66;
896 channels[3].
type = MIXER_TYPE_MOTOR;
899 channels[3].
roll = -100;
900 channels[3].
pitch = 25;
901 channels[3].
yaw = 66;
903 channels[4].
type = MIXER_TYPE_MOTOR;
906 channels[4].
roll = 0;
907 channels[4].
pitch = -50;
908 channels[4].
yaw = -66;
910 channels[5].
type = MIXER_TYPE_MOTOR;
913 channels[5].
roll = 0;
914 channels[5].
pitch = -50;
915 channels[5].
yaw = 66;
917 guiSettings.
multi.VTOLMotorNW = 1;
918 guiSettings.
multi.VTOLMotorW = 2;
919 guiSettings.
multi.VTOLMotorNE = 3;
920 guiSettings.
multi.VTOLMotorE = 4;
921 guiSettings.
multi.VTOLMotorS = 5;
922 guiSettings.
multi.VTOLMotorSE = 6;
927 frame = SystemSettings::AIRFRAMETYPE_HEXAX;
929 channels[0].
type = MIXER_TYPE_MOTOR;
932 channels[0].
roll = -33;
933 channels[0].
pitch = 50;
934 channels[0].
yaw = -33;
936 channels[1].
type = MIXER_TYPE_MOTOR;
939 channels[1].
roll = -33;
940 channels[1].
pitch = 0;
941 channels[1].
yaw = 33;
943 channels[2].
type = MIXER_TYPE_MOTOR;
946 channels[2].
roll = -33;
947 channels[2].
pitch = -50;
948 channels[2].
yaw = -33;
950 channels[3].
type = MIXER_TYPE_MOTOR;
953 channels[3].
roll = -33;
954 channels[3].
pitch = -50;
955 channels[3].
yaw = 33;
957 channels[4].
type = MIXER_TYPE_MOTOR;
960 channels[4].
roll = 33;
961 channels[4].
pitch = 0;
962 channels[4].
yaw = -33;
964 channels[5].
type = MIXER_TYPE_MOTOR;
967 channels[5].
roll = 33;
968 channels[5].
pitch = 50;
969 channels[5].
yaw = -33;
971 guiSettings.
multi.VTOLMotorNE = 1;
972 guiSettings.
multi.VTOLMotorE = 2;
973 guiSettings.
multi.VTOLMotorSE = 3;
974 guiSettings.
multi.VTOLMotorSW = 4;
975 guiSettings.
multi.VTOLMotorW = 5;
976 guiSettings.
multi.VTOLMotorNW = 6;
983 applyMixerConfiguration(channels);
984 applyMultiGUISettings(frame, guiSettings);
987 void VehicleConfigurationHelper::setupOctoCopter()
991 SystemSettings::AirframeTypeOptions frame = SystemSettings::AIRFRAMETYPE_OCTO;
995 frame = SystemSettings::AIRFRAMETYPE_OCTO;
997 channels[0].
type = MIXER_TYPE_MOTOR;
1000 channels[0].
roll = 0;
1001 channels[0].
pitch = 33;
1002 channels[0].
yaw = -25;
1004 channels[1].
type = MIXER_TYPE_MOTOR;
1007 channels[1].
roll = -33;
1008 channels[1].
pitch = 33;
1009 channels[1].
yaw = 25;
1011 channels[2].
type = MIXER_TYPE_MOTOR;
1014 channels[2].
roll = -33;
1015 channels[2].
pitch = 0;
1016 channels[2].
yaw = -25;
1018 channels[3].
type = MIXER_TYPE_MOTOR;
1021 channels[3].
roll = -33;
1022 channels[3].
pitch = -33;
1023 channels[3].
yaw = 25;
1025 channels[4].
type = MIXER_TYPE_MOTOR;
1028 channels[4].
roll = 0;
1029 channels[4].
pitch = -33;
1030 channels[4].
yaw = -25;
1032 channels[5].
type = MIXER_TYPE_MOTOR;
1035 channels[5].
roll = 33;
1036 channels[5].
pitch = -33;
1037 channels[5].
yaw = 25;
1039 channels[6].
type = MIXER_TYPE_MOTOR;
1042 channels[6].
roll = 33;
1043 channels[6].
pitch = 0;
1044 channels[6].
yaw = -25;
1046 channels[7].
type = MIXER_TYPE_MOTOR;
1049 channels[7].
roll = 33;
1050 channels[7].
pitch = 33;
1051 channels[7].
yaw = 25;
1053 guiSettings.
multi.VTOLMotorN = 1;
1054 guiSettings.
multi.VTOLMotorNE = 2;
1055 guiSettings.
multi.VTOLMotorE = 3;
1056 guiSettings.
multi.VTOLMotorSE = 4;
1057 guiSettings.
multi.VTOLMotorS = 5;
1058 guiSettings.
multi.VTOLMotorSW = 6;
1059 guiSettings.
multi.VTOLMotorW = 7;
1060 guiSettings.
multi.VTOLMotorNW = 8;
1065 frame = SystemSettings::AIRFRAMETYPE_OCTOCOAXX;
1067 channels[0].
type = MIXER_TYPE_MOTOR;
1070 channels[0].
roll = 50;
1071 channels[0].
pitch = 50;
1072 channels[0].
yaw = -50;
1074 channels[1].
type = MIXER_TYPE_MOTOR;
1077 channels[1].
roll = 50;
1078 channels[1].
pitch = 50;
1079 channels[1].
yaw = 50;
1081 channels[2].
type = MIXER_TYPE_MOTOR;
1084 channels[2].
roll = -50;
1085 channels[2].
pitch = 50;
1086 channels[2].
yaw = -50;
1088 channels[3].
type = MIXER_TYPE_MOTOR;
1091 channels[3].
roll = -50;
1092 channels[3].
pitch = 50;
1093 channels[3].
yaw = 50;
1095 channels[4].
type = MIXER_TYPE_MOTOR;
1098 channels[4].
roll = -50;
1099 channels[4].
pitch = -50;
1100 channels[4].
yaw = -50;
1102 channels[5].
type = MIXER_TYPE_MOTOR;
1105 channels[5].
roll = -50;
1106 channels[5].
pitch = -50;
1107 channels[5].
yaw = 50;
1109 channels[6].
type = MIXER_TYPE_MOTOR;
1112 channels[6].
roll = 50;
1113 channels[6].
pitch = -50;
1114 channels[6].
yaw = -50;
1116 channels[7].
type = MIXER_TYPE_MOTOR;
1119 channels[7].
roll = 50;
1120 channels[7].
pitch = -50;
1121 channels[7].
yaw = 50;
1123 guiSettings.
multi.VTOLMotorNW = 1;
1124 guiSettings.
multi.VTOLMotorN = 2;
1125 guiSettings.
multi.VTOLMotorNE = 3;
1126 guiSettings.
multi.VTOLMotorE = 4;
1127 guiSettings.
multi.VTOLMotorSE = 5;
1128 guiSettings.
multi.VTOLMotorS = 6;
1129 guiSettings.
multi.VTOLMotorSW = 7;
1130 guiSettings.
multi.VTOLMotorW = 8;
1135 frame = SystemSettings::AIRFRAMETYPE_OCTOCOAXP;
1137 channels[0].
type = MIXER_TYPE_MOTOR;
1140 channels[0].
roll = 0;
1141 channels[0].
pitch = 100;
1142 channels[0].
yaw = -50;
1144 channels[1].
type = MIXER_TYPE_MOTOR;
1147 channels[1].
roll = 0;
1148 channels[1].
pitch = 100;
1149 channels[1].
yaw = 50;
1151 channels[2].
type = MIXER_TYPE_MOTOR;
1154 channels[2].
roll = -100;
1155 channels[2].
pitch = 0;
1156 channels[2].
yaw = -50;
1158 channels[3].
type = MIXER_TYPE_MOTOR;
1161 channels[3].
roll = -100;
1162 channels[3].
pitch = 0;
1163 channels[3].
yaw = 50;
1165 channels[4].
type = MIXER_TYPE_MOTOR;
1168 channels[4].
roll = 0;
1169 channels[4].
pitch = -100;
1170 channels[4].
yaw = -50;
1172 channels[5].
type = MIXER_TYPE_MOTOR;
1175 channels[5].
roll = 0;
1176 channels[5].
pitch = -100;
1177 channels[5].
yaw = 50;
1179 channels[6].
type = MIXER_TYPE_MOTOR;
1182 channels[6].
roll = 100;
1183 channels[6].
pitch = 0;
1184 channels[6].
yaw = -50;
1186 channels[7].
type = MIXER_TYPE_MOTOR;
1189 channels[7].
roll = 100;
1190 channels[7].
pitch = 0;
1191 channels[7].
yaw = 50;
1193 guiSettings.
multi.VTOLMotorN = 1;
1194 guiSettings.
multi.VTOLMotorNE = 2;
1195 guiSettings.
multi.VTOLMotorE = 3;
1196 guiSettings.
multi.VTOLMotorSE = 4;
1197 guiSettings.
multi.VTOLMotorS = 5;
1198 guiSettings.
multi.VTOLMotorSW = 6;
1199 guiSettings.
multi.VTOLMotorW = 7;
1200 guiSettings.
multi.VTOLMotorNW = 8;
1205 frame = SystemSettings::AIRFRAMETYPE_OCTOV;
1206 channels[0].
type = MIXER_TYPE_MOTOR;
1209 channels[0].
roll = -25;
1210 channels[0].
pitch = 8;
1211 channels[0].
yaw = -25;
1213 channels[1].
type = MIXER_TYPE_MOTOR;
1216 channels[1].
roll = -25;
1217 channels[1].
pitch = 25;
1218 channels[1].
yaw = 25;
1220 channels[2].
type = MIXER_TYPE_MOTOR;
1223 channels[2].
roll = -25;
1224 channels[2].
pitch = -25;
1225 channels[2].
yaw = -25;
1227 channels[3].
type = MIXER_TYPE_MOTOR;
1230 channels[3].
roll = -25;
1231 channels[3].
pitch = -8;
1232 channels[3].
yaw = 25;
1234 channels[4].
type = MIXER_TYPE_MOTOR;
1237 channels[4].
roll = 25;
1238 channels[4].
pitch = -8;
1239 channels[4].
yaw = -25;
1241 channels[5].
type = MIXER_TYPE_MOTOR;
1244 channels[5].
roll = 25;
1245 channels[5].
pitch = -25;
1246 channels[5].
yaw = 25;
1248 channels[6].
type = MIXER_TYPE_MOTOR;
1251 channels[6].
roll = 25;
1252 channels[6].
pitch = 25;
1253 channels[6].
yaw = -25;
1255 channels[7].
type = MIXER_TYPE_MOTOR;
1258 channels[7].
roll = 25;
1259 channels[7].
pitch = 8;
1260 channels[7].
yaw = 25;
1262 guiSettings.
multi.VTOLMotorN = 1;
1263 guiSettings.
multi.VTOLMotorNE = 2;
1264 guiSettings.
multi.VTOLMotorE = 3;
1265 guiSettings.
multi.VTOLMotorSE = 4;
1266 guiSettings.
multi.VTOLMotorS = 5;
1267 guiSettings.
multi.VTOLMotorSW = 6;
1268 guiSettings.
multi.VTOLMotorW = 7;
1269 guiSettings.
multi.VTOLMotorNW = 8;
1277 applyMixerConfiguration(channels);
1278 applyMultiGUISettings(frame, guiSettings);
virtual Core::IBoardType::InputType getInputType() const =0
VehicleConfigurationHelper(VehicleConfigurationSource *configSource)
virtual QList< actuatorChannelSettings > getActuatorSettings() const =0
bool setupVehicle(bool save=true)
InputType
Types of input to configure for the default port.
Core plugin system that manages the plugins, their life cycle and their registered objects...
int getBankFromOutputChannel(int channel)
virtual VehicleConfigurationSource::VEHICLE_TYPE getVehicleType() const =0
int getNumElements() const
QStringList getOptions() const
void saveObjectToFlash(UAVObject *obj)
UAVObjectUtilManager::saveObjectToSD Add a new object to save in the queue.
void setValue(const QVariant &data, int index=0)
void transactionCompleted(UAVObject *obj, bool success)
transactionCompleted. Triggered by a call to emitTransactionCompleted - done in telemetry.cpp whenever a transaction finishes.
virtual QString getHwUAVO()=0
virtual VehicleConfigurationSource::VEHICLE_SUB_TYPE getVehicleSubType() const =0
virtual VehicleConfigurationSource::ESC_TYPE getESCType() const =0
multiGUISettingsStruct multi
virtual bool setInputType(InputType)
Configure the board to use an receiver input type on a port number.
void saveProgress(int total, int current, QString description)
void saveCompleted(int objectID, bool status)
virtual Core::IBoardType * getControllerType() const =0
bool setupHardwareSettings(bool save=true)
UAVObject * getObject(const QString &name, quint32 instId=0)
save(matfile $(SAVEOBJECTSCODE))
static AccessMode GetGcsAccess(const Metadata &meta)