training guide fixups (#21485)

* training images

* wide training guide

* fixup some images

* cleanup

* one more

* release files
pull/21491/head
Adeeb Shihadeh 4 years ago committed by GitHub
parent 3a51a5c0f0
commit a334203f7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      release/files_tici
  2. 4
      selfdrive/assets/compress-images.sh
  3. BIN
      selfdrive/assets/training/step0.png
  4. BIN
      selfdrive/assets/training/step1.png
  5. BIN
      selfdrive/assets/training/step10.png
  6. BIN
      selfdrive/assets/training/step11.png
  7. BIN
      selfdrive/assets/training/step12.png
  8. BIN
      selfdrive/assets/training/step13.png
  9. BIN
      selfdrive/assets/training/step14.png
  10. BIN
      selfdrive/assets/training/step15.png
  11. BIN
      selfdrive/assets/training/step16.png
  12. BIN
      selfdrive/assets/training/step17.png
  13. BIN
      selfdrive/assets/training/step2.png
  14. BIN
      selfdrive/assets/training/step3.png
  15. BIN
      selfdrive/assets/training/step4.png
  16. BIN
      selfdrive/assets/training/step5.png
  17. BIN
      selfdrive/assets/training/step6.png
  18. BIN
      selfdrive/assets/training/step7.png
  19. BIN
      selfdrive/assets/training/step8.png
  20. BIN
      selfdrive/assets/training/step9.png
  21. BIN
      selfdrive/assets/training_wide/step0.png
  22. BIN
      selfdrive/assets/training_wide/step1.png
  23. BIN
      selfdrive/assets/training_wide/step10.png
  24. BIN
      selfdrive/assets/training_wide/step11.png
  25. BIN
      selfdrive/assets/training_wide/step12.png
  26. BIN
      selfdrive/assets/training_wide/step13.png
  27. BIN
      selfdrive/assets/training_wide/step14.png
  28. BIN
      selfdrive/assets/training_wide/step15.png
  29. BIN
      selfdrive/assets/training_wide/step16.png
  30. BIN
      selfdrive/assets/training_wide/step17.png
  31. BIN
      selfdrive/assets/training_wide/step2.png
  32. BIN
      selfdrive/assets/training_wide/step3.png
  33. BIN
      selfdrive/assets/training_wide/step4.png
  34. BIN
      selfdrive/assets/training_wide/step5.png
  35. BIN
      selfdrive/assets/training_wide/step6.png
  36. BIN
      selfdrive/assets/training_wide/step7.png
  37. BIN
      selfdrive/assets/training_wide/step8.png
  38. BIN
      selfdrive/assets/training_wide/step9.png
  39. 18
      selfdrive/ui/qt/offroad/onboarding.cc
  40. 71
      selfdrive/ui/qt/offroad/onboarding.h

@ -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

@ -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

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

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

Loading…
Cancel
Save