training guide fixups (#21485)

* training images

* wide training guide

* fixup some images

* cleanup

* one more

* release files
old-commit-hash: a334203f7b656a10085e5d4b808a0787b57ce3d1
This commit is contained in:
Adeeb Shihadeh
2021-07-05 01:31:31 -07:00
committed by GitHub
parent ff4c816abd
commit be6b9b024c
40 changed files with 152 additions and 70 deletions

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

View File

@@ -0,0 +1,4 @@
#!/bin/bash
echo "compressing training guide images"
optipng -o7 -strip all training/* training_wide/*

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a43db34dab4c2f529c43c3f072ea28a3b7c05989151845035f320181d152ee4d
size 1617839
oid sha256:c24db0012c082884c618d7332651a88113a00a3f44afd154d13713f08af928c6
size 1617789

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a1cbb6cdc922e0ac1627f2ef8cd555d43558054b67bf5ad5481726d7bc63a644
size 47671
oid sha256:24874c842bbf30660c05c93800ab08f020a4293ef97f7fb6e51a6904eaa5715c
size 47621

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4668a60cf8a810d04412730d77703148d632a9634e5dbc3931e67869edb19991
size 50707
oid sha256:c97fb0820008bb0f3ea80ef681757b55598c1384c3c6090df1cb83fb91265d27
size 50657

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:75e6105ba9a4cab7e403a7b69ec6f7dcaf4c3ba9b89f00a42c6b7d871d70d0f5
size 761149
oid sha256:3d5596e11f53c584843921b29e0cd7c411aa202c58f467c3dd979f21297a6cac
size 761099

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4a912f9bfc189af20b3ff06eb4ab29d60e0670409f6fa3c01aaf0f20386fa590
size 33840
oid sha256:bdb7807f5629df4c0cdf1ded1502b1f596909a1d14b063542d8830dcfba36a06
size 33790

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e5b3f1e292b211f062a8dd556cb067e9674af439938230ce3199081d7f67fa4e
size 1169995
oid sha256:18f7b3b96b93822e754394fbdf6e954541c59f280f537d01ae209e13ed888a92
size 1169945

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a985bed14a45c66cc5e4301471e8d250de2394b780bdd1effa17d63575afff6c
size 724946
oid sha256:2b2c91a5666373abbd0ea4ec8b5b51afd6268373aeda70d8a630a1e10d870a36
size 724896

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:74c839c01695eb33a5bab34b3d979136d922ce0ce829d82cbc029ce231b97f9b
size 33355
oid sha256:edd2958e14528ab0cd52741e2b61b9b0abccb9767cddeba8e671f5c0ab670006
size 33305

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:2ac7d714a352b6d4664622c35a6d34d669eaa344b7cdf991e51592425b3b1d58
size 40061
oid sha256:8d5562b93bb57b5a41b936c3b44ee5834b55fe19b85b573ee2262b38621c8441
size 40011

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b034c0a336e713cba54f312dd1817815f19a7983abfe2b67a29914e7e18d4db6
size 1968469
oid sha256:ee44da66ce480857bd5a36a4683789484a335401057fe97e335799e2c261ed2c
size 1968419

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:af9942d842bce44d504a646d13071c189c212a79f8c408cb56f48a02422fb557
size 34188
oid sha256:36f9a273af4646b2b51d79ff083f03af41872617a216293a114b533ad917f026
size 34138

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7f7010ad364f32df28adb5e138c503ee34392a53ed82eed13a183edabf127160
size 569757
oid sha256:867c7e415ed7ff6288f3af19662547fbf444c1f6d25eb7c539270ed987118b9f
size 569707

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:786ad8a8ea098f35c31d3b521d1a196e89c04f0deb99959f1a5dd8e46f8e21e4
size 536899
oid sha256:fd4148e044e0e320d45214506c49199e097921cfdfda1e2b11f8fd9c7baa1bf7
size 536849

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:34fe0494fba5cb9426341794a0615b1cd33a3fb9ec777093900a9fbee3611e47
size 39582
oid sha256:ee07a82ba9766e5c0e3256124bb5cfe0cffc2ada9a500dd22e027d40cff33222
size 39532

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:365823c1c76e3d2825820ac08b7ffde59444362fff2cb1262352fde63e614a93
size 1054999
oid sha256:22bba0fecad9dc2df0c28804dd27e60ab0e8c9e1e42b4a5e928728a1e0c5f522
size 1054949

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:90cfe2fd3a2a6b759f4e5e683d6326ad1d1bcc10026597f74af5e63e351a6c18
size 735245
oid sha256:28440a1293cc9e5dfb2eb99df004183be16399db4e96a04d5373636e6438b441
size 735195

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:090c308a382241ba0457049eab32fb169e1624b5581b188975b9b94306e06efc
size 660937
oid sha256:ca0302e2b6e0cf2f8cfa5bfd14a83785fde67017f473afbf8dd2d15ede230bfe
size 659088

View File

@@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6797a3b3d6d7ed36b045b1cd96847be886e0be5c5483f8ac9e13dc937a3aa8fa
size 705045
oid sha256:e2751fe746546cc3d41e1d7748e6bf7755db3659b3cc0a96145ceda05bda8d1c
size 704995

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:196ded436dc6621b2ff8825815a95c8036a24dbdd10898aa658c5a5771ad8612
size 1834599

Binary file not shown.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:aa0ba77bc02a429e9cf667ebaea04c2bfa5322a44f63b7b0ef3a7fa4e3e218e6
size 52021

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:82bd192a1720db5a5ff7c353716c5f3e092950eed75122b8713d408f208a34af
size 41274

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:369a055d1f58a5cb62e50480131268736f146760bfc6e3927e6ce101ec5865fc
size 633250

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:27812ef9262bcec683ec944bb8f3572df1a5dd6e39029664f38db346946e169c
size 655842

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7ac9d90bb4734486df228756d95fef53e0fdc7e0714e3f3cd8cea67dbc44b238
size 760792

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:b28bf8e69f28379a84f0d7de18c98d626fad3d064acabe7f8ce35157e0edfa16
size 922120

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) {

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();
};