training guide fixups (#21485)

* training images

* wide training guide

* fixup some images

* cleanup

* one more

* release files
This commit is contained in:
Adeeb Shihadeh
2021-07-05 01:31:31 -07:00
committed by GitHub
parent 3a51a5c0f0
commit a334203f7b
40 changed files with 62 additions and 34 deletions
+3
View File
@@ -1,5 +1,8 @@
installer/continue_openpilot.sh
selfdrive/assets/navigation/*
selfdrive/assets/training_wide/*
selfdrive/camerad/cameras/camera_qcom2.cc
selfdrive/camerad/cameras/camera_qcom2.h
selfdrive/camerad/cameras/real_debayer.cl
+4
View File
@@ -0,0 +1,4 @@
#!/bin/bash
echo "compressing training guide images"
optipng -o7 -strip all training/* training_wide/*
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 743 KiB

After

Width:  |  Height:  |  Size: 743 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 708 KiB

After

Width:  |  Height:  |  Size: 708 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 MiB

After

Width:  |  Height:  |  Size: 1.9 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 556 KiB

After

Width:  |  Height:  |  Size: 556 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 524 KiB

After

Width:  |  Height:  |  Size: 524 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 MiB

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 718 KiB

After

Width:  |  Height:  |  Size: 718 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 645 KiB

After

Width:  |  Height:  |  Size: 644 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 688 KiB

After

Width:  |  Height:  |  Size: 688 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 949 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 640 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 794 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 900 KiB

+6 -12
View File
@@ -10,28 +10,23 @@
#include "selfdrive/ui/qt/widgets/input.h"
void TrainingGuide::mouseReleaseEvent(QMouseEvent *e) {
QPoint touch = QPoint(e->x(), e->y()) - imageCorner;
// Check for restart
if (currentIndex == (boundingBox.size() - 1) && 200 <= touch.x() && touch.x() <= 920 &&
760 <= touch.y() && touch.y() <= 960) {
currentIndex = 0;
} else if (boundingBox[currentIndex][0] <= touch.x() && touch.x() <= boundingBox[currentIndex][1] &&
boundingBox[currentIndex][2] <= touch.y() && touch.y() <= boundingBox[currentIndex][3]) {
if (boundingRect[currentIndex].contains(e->x(), e->y())) {
currentIndex += 1;
} else if (currentIndex == (boundingRect.size() - 2) && boundingRect.last().contains(e->x(), e->y())) {
currentIndex = 0;
}
if (currentIndex >= boundingBox.size()) {
if (currentIndex >= (boundingRect.size() - 1)) {
emit completedTraining();
} else {
image.load("../assets/training/step" + QString::number(currentIndex) + ".png");
image.load(IMG_PATH + "step" + QString::number(currentIndex) + ".png");
update();
}
}
void TrainingGuide::showEvent(QShowEvent *event) {
currentIndex = 0;
image.load("../assets/training/step0.png");
image.load(IMG_PATH + "step0.png");
}
void TrainingGuide::paintEvent(QPaintEvent *event) {
@@ -44,7 +39,6 @@ void TrainingGuide::paintEvent(QPaintEvent *event) {
QRect rect(image.rect());
rect.moveCenter(bg.center());
painter.drawImage(rect.topLeft(), image);
imageCorner = rect.topLeft();
}
void TermsPage::showEvent(QShowEvent *event) {
+49 -22
View File
@@ -7,6 +7,7 @@
#include <QWidget>
#include "selfdrive/common/params.h"
#include "selfdrive/ui/qt/qt_window.h"
class TrainingGuide : public QFrame {
Q_OBJECT
@@ -20,32 +21,58 @@ private:
void mouseReleaseEvent(QMouseEvent* e) override;
QImage image;
QPoint imageCorner;
int currentIndex = 0;
// Bounding boxes for the a given training guide step
// (minx, maxx, miny, maxy)
QVector<QVector<int>> boundingBox {
{650, 1375, 700, 900},
{1600, 1920, 0, 1080},
{1600, 1920, 0, 1080},
{1240, 1750, 480, 1080},
{1570, 1780, 620, 750},
{1600, 1920, 0, 1080},
{1630, 1740, 620, 780},
{1200, 1920, 0, 1080},
{1455, 1850, 400, 660},
{1460, 1800, 195, 520},
{1600, 1920, 0, 1080},
{1350, 1920, 65, 1080},
{1600, 1920, 0, 1080},
{1570, 1900, 130, 1000},
{1350, 1770, 500, 700},
{1600, 1920, 0, 1080},
{1600, 1920, 0, 1080},
{1000, 1800, 760, 954},
// Bounding boxes for each training guide step
const QRect continueBtnStandard = {1610, 0, 310, 1080};
QVector<QRect> boundingRectStandard {
QRect(650, 710, 720, 190),
continueBtnStandard,
continueBtnStandard,
QRect(1470, 515, 235, 565),
QRect(1580, 630, 215, 130),
continueBtnStandard,
QRect(1580, 630, 215, 130),
QRect(1210, 0, 485, 590),
QRect(1460, 400, 375, 210),
QRect(1460, 210, 300, 310),
continueBtnStandard,
QRect(1375, 80, 545, 1000),
continueBtnStandard,
QRect(1610, 130, 280, 800),
QRect(1385, 485, 400, 270),
continueBtnStandard,
continueBtnStandard,
QRect(1036, 769, 718, 189),
QRect(201, 769, 718, 189),
};
const QRect continueBtnWide = {1850, 0, 310, 1080};
QVector<QRect> boundingRectWide {
QRect(654, 721, 718, 189),
continueBtnWide,
continueBtnWide,
QRect(1589, 530, 345, 555),
QRect(1660, 630, 195, 125),
continueBtnWide,
QRect(1820, 630, 180, 155),
QRect(1360, 0, 460, 620),
QRect(1570, 400, 375, 215),
QRect(1610, 210, 295, 310),
continueBtnWide,
QRect(1555, 90, 610, 990),
continueBtnWide,
QRect(1600, 140, 280, 790),
QRect(1385, 490, 750, 270),
continueBtnWide,
continueBtnWide,
QRect(1138, 755, 718, 189),
QRect(303, 755, 718, 189),
};
const QString IMG_PATH = vwp_w == 2160 ? "../assets/training_wide/" : "../assets/training/";
const QVector<QRect> boundingRect = vwp_w == 2160 ? boundingRectWide : boundingRectStandard;
signals:
void completedTraining();
};