1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Fix channel indexes to use servoCenterSlider

Set channelNeutral = 1500 where appropriate for each model type.
Add the missing actuator save for fixed wing!   actSettings->setData(data);
This commit is contained in:
Kevin Finisterre 2014-05-25 15:20:04 -04:00
parent a99de5d326
commit 4d250ff856
2 changed files with 24 additions and 23 deletions

View File

@ -139,47 +139,46 @@ void OutputCalibrationPage::setupVehicle()
break;
case SetupWizard::FIXED_WING_AILERON:
loadSVGFile(FIXEDWING_SVG_FILE);
m_wizardIndexes << 0 << 1 << 2 << 3 << 4 << 2 << 3 << 4 << 2 << 3 << 4 << 2 << 3 << 4;
m_wizardIndexes << 0 << 1 << 2 << 2 << 2 << 2; //2 for servoCenterSlider!
m_vehicleElementIds << "aileron" << "aileron-frame" << "aileron-motor" << "aileron-ail-left" << "aileron-ail-right" << "aileron-rudder" << "aileron-elevator";
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 2 << 2 << 3 << 3 << 3 << 4 << 4 << 4 << 5 << 5 << 5;
m_channelIndex << 0 << 0 << 1 << 1 << 1 << 2 << 2 << 2 << 3 << 3 << 3 << 4 << 4 << 4;
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3 << 4 << 5;
m_channelIndex << 0 << 0 << 1 << 2 << 3 << 4;
// see Servo city for an example. 1500 usec is center on MS85mg for example.
// - http://www.servocity.com/html/hs-85mg__mighty_micro.html
// make sure Aileron servo one does not go to an extreme value
m_actuatorSettings[1].channelMin = 1500;
// would also be nice to make these all default to 50hz so we don't shred servos.
m_actuatorSettings[1].channelNeutral = 1500;
m_actuatorSettings[1].channelMax = 1500;
// make sure Aileron servo two does not go to an extreme value
m_actuatorSettings[2].channelMin = 1500;
m_actuatorSettings[2].channelNeutral = 1500;
m_actuatorSettings[2].channelMax = 1500;
// make sure Elevator servo one does not go to an extreme value
m_actuatorSettings[3].channelMin = 1500;
m_actuatorSettings[4].channelNeutral = 1500;
m_actuatorSettings[3].channelMax = 1500;
m_actuatorSettings[3].channelNeutral = 1500;
// make sure Rudder servo one does not go to an extreme value
m_actuatorSettings[4].channelMin = 1500;
m_actuatorSettings[4].channelNeutral = 1500;
m_actuatorSettings[4].channelMax = 1500;
m_actuatorSettings[4].channelNeutral = 1500;
m_actuatorSettings[5].channelNeutral = 1500;
m_actuatorSettings[6].channelNeutral = 1500;
m_actuatorSettings[7].channelNeutral = 1500;
getWizard()->setActuatorSettings(m_actuatorSettings);
break;
case SetupWizard::FIXED_WING_VTAIL:
loadSVGFile(FIXEDWING_SVG_FILE);
m_wizardIndexes << 0 << 1 << 2 << 3 << 4 << 2 << 3 << 4;
m_wizardIndexes << 0 << 1 << 2 << 2; //2 for servoCenterSlider!
m_vehicleElementIds << "v-tail" << "v-tail-frame" << "v-tail-motor" << "v-tail-elevon-left" << "v-tail-elevon-right";
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 2 << 2 << 3 << 3 << 3;
m_channelIndex << 0 << 0 << 1 << 1 << 1 << 2 << 2 << 2;
m_vehicleHighlightElementIndexes << 0 << 1 << 2 << 3;
m_channelIndex << 0 << 0 << 1 << 2;
// make sure elevon servo one does not go to an extreme value
m_actuatorSettings[1].channelMin = 1500;
m_actuatorSettings[1].channelNeutral = 1500;
m_actuatorSettings[1].channelMax = 1500;
// make sure elevon servo two does not go to an extreme value
m_actuatorSettings[2].channelMin = 1500;
m_actuatorSettings[2].channelNeutral = 1500;
m_actuatorSettings[2].channelMax = 1500;
m_actuatorSettings[3].channelNeutral = 1500;
m_actuatorSettings[4].channelNeutral = 1500;
m_actuatorSettings[5].channelNeutral = 1500;
m_actuatorSettings[6].channelNeutral = 1500;
m_actuatorSettings[7].channelNeutral = 1500;
getWizard()->setActuatorSettings(m_actuatorSettings);
break;

View File

@ -306,7 +306,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
addModifiedObject(actSettings, tr("Writing actuator settings"));
break;
}
/*
case VehicleConfigurationSource::VEHICLE_FIXEDWING:
{
ActuatorSettings::DataFields data = actSettings->getData();
@ -317,12 +317,14 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
for (quint16 i = 1; i < ActuatorSettings::CHANNELMAX_NUMELEM; i++) {
data.ChannelType[i] = ActuatorSettings::CHANNELTYPE_PWM;
data.ChannelAddr[i] = i;
data.ChannelMin[i] = 1500;
data.ChannelNeutral[i] = 1500;
data.ChannelMax[i] = 1500;
}
qDebug() << "Save Fixed Wing Actuator Data\n";
actSettings->setData(data);
addModifiedObject(actSettings, tr("Writing actuator settings"));
break;
}
*/
case VehicleConfigurationSource::VEHICLE_HELI:
case VehicleConfigurationSource::VEHICLE_SURFACE:
// TODO: Implement settings for other vehicle types?