From 62e3d35a97bf0ccb346d3de476a04f9a1a0f4cd7 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Fri, 29 Apr 2011 17:57:04 -0500 Subject: [PATCH 1/3] OP-452 Read the channel times even if a bad mixer is configured --- flight/Modules/ManualControl/manualcontrol.c | 23 ++++++++++---------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/flight/Modules/ManualControl/manualcontrol.c b/flight/Modules/ManualControl/manualcontrol.c index 214e3e084..7fc7f3984 100644 --- a/flight/Modules/ManualControl/manualcontrol.c +++ b/flight/Modules/ManualControl/manualcontrol.c @@ -199,17 +199,6 @@ static void manualControlTask(void *parameters) if (!ManualControlCommandReadOnly(&cmd)) { - // Check settings, if error raise alarm - if (settings.Roll >= MANUALCONTROLSETTINGS_ROLL_NONE || - settings.Pitch >= MANUALCONTROLSETTINGS_PITCH_NONE || - settings.Yaw >= MANUALCONTROLSETTINGS_YAW_NONE || - settings.Throttle >= MANUALCONTROLSETTINGS_THROTTLE_NONE || - settings.FlightMode >= MANUALCONTROLSETTINGS_FLIGHTMODE_NONE) { - AlarmsSet(SYSTEMALARMS_ALARM_MANUALCONTROL, SYSTEMALARMS_ALARM_CRITICAL); - cmd.Connected = MANUALCONTROLCOMMAND_CONNECTED_FALSE; - ManualControlCommandSet(&cmd); - continue; - } // Read channel values in us // TODO: settings.InputMode is currently ignored because PIOS will not allow runtime // selection of PWM and PPM. The configuration is currently done at compile time in @@ -225,6 +214,18 @@ static void manualControlTask(void *parameters) scaledChannel[n] = scaleChannel(cmd.Channel[n], settings.ChannelMax[n], settings.ChannelMin[n], settings.ChannelNeutral[n], 0); } + // Check settings, if error raise alarm + if (settings.Roll >= MANUALCONTROLSETTINGS_ROLL_NONE || + settings.Pitch >= MANUALCONTROLSETTINGS_PITCH_NONE || + settings.Yaw >= MANUALCONTROLSETTINGS_YAW_NONE || + settings.Throttle >= MANUALCONTROLSETTINGS_THROTTLE_NONE || + settings.FlightMode >= MANUALCONTROLSETTINGS_FLIGHTMODE_NONE) { + AlarmsSet(SYSTEMALARMS_ALARM_MANUALCONTROL, SYSTEMALARMS_ALARM_CRITICAL); + cmd.Connected = MANUALCONTROLCOMMAND_CONNECTED_FALSE; + ManualControlCommandSet(&cmd); + continue; + } + // Scale channels to -1 -> +1 range cmd.Roll = scaledChannel[settings.Roll]; cmd.Pitch = scaledChannel[settings.Pitch]; From 5ef47a1253d64b9369cb063cf5b122f82f860f27 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Fri, 29 Apr 2011 18:00:20 -0500 Subject: [PATCH 2/3] OP-449: Changed message in input configuration to correctly describe situation where channels not mapped so receiver is not detected --- ground/openpilotgcs/src/plugins/config/configinputwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp index 297937b91..5b79254e2 100644 --- a/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configinputwidget.cpp @@ -575,9 +575,9 @@ void ConfigInputWidget::updateChannels(UAVObject* controlCommand) QString fieldName = QString("Connected"); UAVObjectField *field = controlCommand->getField(fieldName); if (field->getValue().toBool()) - m_config->RCInputConnected->setText("RC Receiver Connected"); + m_config->RCInputConnected->setText("RC Receiver connected"); else - m_config->RCInputConnected->setText("RC Receiver Not Connected"); + m_config->RCInputConnected->setText("RC Receiver not connected or invalid input configuration (missing channels)"); if (m_config->doRCInputCalibration->isChecked()) { if (firstUpdate) { From 46ea18f54be6fcbfae1cfb0428b3e76e8ebaa7e0 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sat, 30 Apr 2011 12:49:43 -0500 Subject: [PATCH 3/3] OP-449: Just UI layout to make longer message fit --- .../openpilotgcs/src/plugins/config/input.ui | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/input.ui b/ground/openpilotgcs/src/plugins/config/input.ui index 97368a199..422260fa5 100644 --- a/ground/openpilotgcs/src/plugins/config/input.ui +++ b/ground/openpilotgcs/src/plugins/config/input.ui @@ -17,7 +17,7 @@ - 1 + 0 @@ -919,10 +919,10 @@ Neutral should be put at the bottom of the slider for the throttle. - 250 - 10 - 311 - 20 + 270 + 0 + 251 + 41 @@ -936,7 +936,10 @@ Neutral should be put at the bottom of the slider for the throttle. Indicates whether OpenPilot is getting a signal from the RC receiver. - RC Receiver Not Connected + RC Receiver not connected or invalid input configuration (missing channels) + + + true @@ -976,17 +979,16 @@ Neutral should be put at the bottom of the slider for the throttle. 20 310 - 531 - 41 + 561 + 21 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> <html><head><meta name="qrichtext" content="1" /><style type="text/css"> p, li { white-space: pre-wrap; } -</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; color:#ff0000;">BEWARE: make sure your engines are not connected</span></p> -<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600; color:#ff0000;">when running calibration!</span></p></body></html> +</style></head><body style=" font-family:'Lucida Grande'; font-size:13pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Ubuntu'; font-size:11pt; font-weight:600; color:#ff0000;">BEWARE: make sure your engines are not connected when running calibration!</span></p></body></html>