Skip to content

Commit d5f9caa

Browse files
author
Vehicle Researcher
committed
openpilot v0.6.3 release
1 parent 6a61788 commit d5f9caa

File tree

95 files changed

+1901
-797
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+1901
-797
lines changed

Dockerfile.openpilot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ RUN cd /tmp && pipenv install --deploy --system
3939

4040
ENV PYTHONPATH /tmp/openpilot:$PYTHONPATH
4141

42-
RUN git clone --branch v0.6 https://github.com/commaai/openpilot-tools.git /tmp/openpilot/tools
42+
RUN git clone --branch v0.6.2 https://github.com/commaai/openpilot-tools.git /tmp/openpilot/tools
4343
RUN pip install -r /tmp/openpilot/tools/requirements.txt
44-
RUN pip install fastcluster==1.1.20 scipy==0.19.1
44+
RUN pip install fastcluster==1.1.20 scipy==0.19.1 dictdiffer==0.8.0 azure-batch==4.1.3 azure-common==1.1.16 azure-nspkg==3.0.0 azure-storage-blob==1.3.1 azure-storage-common==1.3.0 azure-storage-nspkg==3.0.0
4545

4646
COPY ./.pylintrc /tmp/openpilot/.pylintrc
4747
COPY ./common /tmp/openpilot/common

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Supported Cars
7272
| GMC<sup>3</sup> | Acadia Denali 2018 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>7</sup>|
7373
| Holden<sup>3</sup> | Astra 2017 | Adaptive Cruise | Yes | Yes | 0mph | 7mph | Custom<sup>7</sup>|
7474
| Honda | Accord 2018-19 | All | Yes | Stock | 0mph | 3mph | Bosch |
75+
| Honda | Accord Hybrid 2018-19 | All | Yes | Stock | 0mph | 3mph | Bosch |
7576
| Honda | Civic Sedan/Coupe 2016-18| Honda Sensing | Yes | Yes | 0mph | 12mph | Nidec |
7677
| Honda | Civic Sedan/Coupe 2019 | Honda Sensing | Yes | Stock | 0mph | 2mph | Bosch |
7778
| Honda | Civic Hatchback 2017-19 | Honda Sensing | Yes | Stock | 0mph | 12mph | Bosch |
@@ -98,18 +99,21 @@ Supported Cars
9899
| Toyota | Avalon 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
99100
| Toyota | Avalon 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
100101
| Toyota | Camry 2018-19 | All | Yes | Stock | 0mph<sup>5</sup> | 0mph | Toyota |
102+
| Toyota | Camry Hybrid 2018-19 | All | Yes | Stock | 0mph<sup>5</sup> | 0mph | Toyota |
101103
| Toyota | C-HR 2017-19 | All | Yes | Stock | 0mph | 0mph | Toyota |
104+
| Toyota | C-HR Hybrid 2017-19 | All | Yes | Stock | 0mph | 0mph | Toyota |
102105
| Toyota | Corolla 2017-19 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
103106
| Toyota | Corolla 2020 | All | Yes | Yes | 0mph | 0mph | Toyota |
104107
| Toyota | Corolla Hatchback 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
105108
| Toyota | Highlander 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
106-
| Toyota | Highlander Hybrid 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
109+
| Toyota | Highlander Hybrid 2017-19| All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
107110
| Toyota | Prius 2016 | TSS-P | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
108111
| Toyota | Prius 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
109112
| Toyota | Prius Prime 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
110113
| Toyota | Rav4 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
111114
| Toyota | Rav4 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
112115
| Toyota | Rav4 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
116+
| Toyota | Rav4 Hybrid 2016 | TSS-P | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
113117
| Toyota | Rav4 Hybrid 2017-18 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
114118
| Toyota | Sienna 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
115119

RELEASES.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Version 0.6.3 (2019-08-12)
2+
========================
3+
* Alert sounds from EON: requires NEOS update
4+
* Improve driver monitoring: eye tracking and improved awareness logic
5+
* Improve path prediction with new driving model
6+
* Improve lane positioning with wide lanes and exits
7+
* Improve lateral control on RAV4
8+
* Slow down for turns using model
9+
* Open sourced regression test to verify outputs against reference logs
10+
* Open sourced regression test to sanity check all car models
11+
112
Version 0.6.2 (2019-07-29)
213
========================
314
* New driving model!

apk/ai.comma.plus.offroad.apk

53.3 KB
Binary file not shown.

common/api/__init__.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1+
import jwt
12
import requests
3+
from datetime import datetime, timedelta
24

35
from selfdrive.version import version
46

7+
class Api(object):
8+
def __init__(self, dongle_id, private_key):
9+
self.dongle_id = dongle_id
10+
self.private_key = private_key
11+
12+
def get(self, *args, **kwargs):
13+
return self.request('GET', *args, **kwargs)
14+
15+
def post(self, *args, **kwargs):
16+
return self.request('POST', *args, **kwargs)
17+
18+
def request(self, method, endpoint, timeout=None, access_token=None, **params):
19+
return api_get(endpoint, method=method, timeout=timeout, access_token=access_token, **params)
20+
21+
def get_token(self):
22+
return jwt.encode({'identity': self.dongle_id, 'exp': datetime.utcnow() + timedelta(hours=1)}, self.private_key, algorithm='RS256')
23+
524
def api_get(endpoint, method='GET', timeout=None, access_token=None, **params):
625
backend = "https://api.commadotai.com/"
726

installer/updater/Makefile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ FRAMEBUFFER_LIBS = -lutils -lgui -lEGL
3131
.PHONY: all
3232
all: updater
3333

34-
OBJS = courbd.ttf.o \
34+
OBJS = opensans_regular.ttf.o \
35+
opensans_semibold.ttf.o \
36+
opensans_bold.ttf.o \
3537
../../selfdrive/common/touch.o \
3638
../../selfdrive/common/framebuffer.o \
3739
$(PHONELIBS)/json11/json11.o \
@@ -50,7 +52,15 @@ updater: updater.o $(OBJS)
5052
-lcutils -lm -llog
5153
strip updater
5254

53-
courbd.ttf.o: ../../selfdrive/assets/courbd.ttf
55+
opensans_regular.ttf.o: ../../selfdrive/assets/fonts/opensans_regular.ttf
56+
@echo "[ bin2o ] $@"
57+
cd '$(dir $<)' && ld -r -b binary '$(notdir $<)' -o '$(abspath $@)'
58+
59+
opensans_bold.ttf.o: ../../selfdrive/assets/fonts/opensans_bold.ttf
60+
@echo "[ bin2o ] $@"
61+
cd '$(dir $<)' && ld -r -b binary '$(notdir $<)' -o '$(abspath $@)'
62+
63+
opensans_semibold.ttf.o: ../../selfdrive/assets/fonts/opensans_semibold.ttf
5464
@echo "[ bin2o ] $@"
5565
cd '$(dir $<)' && ld -r -b binary '$(notdir $<)' -o '$(abspath $@)'
5666

installer/updater/update.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-c992abb59cbaf6588f51055db52db619061107851773fc8480acb8bb5d77a28f.zip",
3-
"ota_hash": "c992abb59cbaf6588f51055db52db619061107851773fc8480acb8bb5d77a28f",
4-
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-af099a84cfd7b91266090779238ac358278948dcde2dcfa0fbca6e8397366f0a.img",
2+
"ota_url": "https://commadist.azureedge.net/neosupdate/ota-signed-4db25072191d24e204a816d73ac9e8c727822a26ed3baf01ecae18167fa2eb11.zip",
3+
"ota_hash": "4db25072191d24e204a816d73ac9e8c727822a26ed3baf01ecae18167fa2eb11",
4+
"recovery_url": "https://commadist.azureedge.net/neosupdate/recovery-31ef14206d3102edf18fb7417ef32ba2d9f37dd2f4443e234c374a70d1bf4662.img",
55
"recovery_len": 15136044,
6-
"recovery_hash": "af099a84cfd7b91266090779238ac358278948dcde2dcfa0fbca6e8397366f0a"
6+
"recovery_hash": "31ef14206d3102edf18fb7417ef32ba2d9f37dd2f4443e234c374a70d1bf4662"
77
}

installer/updater/updater

-36.3 KB
Binary file not shown.

installer/updater/updater.cc

Lines changed: 73 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ const char *manifest_url = MANIFEST_URL_EON;
4343

4444
#define UPDATE_DIR "/data/neoupdate"
4545

46-
extern const uint8_t bin_courbd[] asm("_binary_courbd_ttf_start");
47-
extern const uint8_t bin_courbd_end[] asm("_binary_courbd_ttf_end");
46+
extern const uint8_t bin_opensans_regular[] asm("_binary_opensans_regular_ttf_start");
47+
extern const uint8_t bin_opensans_regular_end[] asm("_binary_opensans_regular_ttf_end");
48+
extern const uint8_t bin_opensans_semibold[] asm("_binary_opensans_semibold_ttf_start");
49+
extern const uint8_t bin_opensans_semibold_end[] asm("_binary_opensans_semibold_ttf_end");
50+
extern const uint8_t bin_opensans_bold[] asm("_binary_opensans_bold_ttf_start");
51+
extern const uint8_t bin_opensans_bold_end[] asm("_binary_opensans_bold_ttf_end");
4852

4953
namespace {
5054

@@ -148,7 +152,9 @@ struct Updater {
148152

149153
FramebufferState *fb = NULL;
150154
NVGcontext *vg = NULL;
151-
int font;
155+
int font_regular;
156+
int font_semibold;
157+
int font_bold;
152158

153159
std::thread update_thread_handle;
154160

@@ -182,14 +188,21 @@ struct Updater {
182188

183189
vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
184190
assert(vg);
185-
font = nvgCreateFontMem(vg, "courbd", (unsigned char*)bin_courbd, (bin_courbd_end - bin_courbd), 0);
186-
assert(font >= 0);
187191

188-
b_w = 600;
192+
font_regular = nvgCreateFontMem(vg, "opensans_regular", (unsigned char*)bin_opensans_regular, (bin_opensans_regular_end - bin_opensans_regular), 0);
193+
assert(font_regular >= 0);
194+
195+
font_semibold = nvgCreateFontMem(vg, "opensans_semibold", (unsigned char*)bin_opensans_semibold, (bin_opensans_semibold_end - bin_opensans_semibold), 0);
196+
assert(font_semibold >= 0);
197+
198+
font_bold = nvgCreateFontMem(vg, "opensans_bold", (unsigned char*)bin_opensans_bold, (bin_opensans_bold_end - bin_opensans_bold), 0);
199+
assert(font_bold >= 0);
200+
201+
b_w = 640;
189202
balt_x = 200;
190203
b_x = fb_w-b_w-200;
191-
b_y = 700;
192-
b_h = 250;
204+
b_y = 720;
205+
b_h = 220;
193206

194207
state = CONFIRMATION;
195208

@@ -286,14 +299,14 @@ struct Updater {
286299
std::string stage_download(std::string url, std::string hash, std::string name) {
287300
std::string out_fn = UPDATE_DIR "/" + util::base_name(url);
288301

289-
set_progress("downloading " + name + "...");
302+
set_progress("Downloading " + name + "...");
290303
bool r = download_file(url, out_fn);
291304
if (!r) {
292305
set_error("failed to download " + name);
293306
return "";
294307
}
295308

296-
set_progress("verifying " + name + "...");
309+
set_progress("Verifying " + name + "...");
297310
std::string fn_hash = sha256_file(out_fn);
298311
printf("got %s hash: %s\n", name.c_str(), hash.c_str());
299312
if (fn_hash != hash) {
@@ -323,7 +336,7 @@ struct Updater {
323336

324337
const int EON = (access("/EON", F_OK) != -1);
325338

326-
set_progress("finding latest version...");
339+
set_progress("Finding latest version...");
327340
std::string manifest_s;
328341
if (EON) {
329342
manifest_s = download_string(curl, manifest_url);
@@ -364,10 +377,10 @@ struct Updater {
364377

365378
std::string recovery_fn;
366379
if (recovery_url.empty() || recovery_hash.empty() || recovery_len == 0) {
367-
set_progress("skipping recovery flash...");
380+
set_progress("Skipping recovery flash...");
368381
} else {
369382
// only download the recovery if it differs from what's flashed
370-
set_progress("checking recovery...");
383+
set_progress("Checking recovery...");
371384
std::string existing_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
372385
printf("existing recovery hash: %s\n", existing_recovery_hash.c_str());
373386

@@ -393,7 +406,7 @@ struct Updater {
393406

394407
if (!recovery_fn.empty()) {
395408
// flash recovery
396-
set_progress("flashing recovery...");
409+
set_progress("Flashing recovery...");
397410

398411
FILE *flash_file = fopen(recovery_fn.c_str(), "rb");
399412
if (!flash_file) {
@@ -427,7 +440,7 @@ struct Updater {
427440
fclose(recovery_dev);
428441
fclose(flash_file);
429442

430-
set_progress("verifying flash...");
443+
set_progress("Verifying flash...");
431444
std::string new_recovery_hash = sha256_file(RECOVERY_DEV, recovery_len);
432445
printf("new recovery hash: %s\n", new_recovery_hash.c_str());
433446

@@ -447,7 +460,7 @@ struct Updater {
447460
fprintf(cmd_file, "--update_package=%s\n", ota_fn.c_str());
448461
fclose(cmd_file);
449462

450-
set_progress("rebooting");
463+
set_progress("Rebooting");
451464

452465
// remove the continue.sh so we come back into the setup.
453466
// maybe we should go directly into the installer, but what if we don't come back with internet? :/
@@ -462,25 +475,32 @@ struct Updater {
462475
// set_error("failed to reboot into recovery");
463476
}
464477

465-
void draw_ack_screen(const char *message, const char *button, const char *altbutton) {
466-
nvgFontSize(vg, 96.0f);
478+
void draw_ack_screen(const char *title, const char *message, const char *button, const char *altbutton) {
467479
nvgFillColor(vg, nvgRGBA(255,255,255,255));
468-
nvgTextAlign(vg, NVG_ALIGN_LEFT | NVG_ALIGN_BASELINE);
469-
nvgTextBox(vg, 50, 100, fb_w-100, message, NULL);
480+
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
481+
482+
nvgFontFace(vg, "opensans_bold");
483+
nvgFontSize(vg, 120.0f);
484+
nvgTextBox(vg, 110, 220, fb_w-240, title, NULL);
485+
486+
nvgFontFace(vg, "opensans_regular");
487+
nvgFontSize(vg, 86.0f);
488+
nvgTextBox(vg, 130, 380, fb_w-260, message, NULL);
470489

471490
// draw button
472491
if (button) {
473492
nvgBeginPath(vg);
474-
nvgFillColor(vg, nvgRGBA(0, 0, 0, 255));
493+
nvgFillColor(vg, nvgRGBA(8, 8, 8, 255));
475494
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
476495
nvgFill(vg);
477496

478497
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
498+
nvgFontFace(vg, "opensans_semibold");
479499
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
480500
nvgText(vg, b_x+b_w/2, b_y+b_h/2, button, NULL);
481501

482502
nvgBeginPath(vg);
483-
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 255));
503+
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 50));
484504
nvgStrokeWidth(vg, 5);
485505
nvgRoundedRect(vg, b_x, b_y, b_w, b_h, 20);
486506
nvgStroke(vg);
@@ -489,16 +509,17 @@ struct Updater {
489509
// draw button
490510
if (altbutton) {
491511
nvgBeginPath(vg);
492-
nvgFillColor(vg, nvgRGBA(0, 0, 0, 255));
512+
nvgFillColor(vg, nvgRGBA(8, 8, 8, 255));
493513
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
494514
nvgFill(vg);
495515

496516
nvgFillColor(vg, nvgRGBA(255, 255, 255, 255));
517+
nvgFontFace(vg, "opensans_semibold");
497518
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_MIDDLE);
498519
nvgText(vg, balt_x+b_w/2, b_y+b_h/2, altbutton, NULL);
499520

500521
nvgBeginPath(vg);
501-
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 255));
522+
nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 50));
502523
nvgStrokeWidth(vg, 5);
503524
nvgRoundedRect(vg, balt_x, b_y, b_w, b_h, 20);
504525
nvgStroke(vg);
@@ -510,23 +531,27 @@ struct Updater {
510531
nvgFontSize(vg, 64.0f);
511532
nvgFillColor(vg, nvgRGBA(255,255,255,255));
512533
nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE);
513-
nvgTextBox(vg, 0, 700, fb_w, progress_text.c_str(), NULL);
534+
nvgFontFace(vg, "opensans_bold");
535+
nvgFontSize(vg, 86.0f);
536+
nvgTextBox(vg, 0, 380, fb_w, progress_text.c_str(), NULL);
514537

515538
// draw progress bar
516539
{
517-
int progress_width = 800;
540+
int progress_width = 1000;
518541
int progress_x = fb_w/2-progress_width/2;
519-
int progress_y = 768;
520-
int progress_height = 15;
542+
int progress_y = 520;
543+
int progress_height = 50;
521544

522-
int powerprompt_y = 512;
523-
nvgText(vg, fb_w/2, powerprompt_y, "Ensure EON is connected to power", NULL);
545+
int powerprompt_y = 312;
546+
nvgFontFace(vg, "opensans_regular");
547+
nvgFontSize(vg, 64.0f);
548+
nvgText(vg, fb_w/2, 740, "Ensure EON is connected to power.", NULL);
524549

525550
NVGpaint paint = nvgBoxGradient(
526551
vg, progress_x + 1, progress_y + 1,
527-
progress_width - 2, progress_height, 3, 4, nvgRGB(0, 32, 0), nvgRGB(0, 92, 0));
552+
progress_width - 2, progress_height, 3, 4, nvgRGB(27, 27, 27), nvgRGB(27, 27, 27));
528553
nvgBeginPath(vg);
529-
nvgRoundedRect(vg, progress_x, progress_y, progress_width, progress_height, 3);
554+
nvgRoundedRect(vg, progress_x, progress_y, progress_width, progress_height, 12);
530555
nvgFillPaint(vg, paint);
531556
nvgFill(vg);
532557

@@ -536,12 +561,12 @@ struct Updater {
536561
paint = nvgBoxGradient(
537562
vg, progress_x, progress_y,
538563
bar_pos+1.5f, progress_height-1, 3, 4,
539-
nvgRGB(220, 100, 0), nvgRGB(128, 100, 0));
564+
nvgRGB(245, 245, 245), nvgRGB(105, 105, 105));
540565

541566
nvgBeginPath(vg);
542567
nvgRoundedRect(
543568
vg, progress_x+1, progress_y+1,
544-
bar_pos, progress_height-2, 3);
569+
bar_pos, progress_height-2, 12);
545570
nvgFillPaint(vg, paint);
546571
nvgFill(vg);
547572
}
@@ -554,16 +579,16 @@ struct Updater {
554579

555580
switch (state) {
556581
case CONFIRMATION:
557-
draw_ack_screen("An upgrade to NEOS is required.\n\n"
558-
"Your device will now be reset and upgraded. You may want to connect to wifi as download is around 1 GB\nData on device shouldn't be lost.",
559-
"continue",
560-
"wifi");
582+
draw_ack_screen("An update to NEOS is required.",
583+
"Your device will now be reset and upgraded. You may want to connect to wifi as download is around 1 GB. Existing data on device should not be lost.",
584+
"Continue",
585+
"Connect to WiFi");
561586
break;
562587
case RUNNING:
563588
draw_progress_screen();
564589
break;
565590
case ERROR:
566-
draw_ack_screen(("ERROR: " + error_text + "\n\nYou will need to retry").c_str(), NULL, "exit");
591+
draw_ack_screen("There was an error.", ("ERROR: " + error_text + "\n\nYou will need to retry").c_str(), NULL, "exit");
567592
break;
568593
}
569594

@@ -604,9 +629,17 @@ struct Updater {
604629
while (!do_exit) {
605630
ui_update();
606631

607-
glClearColor(0.19, 0.09, 0.2, 1.0);
632+
glClearColor(0.08, 0.08, 0.08, 1.0);
608633
glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
609634

635+
// background
636+
nvgBeginPath(vg);
637+
NVGpaint bg = nvgLinearGradient(vg, fb_w, 0, fb_w, fb_h,
638+
nvgRGBA(0, 0, 0, 0), nvgRGBA(0, 0, 0, 255));
639+
nvgFillPaint(vg, bg);
640+
nvgRect(vg, 0, 0, fb_w, fb_h);
641+
nvgFill(vg);
642+
610643
glEnable(GL_BLEND);
611644
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
612645

models/driving_model.dlc

-315 KB
Binary file not shown.

0 commit comments

Comments
 (0)