Commit 1d79eb00 authored by Lorenz Meier's avatar Lorenz Meier

Checkpoint: RC calibration much better / operation, can use UI tweaks....

Checkpoint: RC calibration much better / operation, can use UI tweaks. Airframe config in, but not operational and still very functional / ugly.
parent fb7d8413
......@@ -58,4 +58,16 @@ QGC_TOOL_WIDGET_ITEMS\5\QGC_COMMAND_BUTTON_PARAM4=1
QGC_TOOL_WIDGET_ITEMS\5\QGC_COMMAND_BUTTON_PARAM5=0
QGC_TOOL_WIDGET_ITEMS\5\QGC_COMMAND_BUTTON_PARAM6=0
QGC_TOOL_WIDGET_ITEMS\5\QGC_COMMAND_BUTTON_PARAM7=0
QGC_TOOL_WIDGET_ITEMS\size=5
QGC_TOOL_WIDGET_ITEMS\6\TYPE=COMMANDBUTTON
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_DESCRIPTION=Reboot to Bootloader
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_BUTTONTEXT=BOOTLOADER
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_COMMANDID=246
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_PARAMS_VISIBLE=false
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_PARAM1=3
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_PARAM2=0
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_PARAM3=0
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_PARAM4=0
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_PARAM5=0
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_PARAM6=0
QGC_TOOL_WIDGET_ITEMS\6\QGC_COMMAND_BUTTON_PARAM7=0
QGC_TOOL_WIDGET_ITEMS\size=7
This diff is collapsed.
......@@ -6,9 +6,11 @@
#include <QList>
#include <QGroupBox>
#include <QPushButton>
#include <QStringList>
#include "QGCToolWidget.h"
#include "UASInterface.h"
#include "px4_configuration/QGCPX4AirframeConfig.h"
class UASParameterCommsMgr;
......@@ -37,6 +39,8 @@ public slots:
void sensorMenuButtonClicked();
void generalMenuButtonClicked();
void advancedMenuButtonClicked();
void airframeMenuButtonClicked();
void identifyChannelMapping(int aert_index);
/** Set the MAV currently being calibrated */
void setActiveUAS(UASInterface* active);
......@@ -136,6 +140,46 @@ public slots:
rcRev[rcMapping[7]] = inverted;
}
/** Identify roll */
void identifyRollChannel() {
identifyChannelMapping(0);
}
/** Identify pitch */
void identifyPitchChannel() {
identifyChannelMapping(1);
}
/** Identify yaw */
void identifyYawChannel() {
identifyChannelMapping(2);
}
/** Identify throttle */
void identifyThrottleChannel() {
identifyChannelMapping(3);
}
/** Identify mode */
void identifyModeChannel() {
identifyChannelMapping(4);
}
/** Identify sub mode */
void identifySubModeChannel() {
identifyChannelMapping(5);
}
/** Identify aux 1 */
void identifyAux1Channel() {
identifyChannelMapping(6);
}
/** Identify aux 2 */
void identifyAux2Channel() {
identifyChannelMapping(7);
}
protected slots:
void menuButtonClicked();
/** Reset the RC calibration */
......@@ -174,6 +218,12 @@ protected:
float rcScaling[chanMax]; ///< Scaling of channel input to control commands
bool rcRev[chanMax]; ///< Channel reverse
int rcValue[chanMax]; ///< Last values
float rcMappedMin[chanMax]; ///< Mapped channels in default order
float rcMappedMax[chanMax]; ///< Mapped channels in default order
float rcMappedValue[chanMax]; ///< Mapped channels in default order
int channelWanted; ///< During channel assignment search the requested default index
float channelWantedList[chanMax]; ///< During channel assignment search the start values
QStringList channelNames; ///< List of channel names in standard order
float rcRoll; ///< PPM input channel used as roll control input
float rcPitch; ///< PPM input channel used as pitch control input
float rcYaw; ///< PPM input channel used as yaw control input
......@@ -197,6 +247,8 @@ protected:
QMap<QGCToolWidget*,QGroupBox*> toolToBoxMap; ///< Easy method of figuring out which QGroupBox is tied to which ToolWidget.
QMap<QString,QString> paramTooltips; ///< Tooltips for the ? button next to a parameter.
QGCPX4AirframeConfig* px4AirframeConfig;
private:
Ui::QGCPX4VehicleConfig *ui;
QMap<QPushButton*,QWidget*> buttonToWidgetMap;
......
This diff is collapsed.
......@@ -116,15 +116,17 @@ void UASControlWidget::updateModesList()
void UASControlWidget::setUAS(UASInterface* uas)
{
if (this->uasID) {
if (this->uasID > 0) {
UASInterface* oldUAS = UASManager::instance()->getUASForId(this->uasID);
disconnect(ui.controlButton, SIGNAL(clicked()), oldUAS, SLOT(armSystem()));
disconnect(ui.liftoffButton, SIGNAL(clicked()), oldUAS, SLOT(launch()));
disconnect(ui.landButton, SIGNAL(clicked()), oldUAS, SLOT(home()));
disconnect(ui.shutdownButton, SIGNAL(clicked()), oldUAS, SLOT(shutdown()));
//connect(ui.setHomeButton, SIGNAL(clicked()), uas, SLOT(setLocalOriginAtCurrentGPSPosition()));
disconnect(uas, SIGNAL(modeChanged(int,QString,QString)), this, SLOT(updateMode(int, QString, QString)));
disconnect(uas, SIGNAL(statusChanged(int)), this, SLOT(updateState(int)));
if (oldUAS) {
disconnect(ui.controlButton, SIGNAL(clicked()), oldUAS, SLOT(armSystem()));
disconnect(ui.liftoffButton, SIGNAL(clicked()), oldUAS, SLOT(launch()));
disconnect(ui.landButton, SIGNAL(clicked()), oldUAS, SLOT(home()));
disconnect(ui.shutdownButton, SIGNAL(clicked()), oldUAS, SLOT(shutdown()));
//connect(ui.setHomeButton, SIGNAL(clicked()), uas, SLOT(setLocalOriginAtCurrentGPSPosition()));
disconnect(oldUAS, SIGNAL(modeChanged(int,QString,QString)), this, SLOT(updateMode(int, QString, QString)));
disconnect(oldUAS, SIGNAL(statusChanged(int)), this, SLOT(updateState(int)));
}
}
// Connect user interface controls
......@@ -141,11 +143,13 @@ void UASControlWidget::setUAS(UASInterface* uas)
this->uasID = uas->getUASID();
setBackgroundColor(uas->getColor());
this->updateModesList();
this->updateArmText();
} else {
this->uasID = -1;
}
this->updateModesList();
this->updateArmText();
}
UASControlWidget::~UASControlWidget()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment