Browse Source

Fixed minor bugs, fixed object detection issues

QGC4.4
lm 15 years ago
parent
commit
083ae630ac
  1. 6
      qgroundcontrol.pri
  2. 4
      src/ui/ObjectDetectionView.cc
  3. 60
      src/ui/RadioCalibration/RadioCalibrationWindow.cc
  4. 2
      src/ui/RadioCalibration/RadioCalibrationWindow.h

6
qgroundcontrol.pri

@ -209,7 +209,8 @@ linux-g++ { @@ -209,7 +209,8 @@ linux-g++ {
QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/patterns $$DESTDIR/images
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.
@ -278,7 +279,8 @@ linux-g++-64 { @@ -278,7 +279,8 @@ linux-g++-64 {
QMAKE_POST_LINK += && cp -rf $$BASEDIR/models $$DESTDIR
QMAKE_POST_LINK += && cp -rf $$BASEDIR/data $$DESTDIR
QMAKE_POST_LINK += && mkdir -p $$DESTDIR/images
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
QMAKE_POST_LINK += && cp -f $$BASEDIR/images/Vera.ttf $$DESTDIR/images/Vera.ttf
QMAKE_POST_LINK += && cp -rf $$BASEDIR/images/patterns $$DESTDIR/images
# osg/osgEarth dynamic casts might fail without this compiler option.
# see http://osgearth.org/wiki/FAQ for details.

4
src/ui/ObjectDetectionView.cc

@ -40,8 +40,6 @@ This file is part of the PIXHAWK project @@ -40,8 +40,6 @@ This file is part of the PIXHAWK project
#include <QDebug>
#include <QMap>
#include "MG.h"
ObjectDetectionView::ObjectDetectionView(QString folder, QWidget *parent) :
QWidget(parent),
patternList(),
@ -117,7 +115,7 @@ void ObjectDetectionView::newPattern(int uasId, QString patternPath, float confi @@ -117,7 +115,7 @@ void ObjectDetectionView::newPattern(int uasId, QString patternPath, float confi
m_ui->listWidget->addItem(pattern.name + separator + "(" + QString::number(pattern.count) + ")" + separator + QString::number(pattern.confidence));
// load image
QString filePath = MG::DIR::getSupportFilesDirectory() + "/" + patternFolder + "/" + patternPath.split("/", QString::SkipEmptyParts).last();
QString filePath = patternFolder + "/" + patternPath.split("/", QString::SkipEmptyParts).last();
QPixmap image = QPixmap(filePath);
if (image.width() > image.height())
image = image.scaledToWidth(m_ui->imageLabel->width());

60
src/ui/RadioCalibration/RadioCalibrationWindow.cc

@ -52,6 +52,66 @@ RadioCalibrationWindow::RadioCalibrationWindow(QWidget *parent) : @@ -52,6 +52,66 @@ RadioCalibrationWindow::RadioCalibrationWindow(QWidget *parent) :
setUASId(0);
}
void RadioCalibrationWindow::setChannelRaw(int ch, float raw)
{
/** this expects a particular channel to function mapping
\todo allow run-time channel mapping
*/
switch (ch)
{
case 0:
aileron->channelChanged(raw);
break;
case 1:
elevator->channelChanged(raw);
break;
case 2:
throttle->channelChanged(raw);
break;
case 3:
rudder->channelChanged(raw);
break;
case 4:
gyro->channelChanged(raw);
break;
case 5:
pitch->channelChanged(raw);
break;
}
}
void RadioCalibrationWindow::setChannelScaled(int ch, float normalized)
{
// /** this expects a particular channel to function mapping
// \todo allow run-time channel mapping
// */
// switch (ch)
// {
// case 0:
// aileron->channelChanged(raw);
// break;
// case 1:
// elevator->channelChanged(raw);
// break;
// case 2:
// throttle->channelChanged(raw);
// break;
// case 3:
// rudder->channelChanged(raw);
// break;
// case 4:
// gyro->channelChanged(raw);
// break;
// case 5:
// pitch->channelChanged(raw);
// break;
// }
}
void RadioCalibrationWindow::setChannel(int ch, float raw, float normalized)
{
/** this expects a particular channel to function mapping

2
src/ui/RadioCalibration/RadioCalibrationWindow.h

@ -67,6 +67,8 @@ public: @@ -67,6 +67,8 @@ public:
public slots:
void setChannel(int ch, float raw, float normalized);
void setChannelRaw(int ch, float raw);
void setChannelScaled(int ch, float normalized);
void loadFile();
void saveFile();
void send();

Loading…
Cancel
Save