new training guide (#20495)

* new training guide

* fix end

* new step1

* better images

* update images
albatross
Adeeb Shihadeh 2021-03-26 16:43:14 -07:00 committed by GitHub
parent 85d0d521bd
commit fd15a21c5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
35 changed files with 27 additions and 56 deletions

BIN
selfdrive/assets/training/step0.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
selfdrive/assets/training/step1.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
selfdrive/assets/training/step10.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
selfdrive/assets/training/step11.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 KiB

BIN
selfdrive/assets/training/step12.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
selfdrive/assets/training/step13.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

BIN
selfdrive/assets/training/step14.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 708 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 MiB

BIN
selfdrive/assets/training/step2.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

BIN
selfdrive/assets/training/step3.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 KiB

BIN
selfdrive/assets/training/step4.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 524 KiB

BIN
selfdrive/assets/training/step5.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
selfdrive/assets/training/step6.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

BIN
selfdrive/assets/training/step7.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 718 KiB

BIN
selfdrive/assets/training/step8.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 645 KiB

BIN
selfdrive/assets/training/step9.jpg (Stored with Git LFS)

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 KiB

View File

@ -12,30 +12,28 @@
void TrainingGuide::mouseReleaseEvent(QMouseEvent *e) {
int leftOffset = (geometry().width()-1620)/2;
int mousex = e->x()-leftOffset;
int mousey = e->y();
//qDebug() << e->x() << ", " << e->y();
// Check for restart
if (currentIndex == (boundingBox.size() - 1) && 1050 <= mousex && mousex <= 1500 &&
773 <= mousey && mousey <= 954) {
if (currentIndex == (boundingBox.size() - 1) && 200 <= e->x() && e->x() <= 920 &&
760 <= e->y() && e->y() <= 960) {
currentIndex = 0;
} else if (boundingBox[currentIndex][0] <= mousex && mousex <= boundingBox[currentIndex][1] &&
boundingBox[currentIndex][2] <= mousey && mousey <= boundingBox[currentIndex][3]) {
} else if (boundingBox[currentIndex][0] <= e->x() && e->x() <= boundingBox[currentIndex][1] &&
boundingBox[currentIndex][2] <= e->y() && e->y() <= boundingBox[currentIndex][3]) {
currentIndex += 1;
}
if (currentIndex >= boundingBox.size()) {
emit completedTraining();
} else {
image.load("../assets/training/step" + QString::number(currentIndex) + ".jpg");
image.load("../assets/training/step" + QString::number(currentIndex) + ".png");
update();
}
}
void TrainingGuide::showEvent(QShowEvent *event) {
currentIndex = 0;
image.load("../assets/training/step0.jpg");
image.load("../assets/training/step0.png");
}
void TrainingGuide::paintEvent(QPaintEvent *event) {

View File

@ -26,8 +26,26 @@ private:
// Bounding boxes for the a given training guide step
// (minx, maxx, miny, maxy)
QVector<QVector<int>> boundingBox {{250, 930, 750, 900}, {280, 1280, 650, 950}, {330, 1130, 590, 900}, {910, 1580, 500, 1000}, {1180, 1300, 630, 720}, {290, 1050, 590, 960},
{1090, 1240, 550, 660}, {1050, 1580, 250, 900}, {320, 1130, 670, 1020}, {1010, 1580, 410, 750}, {1040, 1500, 230, 1030}, {300, 1190, 590, 920}, {1050, 1310, 170, 870}, {950, 1530, 460, 770}, {190, 970, 750, 970}};
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},
};
signals:
void completedTraining();