From 8fc7b0b8289761ecc349a2d8a3ee423e3bfb0ce3 Mon Sep 17 00:00:00 2001 From: Vehicle Researcher Date: Wed, 23 May 2018 03:59:04 +0000 Subject: [PATCH] openpilot v0.4.6 release old-commit-hash: c6df34f55ba8c5a911b60d3f9eb20e3fa45f68c1 --- README.md | 2 +- RELEASES.md | 8 + cereal/car.capnp | 7 + common/fingerprints.py | 10 + common/logging_extra.py | 35 +- installer/updater/updater | 3 + launch_chffrplus.sh | 12 - phonelibs/capnp-cpp/aarch64/bin/capnp | 3 + phonelibs/capnp-cpp/aarch64/bin/capnpc | 1 + phonelibs/capnp-cpp/aarch64/bin/capnpc-c++ | 3 + phonelibs/capnp-cpp/aarch64/bin/capnpc-capnp | 3 + phonelibs/capnp-cpp/aarch64/lib/libcapnp.a | 3 + phonelibs/capnp-cpp/aarch64/lib/libcapnpc.a | 3 + phonelibs/capnp-cpp/aarch64/lib/libkj.a | 3 + phonelibs/capnp-cpp/include/capnp/any.h | 3 + phonelibs/capnp-cpp/include/capnp/blob.h | 3 + phonelibs/capnp-cpp/include/capnp/c++.capnp | 3 + phonelibs/capnp-cpp/include/capnp/c++.capnp.h | 3 + phonelibs/capnp-cpp/include/capnp/c.capnp | 3 + .../capnp-cpp/include/capnp/capability.h | 3 + phonelibs/capnp-cpp/include/capnp/common.h | 3 + .../include/capnp/compat/json.capnp.h | 3 + .../capnp-cpp/include/capnp/compat/json.h | 3 + phonelibs/capnp-cpp/include/capnp/dynamic.h | 3 + phonelibs/capnp-cpp/include/capnp/endian.h | 3 + phonelibs/capnp-cpp/include/capnp/ez-rpc.h | 3 + .../include/capnp/generated-header-support.h | 3 + phonelibs/capnp-cpp/include/capnp/json.capnp | 3 + phonelibs/capnp-cpp/include/capnp/layout.h | 3 + phonelibs/capnp-cpp/include/capnp/list.h | 3 + phonelibs/capnp-cpp/include/capnp/membrane.h | 3 + phonelibs/capnp-cpp/include/capnp/message.h | 3 + phonelibs/capnp-cpp/include/capnp/orphan.h | 3 + .../capnp-cpp/include/capnp/persistent.capnp | 3 + .../include/capnp/persistent.capnp.h | 3 + .../capnp-cpp/include/capnp/pointer-helpers.h | 3 + .../capnp-cpp/include/capnp/pretty-print.h | 3 + .../capnp-cpp/include/capnp/raw-schema.h | 3 + .../capnp-cpp/include/capnp/rpc-prelude.h | 3 + .../include/capnp/rpc-twoparty.capnp | 3 + .../include/capnp/rpc-twoparty.capnp.h | 3 + .../capnp-cpp/include/capnp/rpc-twoparty.h | 3 + phonelibs/capnp-cpp/include/capnp/rpc.capnp | 3 + phonelibs/capnp-cpp/include/capnp/rpc.capnp.h | 3 + phonelibs/capnp-cpp/include/capnp/rpc.h | 3 + .../capnp-cpp/include/capnp/schema-lite.h | 3 + .../capnp-cpp/include/capnp/schema-loader.h | 3 + .../capnp-cpp/include/capnp/schema-parser.h | 3 + .../capnp-cpp/include/capnp/schema.capnp | 3 + .../capnp-cpp/include/capnp/schema.capnp.h | 3 + phonelibs/capnp-cpp/include/capnp/schema.h | 3 + .../capnp-cpp/include/capnp/serialize-async.h | 3 + .../include/capnp/serialize-packed.h | 3 + .../capnp-cpp/include/capnp/serialize-text.h | 3 + phonelibs/capnp-cpp/include/capnp/serialize.h | 3 + phonelibs/capnp-cpp/include/kj/arena.h | 3 + phonelibs/capnp-cpp/include/kj/array.h | 3 + phonelibs/capnp-cpp/include/kj/async-inl.h | 3 + phonelibs/capnp-cpp/include/kj/async-io.h | 3 + .../capnp-cpp/include/kj/async-prelude.h | 3 + phonelibs/capnp-cpp/include/kj/async-unix.h | 3 + phonelibs/capnp-cpp/include/kj/async-win32.h | 3 + phonelibs/capnp-cpp/include/kj/async.h | 3 + phonelibs/capnp-cpp/include/kj/common.h | 3 + phonelibs/capnp-cpp/include/kj/compat/gtest.h | 3 + phonelibs/capnp-cpp/include/kj/compat/http.h | 3 + phonelibs/capnp-cpp/include/kj/debug.h | 3 + phonelibs/capnp-cpp/include/kj/exception.h | 3 + phonelibs/capnp-cpp/include/kj/function.h | 3 + phonelibs/capnp-cpp/include/kj/io.h | 3 + phonelibs/capnp-cpp/include/kj/main.h | 3 + phonelibs/capnp-cpp/include/kj/memory.h | 3 + phonelibs/capnp-cpp/include/kj/mutex.h | 3 + phonelibs/capnp-cpp/include/kj/one-of.h | 3 + phonelibs/capnp-cpp/include/kj/parse/char.h | 3 + phonelibs/capnp-cpp/include/kj/parse/common.h | 3 + phonelibs/capnp-cpp/include/kj/refcount.h | 3 + phonelibs/capnp-cpp/include/kj/std/iostream.h | 3 + phonelibs/capnp-cpp/include/kj/string-tree.h | 3 + phonelibs/capnp-cpp/include/kj/string.h | 3 + phonelibs/capnp-cpp/include/kj/test.h | 3 + phonelibs/capnp-cpp/include/kj/thread.h | 3 + phonelibs/capnp-cpp/include/kj/threadlocal.h | 3 + phonelibs/capnp-cpp/include/kj/time.h | 3 + phonelibs/capnp-cpp/include/kj/tuple.h | 3 + phonelibs/capnp-cpp/include/kj/units.h | 3 + phonelibs/capnp-cpp/include/kj/vector.h | 3 + .../capnp-cpp/include/kj/windows-sanity.h | 3 + requirements_openpilot.txt | 3 +- selfdrive/assets/img_spinner_comma.png | 3 + selfdrive/assets/img_spinner_track.png | 3 + selfdrive/boardd/boardd.cc | 4 + selfdrive/can/Makefile | 1 + selfdrive/car/__init__.py | 5 +- selfdrive/car/honda/interface.py | 1 + selfdrive/car/toyota/carcontroller.py | 1 + selfdrive/car/toyota/interface.py | 1 + selfdrive/common/touch.c | 6 +- selfdrive/common/version.h | 2 +- selfdrive/controls/lib/alertmanager.py | 12 + selfdrive/controls/lib/latcontrol.py | 5 +- selfdrive/controls/radard.py | 3 +- selfdrive/locationd/ephemeris.py | 9 +- selfdrive/loggerd/loggerd | 4 +- selfdrive/loggerd/uploader.py | 4 +- selfdrive/manager.py | 30 +- selfdrive/orbd/.gitignore | 8 + selfdrive/orbd/Makefile | 11 +- selfdrive/orbd/dsp/freethedsp.c | 1 + selfdrive/orbd/dsp/gen/libcalculator_skel.so | 3 + selfdrive/orbd/orbd.cc | 1 + selfdrive/sensord/gpsd | 4 +- selfdrive/sensord/sensord | 4 +- selfdrive/service_list.yaml | 2 + selfdrive/test/plant/plant.py | 4 +- selfdrive/ui/spinner/spinner | 4 +- selfdrive/ui/spinner/spinner.c | 62 ++- selfdrive/ui/ui.c | 413 ++++-------------- selfdrive/visiond/visiond | 4 +- 119 files changed, 541 insertions(+), 395 deletions(-) create mode 100755 installer/updater/updater create mode 100755 phonelibs/capnp-cpp/aarch64/bin/capnp create mode 120000 phonelibs/capnp-cpp/aarch64/bin/capnpc create mode 100755 phonelibs/capnp-cpp/aarch64/bin/capnpc-c++ create mode 100755 phonelibs/capnp-cpp/aarch64/bin/capnpc-capnp create mode 100644 phonelibs/capnp-cpp/aarch64/lib/libcapnp.a create mode 100644 phonelibs/capnp-cpp/aarch64/lib/libcapnpc.a create mode 100644 phonelibs/capnp-cpp/aarch64/lib/libkj.a create mode 100644 phonelibs/capnp-cpp/include/capnp/any.h create mode 100644 phonelibs/capnp-cpp/include/capnp/blob.h create mode 100644 phonelibs/capnp-cpp/include/capnp/c++.capnp create mode 100644 phonelibs/capnp-cpp/include/capnp/c++.capnp.h create mode 100644 phonelibs/capnp-cpp/include/capnp/c.capnp create mode 100644 phonelibs/capnp-cpp/include/capnp/capability.h create mode 100644 phonelibs/capnp-cpp/include/capnp/common.h create mode 100644 phonelibs/capnp-cpp/include/capnp/compat/json.capnp.h create mode 100644 phonelibs/capnp-cpp/include/capnp/compat/json.h create mode 100644 phonelibs/capnp-cpp/include/capnp/dynamic.h create mode 100644 phonelibs/capnp-cpp/include/capnp/endian.h create mode 100644 phonelibs/capnp-cpp/include/capnp/ez-rpc.h create mode 100644 phonelibs/capnp-cpp/include/capnp/generated-header-support.h create mode 100644 phonelibs/capnp-cpp/include/capnp/json.capnp create mode 100644 phonelibs/capnp-cpp/include/capnp/layout.h create mode 100644 phonelibs/capnp-cpp/include/capnp/list.h create mode 100644 phonelibs/capnp-cpp/include/capnp/membrane.h create mode 100644 phonelibs/capnp-cpp/include/capnp/message.h create mode 100644 phonelibs/capnp-cpp/include/capnp/orphan.h create mode 100644 phonelibs/capnp-cpp/include/capnp/persistent.capnp create mode 100644 phonelibs/capnp-cpp/include/capnp/persistent.capnp.h create mode 100644 phonelibs/capnp-cpp/include/capnp/pointer-helpers.h create mode 100644 phonelibs/capnp-cpp/include/capnp/pretty-print.h create mode 100644 phonelibs/capnp-cpp/include/capnp/raw-schema.h create mode 100644 phonelibs/capnp-cpp/include/capnp/rpc-prelude.h create mode 100644 phonelibs/capnp-cpp/include/capnp/rpc-twoparty.capnp create mode 100644 phonelibs/capnp-cpp/include/capnp/rpc-twoparty.capnp.h create mode 100644 phonelibs/capnp-cpp/include/capnp/rpc-twoparty.h create mode 100644 phonelibs/capnp-cpp/include/capnp/rpc.capnp create mode 100644 phonelibs/capnp-cpp/include/capnp/rpc.capnp.h create mode 100644 phonelibs/capnp-cpp/include/capnp/rpc.h create mode 100644 phonelibs/capnp-cpp/include/capnp/schema-lite.h create mode 100644 phonelibs/capnp-cpp/include/capnp/schema-loader.h create mode 100644 phonelibs/capnp-cpp/include/capnp/schema-parser.h create mode 100644 phonelibs/capnp-cpp/include/capnp/schema.capnp create mode 100644 phonelibs/capnp-cpp/include/capnp/schema.capnp.h create mode 100644 phonelibs/capnp-cpp/include/capnp/schema.h create mode 100644 phonelibs/capnp-cpp/include/capnp/serialize-async.h create mode 100644 phonelibs/capnp-cpp/include/capnp/serialize-packed.h create mode 100644 phonelibs/capnp-cpp/include/capnp/serialize-text.h create mode 100644 phonelibs/capnp-cpp/include/capnp/serialize.h create mode 100644 phonelibs/capnp-cpp/include/kj/arena.h create mode 100644 phonelibs/capnp-cpp/include/kj/array.h create mode 100644 phonelibs/capnp-cpp/include/kj/async-inl.h create mode 100644 phonelibs/capnp-cpp/include/kj/async-io.h create mode 100644 phonelibs/capnp-cpp/include/kj/async-prelude.h create mode 100644 phonelibs/capnp-cpp/include/kj/async-unix.h create mode 100644 phonelibs/capnp-cpp/include/kj/async-win32.h create mode 100644 phonelibs/capnp-cpp/include/kj/async.h create mode 100644 phonelibs/capnp-cpp/include/kj/common.h create mode 100644 phonelibs/capnp-cpp/include/kj/compat/gtest.h create mode 100644 phonelibs/capnp-cpp/include/kj/compat/http.h create mode 100644 phonelibs/capnp-cpp/include/kj/debug.h create mode 100644 phonelibs/capnp-cpp/include/kj/exception.h create mode 100644 phonelibs/capnp-cpp/include/kj/function.h create mode 100644 phonelibs/capnp-cpp/include/kj/io.h create mode 100644 phonelibs/capnp-cpp/include/kj/main.h create mode 100644 phonelibs/capnp-cpp/include/kj/memory.h create mode 100644 phonelibs/capnp-cpp/include/kj/mutex.h create mode 100644 phonelibs/capnp-cpp/include/kj/one-of.h create mode 100644 phonelibs/capnp-cpp/include/kj/parse/char.h create mode 100644 phonelibs/capnp-cpp/include/kj/parse/common.h create mode 100644 phonelibs/capnp-cpp/include/kj/refcount.h create mode 100644 phonelibs/capnp-cpp/include/kj/std/iostream.h create mode 100644 phonelibs/capnp-cpp/include/kj/string-tree.h create mode 100644 phonelibs/capnp-cpp/include/kj/string.h create mode 100644 phonelibs/capnp-cpp/include/kj/test.h create mode 100644 phonelibs/capnp-cpp/include/kj/thread.h create mode 100644 phonelibs/capnp-cpp/include/kj/threadlocal.h create mode 100644 phonelibs/capnp-cpp/include/kj/time.h create mode 100644 phonelibs/capnp-cpp/include/kj/tuple.h create mode 100644 phonelibs/capnp-cpp/include/kj/units.h create mode 100644 phonelibs/capnp-cpp/include/kj/vector.h create mode 100644 phonelibs/capnp-cpp/include/kj/windows-sanity.h create mode 100644 selfdrive/assets/img_spinner_comma.png create mode 100644 selfdrive/assets/img_spinner_track.png create mode 100644 selfdrive/orbd/.gitignore create mode 100755 selfdrive/orbd/dsp/gen/libcalculator_skel.so diff --git a/README.md b/README.md index c5d51f499e..7ef940b6ce 100644 --- a/README.md +++ b/README.md @@ -148,7 +148,7 @@ Want to get paid to work on openpilot? [comma.ai is hiring](http://comma.ai/posi Licensing ------ -openpilot is released under the MIT license. +openpilot is released under the MIT license. Some parts of the software are released under other licenses as specified. Any user of this software shall indemnify and hold harmless Comma.ai, Inc. and its directors, officers, employees, agents, stockholders, affiliates, subcontractors and customers from and against all allegations, claims, actions, suits, demands, damages, liabilities, obligations, losses, settlements, judgments, costs and expenses (including without limitation attorneys’ fees and costs) which arise out of, relate to or result from any use of this software by user. diff --git a/RELEASES.md b/RELEASES.md index 34837bcc8c..fc3613c5ca 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,11 @@ +Version 0.4.6 (2018-05-18) +========================== + * NEOSv6 required! Will autoupdate + * Stability improvements + * Fix all memory leaks + * Update C++ compiler to clang6 + * Improve front camera exposure + Version 0.4.5 (2018-04-27) ========================== * Release notes added to the update popup diff --git a/cereal/car.capnp b/cereal/car.capnp index 94ff6697ec..19ab7120b5 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -57,6 +57,7 @@ struct CarEvent @0x9b1657f34caf3ad3 { plannerError @32; ipasOverride @33; debugAlert @34; + steerTempUnavailableMute @35; } } @@ -330,4 +331,10 @@ struct CarParams { stoppingControl @34 :Bool; # Does the car allows full control even at lows speeds when stopping startAccel @35 :Float32; # Required acceleraton to overcome creep braking steerRateCost @40 :Float32; # Lateral MPC cost on steering rate + steerControlType @46 :SteerControlType; + + enum SteerControlType { + torque @0; + angle @1; + } } diff --git a/common/fingerprints.py b/common/fingerprints.py index f7724312af..d6941ffa4b 100644 --- a/common/fingerprints.py +++ b/common/fingerprints.py @@ -17,6 +17,10 @@ class TOYOTA: class GM: VOLT = "CHEVROLET VOLT PREMIER 2017" + CADILLAC_CT6 = "CADILLAC CT6 SUPERCRUISE 2018" + +class FORD: + FUSION = "FORD FUSION 2018" _DEBUG_ADDRESS = {1880: 8} # reserved for debug purposes @@ -82,6 +86,12 @@ _FINGERPRINTS = { GM.VOLT: [{ 170: 8, 171: 8, 189: 7, 190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 2, 241: 6, 288: 5, 289: 8, 298: 8, 304: 1, 308: 4, 309: 8, 311: 8, 313: 8, 320: 3, 328: 1, 352: 5, 381: 6, 386: 8, 388: 8, 389: 2, 390: 7, 417: 7, 419: 1, 426: 7, 451: 8, 452: 8, 453: 6, 454: 8, 456: 8, 479: 3, 481: 7, 485: 8, 489: 8, 493: 8, 495: 4, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 528: 4, 532: 6, 546: 7, 550: 8, 554: 3, 558: 8, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 566: 5, 567: 3, 568: 1, 573: 1, 577: 8, 647: 3, 707: 8, 711: 6, 761: 7, 810: 8, 840: 5, 842: 5, 844: 8, 866: 4, 961: 8, 969: 8, 977: 8, 979: 7, 988: 6, 989: 8, 995: 7, 1001: 8, 1005: 6, 1009: 8, 1017: 8, 1019: 2, 1020: 8, 1105: 6, 1187: 4, 1217: 8, 1221: 5, 1223: 3, 1225: 7, 1227: 4, 1233: 8, 1249: 8, 1257: 6, 1265: 8, 1267: 1, 1273: 3, 1275: 3, 1280: 4, 1300: 8, 1322: 6, 1323: 4, 1328: 4, 1417: 8, 1601: 8, 1905: 7, 1906: 7, 1907: 7, 1910: 7, 1912: 7, 1922: 7, 1927: 7, 1928: 7, 2016: 8, 2020: 8, 2024: 8, 2028: 8 }], + GM.CADILLAC_CT6: [{ + 190: 6, 193: 8, 197: 8, 199: 4, 201: 8, 209: 7, 211: 2, 241: 6, 249: 8, 288: 5, 298: 8, 304: 1, 309: 8, 313: 8, 320: 3, 322: 7, 328: 1, 336: 1, 338: 6, 340: 6, 352: 5, 354: 5, 356: 8, 368: 3, 372: 5, 381: 8, 386: 8, 393: 7, 398: 8, 407: 7, 413: 8, 417: 7, 419: 1, 422: 4, 426: 7, 431: 8, 442: 8, 451: 8, 452: 8, 453: 6, 455: 7, 456: 8, 458: 5, 460: 5, 462: 4, 463: 3, 479: 3, 481: 7, 485: 8, 487: 8, 489: 8, 495: 4, 497: 8, 499: 3, 500: 6, 501: 8, 508: 8, 528: 5, 532: 6, 534: 2, 554: 3, 560: 8, 562: 8, 563: 5, 564: 5, 565: 5, 567: 5, 569: 3, 573: 1, 577: 8, 608: 8, 609: 6, 610: 6, 611: 6, 612: 8, 613: 8, 647: 6, 707: 8, 715: 8, 717: 5, 719: 5, 723: 2, 753: 5, 761: 7, 800: 6, 801: 8, 804: 3, 810: 8, 832: 8, 833: 8, 834: 8, 835: 6, 836: 5, 837: 8, 838: 8, 839: 8, 840: 5, 842: 5, 844: 8, 866: 4, 869: 4, 880: 6, 884: 8, 961: 8, 969: 8, 977: 8, 979: 8, 985: 5, 1001: 8, 1005: 6, 1009: 8, 1011: 6, 1013: 1, 1017: 8, 1019: 2, 1020: 8, 1105: 6, 1217: 8, 1221: 5, 1223: 3, 1225: 7, 1233: 8, 1249: 8, 1257: 6, 1259: 8, 1261: 7, 1263: 4, 1265: 8, 1267: 1, 1280: 4, 1296: 4, 1300: 8, 1322: 6, 1417: 8, 1601: 8, 1906: 7, 1907: 7, 1912: 7, 1914: 7, 1918: 7, 1919: 7, 1934: 7, 2016: 8, 2024: 8 + }], + FORD.FUSION: [{ + 71: 8, 74: 8, 75: 8, 76: 8, 90: 8, 92: 8, 93: 8, 118: 8, 119: 8, 120: 8, 125: 8, 129: 8, 130: 8, 131: 8, 132: 8, 133: 8, 145: 8, 146: 8, 357: 8, 359: 8, 360: 8, 361: 8, 376: 8, 390: 8, 391: 8, 392: 8, 394: 8, 512: 8, 514: 8, 516: 8, 531: 8, 532: 8, 534: 8, 535: 8, 560: 8, 578: 8, 604: 8, 613: 8, 673: 8, 827: 8, 848: 8, 934: 8, 935: 8, 936: 8, 947: 8, 963: 8, 970: 8, 972: 8, 973: 8, 984: 8, 992: 8, 994: 8, 997: 8, 998: 8, 1003: 8, 1034: 8, 1045: 8, 1046: 8, 1053: 8, 1054: 8, 1058: 8, 1059: 8, 1068: 8, 1072: 8, 1073: 8, 1082: 8, 1107: 8, 1108: 8, 1109: 8, 1110: 8, 1200: 8, 1427: 8, 1430: 8, 1438: 8, 1459: 8 + }], } # support additional internal only fingerprints diff --git a/common/logging_extra.py b/common/logging_extra.py index 359b3e0914..bad9ad5165 100644 --- a/common/logging_extra.py +++ b/common/logging_extra.py @@ -18,7 +18,7 @@ def json_robust_dumps(obj): class NiceOrderedDict(OrderedDict): def __str__(self): - return '{'+', '.join("%r: %r" % p for p in self.iteritems())+'}' + return json_robust_dumps(self) class SwagFormatter(logging.Formatter): def __init__(self, swaglogger): @@ -62,6 +62,10 @@ class SwagFormatter(logging.Formatter): def format(self, record): return json_robust_dumps(self.format_dict(record)) +class SwagErrorFilter(logging.Filter): + def filter(self, record): + return record.levelno < logging.ERROR + _tmpfunc = lambda: 0 _srcfile = os.path.normcase(_tmpfunc.__code__.co_filename) @@ -128,15 +132,40 @@ class SwagLogger(logging.Logger): if args: evt['args'] = args evt.update(kwargs) - self.info(evt) + if 'error' in kwargs: + self.error(evt) + else: + self.info(evt) if __name__ == "__main__": log = SwagLogger() + stdout_handler = logging.StreamHandler(sys.stdout) + stdout_handler.setLevel(logging.INFO) + stdout_handler.addFilter(SwagErrorFilter()) + log.addHandler(stdout_handler) + + stderr_handler = logging.StreamHandler(sys.stderr) + stderr_handler.setLevel(logging.ERROR) + log.addHandler(stderr_handler) + log.info("asdasd %s", "a") log.info({'wut': 1}) + log.warning("warning") + log.error("error") + log.critical("critical") + log.event("test", x="y") with log.ctx(): + stdout_handler.setFormatter(SwagFormatter(log)) + stderr_handler.setFormatter(SwagFormatter(log)) log.bind(user="some user") log.info("in req") - log.event("do_req") + print("") + log.warning("warning") + print("") + log.error("error") + print("") + log.critical("critical") + print("") + log.event("do_req", a=1, b="c") diff --git a/installer/updater/updater b/installer/updater/updater new file mode 100755 index 0000000000..462075503b --- /dev/null +++ b/installer/updater/updater @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1817dfc1a36226c1f2ffa56080c1488cb8e2dd83b2732c50f73f7e63302f2112 +size 2500744 diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 3362e82528..00e126c58b 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -22,18 +22,6 @@ function launch { echo 0-3 > /dev/cpuset/foreground/cpus echo 0-3 > /dev/cpuset/android/cpus - # check if NEOS update is required - while [ "$(cat /VERSION)" -lt 4 ] && [ ! -e /data/media/0/noupdate ]; do - # wait for network - (cd selfdrive/ui/spinner && exec ./spinner 'waiting for network...') & spin_pid=$! - until ping -W 1 -c 1 8.8.8.8; do sleep 1; done - kill $spin_pid - - # update NEOS - curl -o /tmp/updater https://neos.comma.ai/updater && chmod +x /tmp/updater && /tmp/updater - sleep 10 - done - export PYTHONPATH="$PWD" # start manager diff --git a/phonelibs/capnp-cpp/aarch64/bin/capnp b/phonelibs/capnp-cpp/aarch64/bin/capnp new file mode 100755 index 0000000000..b274e77c8f --- /dev/null +++ b/phonelibs/capnp-cpp/aarch64/bin/capnp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2e587ed5f1a993dbd555d4feb52fefbf16f7ed5400513af2b70923d37a09ec7b +size 1525512 diff --git a/phonelibs/capnp-cpp/aarch64/bin/capnpc b/phonelibs/capnp-cpp/aarch64/bin/capnpc new file mode 120000 index 0000000000..5668473f09 --- /dev/null +++ b/phonelibs/capnp-cpp/aarch64/bin/capnpc @@ -0,0 +1 @@ +capnp \ No newline at end of file diff --git a/phonelibs/capnp-cpp/aarch64/bin/capnpc-c++ b/phonelibs/capnp-cpp/aarch64/bin/capnpc-c++ new file mode 100755 index 0000000000..c1c2bafdb4 --- /dev/null +++ b/phonelibs/capnp-cpp/aarch64/bin/capnpc-c++ @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fd881b90aad022217a9bd9fd3edbdea6a4d849b9a4e784125f3a0bf34c5eaccc +size 1464976 diff --git a/phonelibs/capnp-cpp/aarch64/bin/capnpc-capnp b/phonelibs/capnp-cpp/aarch64/bin/capnpc-capnp new file mode 100755 index 0000000000..6a4b207874 --- /dev/null +++ b/phonelibs/capnp-cpp/aarch64/bin/capnpc-capnp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:acd14ceea3fa99e320562186fc150b3942402dd200d0a191c548df24a8b5f226 +size 824160 diff --git a/phonelibs/capnp-cpp/aarch64/lib/libcapnp.a b/phonelibs/capnp-cpp/aarch64/lib/libcapnp.a new file mode 100644 index 0000000000..1827daf5b6 --- /dev/null +++ b/phonelibs/capnp-cpp/aarch64/lib/libcapnp.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:64c52189119abd30d20ffad1989a99a6576048d3b5aeb6051cf6c55fd3d62fe0 +size 3376746 diff --git a/phonelibs/capnp-cpp/aarch64/lib/libcapnpc.a b/phonelibs/capnp-cpp/aarch64/lib/libcapnpc.a new file mode 100644 index 0000000000..9363eb4919 --- /dev/null +++ b/phonelibs/capnp-cpp/aarch64/lib/libcapnpc.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58d733153edbb86b565785e1a29dae5f90816b18bc0d59908c40109f8838961b +size 7093966 diff --git a/phonelibs/capnp-cpp/aarch64/lib/libkj.a b/phonelibs/capnp-cpp/aarch64/lib/libkj.a new file mode 100644 index 0000000000..154bf32b2a --- /dev/null +++ b/phonelibs/capnp-cpp/aarch64/lib/libkj.a @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:15365c956d5b90120a65429c0abae5601ef3f26f5c2800751ae3ac0dc5cfb44b +size 1318656 diff --git a/phonelibs/capnp-cpp/include/capnp/any.h b/phonelibs/capnp-cpp/include/capnp/any.h new file mode 100644 index 0000000000..cca5df0876 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/any.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b0ff4d65e7df901b76fa6417b56d2a878397f977cf2f2547c41560cbc00ad149 +size 34795 diff --git a/phonelibs/capnp-cpp/include/capnp/blob.h b/phonelibs/capnp-cpp/include/capnp/blob.h new file mode 100644 index 0000000000..155442ed12 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/blob.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c1145a302e778a9bd6e6a34f96a85472818008a1d0fbbdb57d7c0659903ca41f +size 8513 diff --git a/phonelibs/capnp-cpp/include/capnp/c++.capnp b/phonelibs/capnp-cpp/include/capnp/c++.capnp new file mode 100644 index 0000000000..477363e268 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/c++.capnp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb306076cd38c27af1aed20fac6395e9a46fbe5b5df6a248b5f1b6845a079c44 +size 1354 diff --git a/phonelibs/capnp-cpp/include/capnp/c++.capnp.h b/phonelibs/capnp-cpp/include/capnp/c++.capnp.h new file mode 100644 index 0000000000..8917e07dae --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/c++.capnp.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:01537f9ce3cbc843d6aab018195e02df268b9d16c15e5958cc367c6e47fc1589 +size 848 diff --git a/phonelibs/capnp-cpp/include/capnp/c.capnp b/phonelibs/capnp-cpp/include/capnp/c.capnp new file mode 100644 index 0000000000..58b2a4a9cd --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/c.capnp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:953a999f02ff20c196fc62e60e80a45244d275195a7f956ddd3dbb49ae20f99b +size 1814 diff --git a/phonelibs/capnp-cpp/include/capnp/capability.h b/phonelibs/capnp-cpp/include/capnp/capability.h new file mode 100644 index 0000000000..f6b68ca694 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/capability.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c86744ebbbb5c8c4d24bb6647d3c938d8672ef2d2c4ad498a7cb6de3d9cbf88 +size 37616 diff --git a/phonelibs/capnp-cpp/include/capnp/common.h b/phonelibs/capnp-cpp/include/capnp/common.h new file mode 100644 index 0000000000..455e265052 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/common.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3529d6562cbc98627d662198d1ea5d8fefb67c1a2f6255c6be9bb16c09bfa04b +size 26891 diff --git a/phonelibs/capnp-cpp/include/capnp/compat/json.capnp.h b/phonelibs/capnp-cpp/include/capnp/compat/json.capnp.h new file mode 100644 index 0000000000..5a5483b006 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/compat/json.capnp.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7bafe76fab6debe5a33dcf3b397df7be233391d97a6d81dc9ab189948b5f96d0 +size 33921 diff --git a/phonelibs/capnp-cpp/include/capnp/compat/json.h b/phonelibs/capnp-cpp/include/capnp/compat/json.h new file mode 100644 index 0000000000..57f95be39c --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/compat/json.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4db4d9b9b5595676fc019a866394d48534fc3aca368fa6726293fc29e06d455a +size 21485 diff --git a/phonelibs/capnp-cpp/include/capnp/dynamic.h b/phonelibs/capnp-cpp/include/capnp/dynamic.h new file mode 100644 index 0000000000..bba4db3eb7 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/dynamic.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d469ca634e1431d985c8022d0fe67e7fe79051a2d807d04186211d986a2b1ab +size 60368 diff --git a/phonelibs/capnp-cpp/include/capnp/endian.h b/phonelibs/capnp-cpp/include/capnp/endian.h new file mode 100644 index 0000000000..64ca2b7857 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/endian.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c4535f1c350d8bfb590a1e1b9abd36d843eeadd414d981bf43b7bc23ce43de1c +size 9394 diff --git a/phonelibs/capnp-cpp/include/capnp/ez-rpc.h b/phonelibs/capnp-cpp/include/capnp/ez-rpc.h new file mode 100644 index 0000000000..84165b09b2 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/ez-rpc.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:760907776eb6f2726749e53468c54982d8df009e6cec7e64b04f4caf6732987d +size 11855 diff --git a/phonelibs/capnp-cpp/include/capnp/generated-header-support.h b/phonelibs/capnp-cpp/include/capnp/generated-header-support.h new file mode 100644 index 0000000000..15203ab202 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/generated-header-support.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d48f9ac2426974e5877d8ff9d5f6d146aeec105eacccfbe18ccbb044ed7c183 +size 13507 diff --git a/phonelibs/capnp-cpp/include/capnp/json.capnp b/phonelibs/capnp-cpp/include/capnp/json.capnp new file mode 100644 index 0000000000..315defe86e --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/json.capnp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8aa1ea3348a869f18a9c21e8f63862b9b416de1542b06648a1303f26cc1ca05d +size 2190 diff --git a/phonelibs/capnp-cpp/include/capnp/layout.h b/phonelibs/capnp-cpp/include/capnp/layout.h new file mode 100644 index 0000000000..26203846f4 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/layout.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:db08dd4c3450e7428d6a5eec162b51df1fc15cab762596c5960c5a5cc1a4370b +size 52052 diff --git a/phonelibs/capnp-cpp/include/capnp/list.h b/phonelibs/capnp-cpp/include/capnp/list.h new file mode 100644 index 0000000000..16fb66bccb --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/list.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:47c91e34cfb431cec9a2e2422cc693e25eccbce2e6b71aab2815aae4282e463f +size 20983 diff --git a/phonelibs/capnp-cpp/include/capnp/membrane.h b/phonelibs/capnp-cpp/include/capnp/membrane.h new file mode 100644 index 0000000000..480497adbb --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/membrane.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8ba2016719f2bd2d67848347f72ac1fba39b7a414089d1787a64f2a7b55afa4 +size 10900 diff --git a/phonelibs/capnp-cpp/include/capnp/message.h b/phonelibs/capnp-cpp/include/capnp/message.h new file mode 100644 index 0000000000..62df767be0 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/message.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:018dc0f00ee97fce180084584f210a4965cc15342fa8e4ed7496ae7be3ffc259 +size 23593 diff --git a/phonelibs/capnp-cpp/include/capnp/orphan.h b/phonelibs/capnp-cpp/include/capnp/orphan.h new file mode 100644 index 0000000000..083e69f4a9 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/orphan.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e1d4690b2fce91b7089d98346ef5455ebe6e621cc21760c27ae1c3197294334e +size 17874 diff --git a/phonelibs/capnp-cpp/include/capnp/persistent.capnp b/phonelibs/capnp-cpp/include/capnp/persistent.capnp new file mode 100644 index 0000000000..e376bc40fe --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/persistent.capnp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea0fa94250ff56111f9fcccb2a560be29ff9c7c9068dd4e19705a4af37e257cf +size 8273 diff --git a/phonelibs/capnp-cpp/include/capnp/persistent.capnp.h b/phonelibs/capnp-cpp/include/capnp/persistent.capnp.h new file mode 100644 index 0000000000..82c4eb0a10 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/persistent.capnp.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:250ef0923e0256e7651c9451c5cb79424078677ea84902b13381e3596e7a4cc4 +size 71148 diff --git a/phonelibs/capnp-cpp/include/capnp/pointer-helpers.h b/phonelibs/capnp-cpp/include/capnp/pointer-helpers.h new file mode 100644 index 0000000000..5ee2905b84 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/pointer-helpers.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b963933d154d9114ee6f9cf36b3023f5b99c8d96c078d95bcbdd19e656946d2 +size 6512 diff --git a/phonelibs/capnp-cpp/include/capnp/pretty-print.h b/phonelibs/capnp-cpp/include/capnp/pretty-print.h new file mode 100644 index 0000000000..eac4e2ecbd --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/pretty-print.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2f5427abfa4583dbb0841c275b9852ba2ee20dfb5ef6648c9871b6283adcc580 +size 2051 diff --git a/phonelibs/capnp-cpp/include/capnp/raw-schema.h b/phonelibs/capnp-cpp/include/capnp/raw-schema.h new file mode 100644 index 0000000000..65ba404083 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/raw-schema.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5d2653f6a2fd04a79d600cfe626880e8bad0062557c9b1baecb1439269538dc9 +size 8912 diff --git a/phonelibs/capnp-cpp/include/capnp/rpc-prelude.h b/phonelibs/capnp-cpp/include/capnp/rpc-prelude.h new file mode 100644 index 0000000000..792a95e993 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/rpc-prelude.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f97348f4aa486a38cd1be005f478a8e53601bfa47abf500592c6ef0c12b146df +size 4897 diff --git a/phonelibs/capnp-cpp/include/capnp/rpc-twoparty.capnp b/phonelibs/capnp-cpp/include/capnp/rpc-twoparty.capnp new file mode 100644 index 0000000000..676be810cc --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/rpc-twoparty.capnp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e0401c91f90ae1283ce040537c88554a34f03491114c1393b535ffbbbe70741e +size 9716 diff --git a/phonelibs/capnp-cpp/include/capnp/rpc-twoparty.capnp.h b/phonelibs/capnp-cpp/include/capnp/rpc-twoparty.capnp.h new file mode 100644 index 0000000000..4b425d2709 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/rpc-twoparty.capnp.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a80c2d746de0097a2d6193906d74b52f10587ab94a64830f41e232b33d87de91 +size 21232 diff --git a/phonelibs/capnp-cpp/include/capnp/rpc-twoparty.h b/phonelibs/capnp-cpp/include/capnp/rpc-twoparty.h new file mode 100644 index 0000000000..81f8934818 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/rpc-twoparty.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40d54e34d92e3ac1a6ab42a84fbeb8c7020989c994615ecd2d30ac689ccb2c2d +size 6252 diff --git a/phonelibs/capnp-cpp/include/capnp/rpc.capnp b/phonelibs/capnp-cpp/include/capnp/rpc.capnp new file mode 100644 index 0000000000..71b1a1301f --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/rpc.capnp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4a20003d7fac60638fa0c16b1001caab7cac6389f1926114d50d5e975448ed12 +size 76462 diff --git a/phonelibs/capnp-cpp/include/capnp/rpc.capnp.h b/phonelibs/capnp-cpp/include/capnp/rpc.capnp.h new file mode 100644 index 0000000000..112f04bec9 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/rpc.capnp.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:71c38f5c4e2b2dad42991286c68e57c2993b3403e497c8f011aaea18e4729a33 +size 185146 diff --git a/phonelibs/capnp-cpp/include/capnp/rpc.h b/phonelibs/capnp-cpp/include/capnp/rpc.h new file mode 100644 index 0000000000..8983b7c08f --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/rpc.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d2f5e6fb81e016db2689070c465181c717452b246f6dee9c70c8cd9f2bcc20ee +size 26602 diff --git a/phonelibs/capnp-cpp/include/capnp/schema-lite.h b/phonelibs/capnp-cpp/include/capnp/schema-lite.h new file mode 100644 index 0000000000..4ed6796818 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/schema-lite.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6226f1bcee096d3e13d9c2159ffe9695ca27c1a132a1702d84c08ee06e67e482 +size 2038 diff --git a/phonelibs/capnp-cpp/include/capnp/schema-loader.h b/phonelibs/capnp-cpp/include/capnp/schema-loader.h new file mode 100644 index 0000000000..19017572bd --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/schema-loader.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:466d1e6a87a86d6ac3b24edb02e095cab2ac0ef36dcdcaddd2cb8bdba9166a33 +size 8681 diff --git a/phonelibs/capnp-cpp/include/capnp/schema-parser.h b/phonelibs/capnp-cpp/include/capnp/schema-parser.h new file mode 100644 index 0000000000..5dfb150fb9 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/schema-parser.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4fc427bf35d1b4081587017a1172549bc8115fb6717fd801d922a45629867e40 +size 8616 diff --git a/phonelibs/capnp-cpp/include/capnp/schema.capnp b/phonelibs/capnp-cpp/include/capnp/schema.capnp new file mode 100644 index 0000000000..daa9528c56 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/schema.capnp @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8b4277ba9964831af0125e37f238f07a5db588549231b28be0fd4e2219a10e4 +size 16976 diff --git a/phonelibs/capnp-cpp/include/capnp/schema.capnp.h b/phonelibs/capnp-cpp/include/capnp/schema.capnp.h new file mode 100644 index 0000000000..8207493922 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/schema.capnp.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa22dc6f17e5df03c24012d7c4d054e88395f5b88770cf8ef79c3324e5145408 +size 291672 diff --git a/phonelibs/capnp-cpp/include/capnp/schema.h b/phonelibs/capnp-cpp/include/capnp/schema.h new file mode 100644 index 0000000000..0d897e029e --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/schema.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:261583f20eee704197b3aebd9da00225a7a437f3352ced3db45bfee7f2ecdb99 +size 36242 diff --git a/phonelibs/capnp-cpp/include/capnp/serialize-async.h b/phonelibs/capnp-cpp/include/capnp/serialize-async.h new file mode 100644 index 0000000000..80f55e37a3 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/serialize-async.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e2b4777da2f36a2a51f784fcb4f7023679a4ec2272958e69de25e4014c4c4875 +size 2770 diff --git a/phonelibs/capnp-cpp/include/capnp/serialize-packed.h b/phonelibs/capnp-cpp/include/capnp/serialize-packed.h new file mode 100644 index 0000000000..e3e1200db7 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/serialize-packed.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fccc4e53638192db7688def8f4892d4bbcb0518c909dc34ebc3596b13f60b917 +size 5404 diff --git a/phonelibs/capnp-cpp/include/capnp/serialize-text.h b/phonelibs/capnp-cpp/include/capnp/serialize-text.h new file mode 100644 index 0000000000..2a9c79e094 --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/serialize-text.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d14d2e00e5b73422e2516256eddbccaa3c4f52aabd4201c5df1702822508893a +size 3753 diff --git a/phonelibs/capnp-cpp/include/capnp/serialize.h b/phonelibs/capnp-cpp/include/capnp/serialize.h new file mode 100644 index 0000000000..2a8c71e95d --- /dev/null +++ b/phonelibs/capnp-cpp/include/capnp/serialize.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:962a36c62a361b1f2252f8facb89d1290cd7196287e7cdb50a042f7477aa16d5 +size 11669 diff --git a/phonelibs/capnp-cpp/include/kj/arena.h b/phonelibs/capnp-cpp/include/kj/arena.h new file mode 100644 index 0000000000..ec6a967405 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/arena.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7e3f65eb614ab0308dabaaeb3fe1907f33feb96fb4aa9d659db08ba7849d4273 +size 8300 diff --git a/phonelibs/capnp-cpp/include/kj/array.h b/phonelibs/capnp-cpp/include/kj/array.h new file mode 100644 index 0000000000..ffa1b06685 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/array.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e82ba9225547df2cb1b43e7c6025b3d876c4b5737936942aa17ec80c70451a40 +size 27097 diff --git a/phonelibs/capnp-cpp/include/kj/async-inl.h b/phonelibs/capnp-cpp/include/kj/async-inl.h new file mode 100644 index 0000000000..ef6809c937 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/async-inl.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7b6086c88ec56a3f294f6845b2fb493613b424042922c10b3c3f3f9d67f64961 +size 35246 diff --git a/phonelibs/capnp-cpp/include/kj/async-io.h b/phonelibs/capnp-cpp/include/kj/async-io.h new file mode 100644 index 0000000000..c5a4efa12d --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/async-io.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fedee3753645e2a932d9c40b27bd85b41ce29719e3d67464486a4c02f21afcbc +size 24313 diff --git a/phonelibs/capnp-cpp/include/kj/async-prelude.h b/phonelibs/capnp-cpp/include/kj/async-prelude.h new file mode 100644 index 0000000000..3b9af36eb3 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/async-prelude.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9b0025cef7a323237540707cd6b74210681f8c599e368a1d735b7ec2e65102d3 +size 6589 diff --git a/phonelibs/capnp-cpp/include/kj/async-unix.h b/phonelibs/capnp-cpp/include/kj/async-unix.h new file mode 100644 index 0000000000..03ba6e2faf --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/async-unix.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b57458b516e1e2a8ecb139313dffb80ae6ed652388a48af5d3a0f60a1630c59d +size 12133 diff --git a/phonelibs/capnp-cpp/include/kj/async-win32.h b/phonelibs/capnp-cpp/include/kj/async-win32.h new file mode 100644 index 0000000000..bf15ea3003 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/async-win32.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5434475aff2d6c1f25f333bd3324ac375c2fa1ebe9d2ee8aebbd29d757c9a43c +size 10110 diff --git a/phonelibs/capnp-cpp/include/kj/async.h b/phonelibs/capnp-cpp/include/kj/async.h new file mode 100644 index 0000000000..1f79a276f9 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/async.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a7f78bbe2b4a8c15734e181af93f0f600d8010da3dd5c0d349cbee6de81c3c13 +size 33142 diff --git a/phonelibs/capnp-cpp/include/kj/common.h b/phonelibs/capnp-cpp/include/kj/common.h new file mode 100644 index 0000000000..a746cd1ce1 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/common.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8c0f8086465f312154d7def64da15cf790b0da847e811f59cc27860c1b35fb5e +size 51151 diff --git a/phonelibs/capnp-cpp/include/kj/compat/gtest.h b/phonelibs/capnp-cpp/include/kj/compat/gtest.h new file mode 100644 index 0000000000..66d6ffae40 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/compat/gtest.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3a3d94ac3206c4ac6e3554efa66d532fc97866cbf219624dd4afd567b9164f7 +size 4582 diff --git a/phonelibs/capnp-cpp/include/kj/compat/http.h b/phonelibs/capnp-cpp/include/kj/compat/http.h new file mode 100644 index 0000000000..f726ef9982 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/compat/http.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ce0327b2ab11618d2b302f33e1c937caf8a692f5adeae849cce8faa1e3948832 +size 24896 diff --git a/phonelibs/capnp-cpp/include/kj/debug.h b/phonelibs/capnp-cpp/include/kj/debug.h new file mode 100644 index 0000000000..a13f71c72d --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/debug.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:7c7f8abd1e5b2194de42bc38bf958463dc4dfe51d24464a098e1161a3e7c45b9 +size 23227 diff --git a/phonelibs/capnp-cpp/include/kj/exception.h b/phonelibs/capnp-cpp/include/kj/exception.h new file mode 100644 index 0000000000..e11fca1bb4 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/exception.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0586183e1044baa98113ad3927e9b44b5b4a4159efec88978b03db2ef059031a +size 14802 diff --git a/phonelibs/capnp-cpp/include/kj/function.h b/phonelibs/capnp-cpp/include/kj/function.h new file mode 100644 index 0000000000..0442a7f75d --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/function.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aff9075eeb57a3646beaee526010541f17bf062ed1a7116e00970d641dc94f91 +size 9236 diff --git a/phonelibs/capnp-cpp/include/kj/io.h b/phonelibs/capnp-cpp/include/kj/io.h new file mode 100644 index 0000000000..b7a23da4b2 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/io.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f38ef4fc1da744d81f1160a86a9e33dc6ce2506dc6aa511a378fae89ba3757c +size 15536 diff --git a/phonelibs/capnp-cpp/include/kj/main.h b/phonelibs/capnp-cpp/include/kj/main.h new file mode 100644 index 0000000000..04cbbc54be --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/main.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:54e56fab508478c4fc043f1880da0e187187845723ec3c252d222f43cb41da80 +size 19767 diff --git a/phonelibs/capnp-cpp/include/kj/memory.h b/phonelibs/capnp-cpp/include/kj/memory.h new file mode 100644 index 0000000000..4879c4b968 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/memory.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0dd04feded21ac677cfa8f91aadc76a351832aeb4d8d0e87248be16cbe02b93f +size 13633 diff --git a/phonelibs/capnp-cpp/include/kj/mutex.h b/phonelibs/capnp-cpp/include/kj/mutex.h new file mode 100644 index 0000000000..d618ff525c --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/mutex.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77b917aab3bb44db463251934a2daccf8dd6474f20e87d4fbf34869513687863 +size 11678 diff --git a/phonelibs/capnp-cpp/include/kj/one-of.h b/phonelibs/capnp-cpp/include/kj/one-of.h new file mode 100644 index 0000000000..0aa6949a21 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/one-of.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6d81a72d3717c27463b769dd5fc161314035849507faab76d89f0714d388f533 +size 5067 diff --git a/phonelibs/capnp-cpp/include/kj/parse/char.h b/phonelibs/capnp-cpp/include/kj/parse/char.h new file mode 100644 index 0000000000..b902784c4a --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/parse/char.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:178045b2c75b7ccf200e0f2007a1a16e2eba005b03913db412f64a31df197d57 +size 12126 diff --git a/phonelibs/capnp-cpp/include/kj/parse/common.h b/phonelibs/capnp-cpp/include/kj/parse/common.h new file mode 100644 index 0000000000..e0cd482284 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/parse/common.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:17a4c71083f75467fa32ec9daeb6bb6fb4888899e598d712abee75f20fc42491 +size 26546 diff --git a/phonelibs/capnp-cpp/include/kj/refcount.h b/phonelibs/capnp-cpp/include/kj/refcount.h new file mode 100644 index 0000000000..a5ff18dd89 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/refcount.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fda6fb25d8f6d4dd9b8ffc9de0bc62dd5aa9adbbd47f84e8554b79d26dd30fbc +size 4634 diff --git a/phonelibs/capnp-cpp/include/kj/std/iostream.h b/phonelibs/capnp-cpp/include/kj/std/iostream.h new file mode 100644 index 0000000000..a87d92a2a5 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/std/iostream.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bfd7565b95e0eb3cc8f8306e6f5b21aa0ffd34f14914cb066fafee4677e6990b +size 2685 diff --git a/phonelibs/capnp-cpp/include/kj/string-tree.h b/phonelibs/capnp-cpp/include/kj/string-tree.h new file mode 100644 index 0000000000..4fcef2197e --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/string-tree.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1088bc02dc394cfea38b7205063fb9ac60335bb90061d45f426183a3cc60b04f +size 8157 diff --git a/phonelibs/capnp-cpp/include/kj/string.h b/phonelibs/capnp-cpp/include/kj/string.h new file mode 100644 index 0000000000..62229d3cfa --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/string.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e9f8bcdf110c2f1aeb629ad9ba987fc51d6cb2fdbc48d9e3895ad830cbcc406b +size 21880 diff --git a/phonelibs/capnp-cpp/include/kj/test.h b/phonelibs/capnp-cpp/include/kj/test.h new file mode 100644 index 0000000000..efd6a12cb5 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/test.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:30d2355dc0012ae7ccb6b61271ca893907f722a5d23e1858d5ecb0d6f78dda1e +size 5532 diff --git a/phonelibs/capnp-cpp/include/kj/thread.h b/phonelibs/capnp-cpp/include/kj/thread.h new file mode 100644 index 0000000000..bfdeeeb42d --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/thread.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e10dd5c854d2e85b1201b8bb974f0effbebf9361b92e719cdce2cf7504fa80d6 +size 2475 diff --git a/phonelibs/capnp-cpp/include/kj/threadlocal.h b/phonelibs/capnp-cpp/include/kj/threadlocal.h new file mode 100644 index 0000000000..37108b4e94 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/threadlocal.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:778e4bffe5e104c2ff1383c4fbad81489e694113295078b7ce9327ee91c15a26 +size 4759 diff --git a/phonelibs/capnp-cpp/include/kj/time.h b/phonelibs/capnp-cpp/include/kj/time.h new file mode 100644 index 0000000000..5cfa9e39a8 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/time.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da50a9f371cf0837af711b9d8131d96d11cd1b5269040a7cf3bc0ceaa7534a26 +size 6652 diff --git a/phonelibs/capnp-cpp/include/kj/tuple.h b/phonelibs/capnp-cpp/include/kj/tuple.h new file mode 100644 index 0000000000..f405b804a2 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/tuple.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b3292c28e17721868e1caa1ca9b6694aa2e105efbc44dec51a101f34e357b1ae +size 15713 diff --git a/phonelibs/capnp-cpp/include/kj/units.h b/phonelibs/capnp-cpp/include/kj/units.h new file mode 100644 index 0000000000..7ad4a20bc3 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/units.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:31ba4f0ddbf586003f98ecfe9e198afab8a20b22566e00b321dcb8c6c22519f2 +size 45634 diff --git a/phonelibs/capnp-cpp/include/kj/vector.h b/phonelibs/capnp-cpp/include/kj/vector.h new file mode 100644 index 0000000000..81e65dab66 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/vector.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ea68079d96d8e0bab678426caadcc078975dc9f2221d241419516418638e0c68 +size 4688 diff --git a/phonelibs/capnp-cpp/include/kj/windows-sanity.h b/phonelibs/capnp-cpp/include/kj/windows-sanity.h new file mode 100644 index 0000000000..9b224b42c6 --- /dev/null +++ b/phonelibs/capnp-cpp/include/kj/windows-sanity.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0c4dd9c5cdcf3e0affe9bd3ea2cbe1d4a7e3214c99482eade5564a27d86e6e53 +size 1604 diff --git a/requirements_openpilot.txt b/requirements_openpilot.txt index a005faace7..69f135c260 100644 --- a/requirements_openpilot.txt +++ b/requirements_openpilot.txt @@ -2,7 +2,7 @@ Cython==0.24.1 bitstring==3.1.5 fastcluster==1.1.21 libusb1==1.5.0 -pycapnp==0.5.9 +pycapnp==0.6.3 pyzmq==15.4.0 raven==5.23.0 requests==2.10.0 @@ -16,3 +16,4 @@ filterpy==1.0.0 smbus2==0.2.0 pyflakes==1.5.0 -e git+https://github.com/commaai/le_python.git#egg=Logentries +Flask==1.0.1 diff --git a/selfdrive/assets/img_spinner_comma.png b/selfdrive/assets/img_spinner_comma.png new file mode 100644 index 0000000000..81f2fb38c4 --- /dev/null +++ b/selfdrive/assets/img_spinner_comma.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:78d140abe572b00765a7ece46bd990cff1287c2e8705a5f551b74461ab307b6b +size 15713 diff --git a/selfdrive/assets/img_spinner_track.png b/selfdrive/assets/img_spinner_track.png new file mode 100644 index 0000000000..989a6cefd1 --- /dev/null +++ b/selfdrive/assets/img_spinner_track.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49e9bad844598b0aa13c75fad7685f89f7ab190932963a8c70014553b9da37ae +size 41523 diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/boardd/boardd.cc index 6da41e182d..771ea7d99f 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/boardd/boardd.cc @@ -37,6 +37,7 @@ #define SAFETY_ELM327 0xE327 #define SAFETY_GM 3 #define SAFETY_HONDA_BOSCH 4 +#define SAFETY_FORD 5 #define SAFETY_TOYOTA_NOLIMITS 0x1336 #define SAFETY_ALLOUTPUT 0x1337 @@ -105,6 +106,9 @@ void *safety_setter_thread(void *s) { case (int)cereal::CarParams::SafetyModels::HONDA_BOSCH: safety_setting = SAFETY_HONDA_BOSCH; break; + case (int)cereal::CarParams::SafetyModels::FORD: + safety_setting = SAFETY_FORD; + break; default: LOGE("unknown safety model: %d", safety_model); } diff --git a/selfdrive/can/Makefile b/selfdrive/can/Makefile index a1f1261963..b140aa5f87 100644 --- a/selfdrive/can/Makefile +++ b/selfdrive/can/Makefile @@ -28,6 +28,7 @@ else ifeq ($(UNAME_M),x86_64) else ifeq ($(UNAME_M),aarch64) ZMQ_FLAGS = -I$(PHONELIBS)/zmq/aarch64/include ZMQ_LIBS = -L$(PHONELIBS)/zmq/aarch64/lib -l:libzmq.a + CXXFLAGS += -lgnustl_shared endif OPENDBC_PATH := $(shell python -c 'import opendbc; print opendbc.DBC_PATH') diff --git a/selfdrive/car/__init__.py b/selfdrive/car/__init__.py index 388af85f9f..5029ba2c53 100644 --- a/selfdrive/car/__init__.py +++ b/selfdrive/car/__init__.py @@ -5,7 +5,7 @@ from common.fingerprints import eliminate_incompatible_cars, all_known_cars from selfdrive.swaglog import cloudlog import selfdrive.messaging as messaging -from common.fingerprints import HONDA, TOYOTA, GM +from common.fingerprints import HONDA, TOYOTA, GM, FORD def load_interfaces(x): ret = {} @@ -22,7 +22,8 @@ def load_interfaces(x): interfaces = load_interfaces({ 'honda': [HONDA.CIVIC, HONDA.ACURA_ILX, HONDA.CRV, HONDA.ODYSSEY, HONDA.ACURA_RDX, HONDA.PILOT, HONDA.RIDGELINE], 'toyota': [TOYOTA.PRIUS, TOYOTA.RAV4, TOYOTA.RAV4H, TOYOTA.COROLLA, TOYOTA.LEXUS_RXH], - 'gm': [GM.VOLT], + 'gm': [GM.VOLT, GM.CADILLAC_CT6], + 'ford': [FORD.FUSION], 'simulator2': ['simulator2'], 'mock': ['mock']}) diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index 1f053d283a..7beaa6b5b8 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -257,6 +257,7 @@ class CarInterface(object): raise ValueError("unsupported car %s" % candidate) ret.steerKf = 0. # TODO: investigate FF steer control for Honda + ret.steerControlType = car.CarParams.SteerControlType.torque # min speed to enable ACC. if car can do stop and go, then set enabling speed # to a negative value, so it won't matter. Otherwise, add 0.5 mph margin to not diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index 50ce557faa..7752add1b2 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -67,6 +67,7 @@ def process_hud_alert(hud_alert, audible_alert): return steer, fcw, sound1, sound2 + def ipas_state_transition(steer_angle_enabled, enabled, ipas_active, ipas_reset_counter): if enabled and not steer_angle_enabled: diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 49e6455fae..55310d7ab7 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -136,6 +136,7 @@ class CarInterface(object): # no rear steering, at least on the listed cars above ret.steerRatioRear = 0. + ret.steerControlType = car.CarParams.SteerControlType.torque # steer, gas, brake limitations VS speed ret.steerMaxBP = [16. * CV.KPH_TO_MS, 45. * CV.KPH_TO_MS] # breakpoints at 1 and 40 kph diff --git a/selfdrive/common/touch.c b/selfdrive/common/touch.c index a6dc226053..2367d8d98c 100644 --- a/selfdrive/common/touch.c +++ b/selfdrive/common/touch.c @@ -89,9 +89,9 @@ int touch_poll(TouchState *s, int* out_x, int* out_y) { } } if (up) { - // adjust for landscape - *out_x = 1920 - s->last_y; - *out_y = s->last_x; + // adjust for flippening + *out_x = s->last_y; + *out_y = 1080 - s->last_x; } return up; } diff --git a/selfdrive/common/version.h b/selfdrive/common/version.h index 0760fbbe9b..aa2be407b7 100644 --- a/selfdrive/common/version.h +++ b/selfdrive/common/version.h @@ -1 +1 @@ -#define COMMA_VERSION "0.4.5.1-release" +#define COMMA_VERSION "0.4.6-release" diff --git a/selfdrive/controls/lib/alertmanager.py b/selfdrive/controls/lib/alertmanager.py index afa79d48a9..2fb365518e 100644 --- a/selfdrive/controls/lib/alertmanager.py +++ b/selfdrive/controls/lib/alertmanager.py @@ -88,6 +88,12 @@ class AlertManager(object): AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, "steerRequired", "chimeDouble", .4, 2., 3.), + "steerTempUnavailableMute": Alert( + "TAKE CONTROL", + "Steering Temporarily Unavailable", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW, None, None, .2, .2, .2), + "preDriverDistracted": Alert( "TAKE CONTROL", "User Appears Distracted", @@ -124,6 +130,12 @@ class AlertManager(object): AlertStatus.userPrompt, AlertSize.mid, Priority.LOW, None, None, 0., 0., .2), + "debugAlert": Alert( + "DEBUG ALERT", + "", + AlertStatus.userPrompt, AlertSize.mid, + Priority.LOW, None, None, .1, .1, .1), + # Non-entry only alerts "wrongCarModeNoEntry": Alert( "openpilot Unavailable", diff --git a/selfdrive/controls/lib/latcontrol.py b/selfdrive/controls/lib/latcontrol.py index 4d5c67681e..32e7a6a45b 100644 --- a/selfdrive/controls/lib/latcontrol.py +++ b/selfdrive/controls/lib/latcontrol.py @@ -6,6 +6,7 @@ from selfdrive.controls.lib.lateral_mpc import libmpc_py from common.numpy_fast import interp from common.realtime import sec_since_boot from selfdrive.swaglog import cloudlog +from cereal import car # 100ms is a rule of thumb estimation of lag from image processing to actuator command ACTUATORS_DELAY = 0.1 @@ -111,7 +112,9 @@ class LatControl(object): steers_max = get_steer_max(VM.CP, v_ego) self.pid.pos_limit = steers_max self.pid.neg_limit = -steers_max - steer_feedforward = self.angle_steers_des * v_ego**2 # proportional to realigning tire momentum (~ lateral accel) + steer_feedforward = self.angle_steers_des # feedforward desired angle + if VM.CP.steerControlType == car.CarParams.SteerControlType.torque: + steer_feedforward *= v_ego**2 # proportional to realigning tire momentum (~ lateral accel) output_steer = self.pid.update(self.angle_steers_des, angle_steers, check_saturation=(v_ego > 10), override=steer_override, feedforward=steer_feedforward, speed=v_ego) self.sat_flag = self.pid.saturated diff --git a/selfdrive/controls/radard.py b/selfdrive/controls/radard.py index bf7d14b6f6..7e9ca6f826 100755 --- a/selfdrive/controls/radard.py +++ b/selfdrive/controls/radard.py @@ -1,6 +1,7 @@ #!/usr/bin/env python import zmq import numpy as np +import numpy.matlib import importlib from collections import defaultdict from fastcluster import linkage_vector @@ -27,7 +28,7 @@ VISION_POINT = -1 class EKFV1D(EKF): def __init__(self): super(EKFV1D, self).__init__(False) - self.identity = np.matlib.identity(DIMSV) + self.identity = numpy.matlib.identity(DIMSV) self.state = np.matlib.zeros((DIMSV, 1)) self.var_init = 1e2 # ~ model variance when probability is 70%, so good starting point self.covar = self.identity * self.var_init diff --git a/selfdrive/locationd/ephemeris.py b/selfdrive/locationd/ephemeris.py index 0fbedf5250..dd8155e19a 100644 --- a/selfdrive/locationd/ephemeris.py +++ b/selfdrive/locationd/ephemeris.py @@ -114,12 +114,9 @@ on of this parser self.valid = (iode1 == iode2) and (iode1 == (iodc & 0xff)) self.iode = iode1 - if GET_FIELD_U(subframes[4][2+0], 2, 28) != 1: - raise RuntimeError("subframe 4 not of type 1") - if GET_FIELD_U(subframes[5][2+0], 2, 28) != 1: - raise RuntimeError("subframe 5 not of type 1") - print 'page :', GET_FIELD_U(subframes[4][2+0], 6, 22) - if GET_FIELD_U(subframes[4][2+0], 6, 22) == 56: + if GET_FIELD_U(subframes[4][2+0], 6, 22) == 56 and \ + GET_FIELD_U(subframes[4][2+0], 2, 28) == 1 and \ + GET_FIELD_U(subframes[5][2+0], 2, 28) == 1: a0 = GET_FIELD_S(subframes[4][2], 8, 14) * pow(2, -30) a1 = GET_FIELD_S(subframes[4][2], 8, 6) * pow(2, -27) a2 = GET_FIELD_S(subframes[4][3], 8, 22) * pow(2, -24) diff --git a/selfdrive/loggerd/loggerd b/selfdrive/loggerd/loggerd index 725f2da1cf..c5bfe2bbfd 100755 --- a/selfdrive/loggerd/loggerd +++ b/selfdrive/loggerd/loggerd @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:386bd1564e5ccf18f3fc3b8a208174447ff7209d6f94715d55b5153de8a53d7a -size 1416464 +oid sha256:64f33bda4befb1625175d6bce1499fffe88e7fd6b0aae45f1fbeae10c294c9bf +size 1622712 diff --git a/selfdrive/loggerd/uploader.py b/selfdrive/loggerd/uploader.py index f45303a16e..8c97907b72 100644 --- a/selfdrive/loggerd/uploader.py +++ b/selfdrive/loggerd/uploader.py @@ -143,11 +143,11 @@ class Uploader(object): def do_upload(self, key, fn): try: - url_resp = api_get("v1.1/"+self.dongle_id+"/upload_url/", timeout=2, path=key, access_token=self.access_token) + url_resp = api_get("v1.2/"+self.dongle_id+"/upload_url/", timeout=2, path=key, access_token=self.access_token) url_resp_json = json.loads(url_resp.text) url = url_resp_json['url'] headers = url_resp_json['headers'] - cloudlog.info("upload_url v1.1 %s %s", url, str(headers)) + cloudlog.info("upload_url v1.2 %s %s", url, str(headers)) if fake_upload: cloudlog.info("*** WARNING, THIS IS A FAKE UPLOAD TO %s ***" % url) diff --git a/selfdrive/manager.py b/selfdrive/manager.py index 6ea25ddca0..fd79b2006d 100755 --- a/selfdrive/manager.py +++ b/selfdrive/manager.py @@ -5,9 +5,21 @@ import fcntl import errno import signal +from common.basedir import BASEDIR +sys.path.append(os.path.join(BASEDIR, "pyextra")) +os.environ['BASEDIR'] = BASEDIR + if __name__ == "__main__": if os.path.isfile("/init.qcom.rc") \ - and (not os.path.isfile("/VERSION") or int(open("/VERSION").read()) < 4): + and (not os.path.isfile("/VERSION") or int(open("/VERSION").read()) < 6): + + # update continue.sh before updating NEOS + if os.path.isfile(os.path.join(BASEDIR, "scripts", "continue.sh")): + from shutil import copyfile + copyfile(os.path.join(BASEDIR, "scripts", "continue.sh"), "/data/data/com.termux/files/continue.sh") + + # run the updater + os.system(os.path.join(BASEDIR, "installer", "updater", "updater")) raise Exception("NEOS outdated") # get a non-blocking stdout @@ -47,9 +59,9 @@ import subprocess import traceback from multiprocessing import Process -from common.basedir import BASEDIR -sys.path.append(os.path.join(BASEDIR, "pyextra")) -os.environ['BASEDIR'] = BASEDIR +if os.path.exists(os.path.join(BASEDIR, "vpn")): + print "installing vpn" + os.system(os.path.join(BASEDIR, "vpn", "install.sh")) import zmq from setproctitle import setproctitle #pylint: disable=no-name-in-module @@ -617,9 +629,6 @@ def uninstall(): os.system("service call power 16 i32 0 s16 recovery i32 1") def main(): - # the flippening! - os.system('LD_LIBRARY_PATH="" content insert --uri content://settings/system --bind name:s:user_rotation --bind value:i:1') - if os.getenv("NOLOG") is not None: del managed_processes['loggerd'] del managed_processes['tombstoned'] @@ -638,6 +647,10 @@ def main(): del managed_processes['controlsd'] del managed_processes['radard'] + if os.path.isfile('logserver/logserver.py'): + managed_processes["logserver"] = "selfdrive.logserver.wsgi" + persistent_processes.append("logserver") + # support additional internal only extensions try: import selfdrive.manager_extensions @@ -673,7 +686,8 @@ def main(): if os.getenv("PREPAREONLY") is not None: spinner_proc = None else: - spinner_proc = subprocess.Popen(["./spinner", "loading..."], + spinner_text = "chffrplus" if params.get("Passive")=="1" else "openpilot" + spinner_proc = subprocess.Popen(["./spinner", "loading %s"%spinner_text], cwd=os.path.join(BASEDIR, "selfdrive", "ui", "spinner"), close_fds=True) try: diff --git a/selfdrive/orbd/.gitignore b/selfdrive/orbd/.gitignore new file mode 100644 index 0000000000..829780eb50 --- /dev/null +++ b/selfdrive/orbd/.gitignore @@ -0,0 +1,8 @@ +orbd +orbd_cpu +test/turbocv_profile +test/turbocv_test +dspout/* +dumb_test +bilinear_lut.h +orb_lut.h diff --git a/selfdrive/orbd/Makefile b/selfdrive/orbd/Makefile index 8847ef5d25..c33a8636bc 100644 --- a/selfdrive/orbd/Makefile +++ b/selfdrive/orbd/Makefile @@ -3,10 +3,16 @@ CC = clang CXX = clang++ +WARN_FLAGS = -Werror=implicit-function-declaration \ + -Werror=incompatible-pointer-types \ + -Werror=int-conversion \ + -Werror=return-type \ + -Werror=format-extra-args + JSON_FLAGS = -I$(PHONELIBS)/json/src -CFLAGS = -std=gnu11 -g -fPIC -O2 $(WARN_FLAGS) -Iinclude $(JSON_FLAGS) -I. -CXXFLAGS = -std=c++11 -g -fPIC -O2 $(WARN_FLAGS) -Iinclude $(JSON_FLAGS) -I. +CFLAGS = -std=gnu11 -g -O2 -fPIC $(WARN_FLAGS) -Iinclude $(JSON_FLAGS) -I. +CXXFLAGS = -std=c++11 -g -O2 -fPIC $(WARN_FLAGS) -Iinclude $(JSON_FLAGS) -I. LDFLAGS = # profile @@ -64,6 +70,7 @@ orbd: orbd_dsp.o $(DEP_OBJS) calculator_stub.o freethedsp.o %.o: %.c @echo "[ CC ] $@" $(CC) $(CFLAGS) \ + $(ZMQ_FLAGS) \ -I../ \ -I../../ \ -c -o '$@' '$<' diff --git a/selfdrive/orbd/dsp/freethedsp.c b/selfdrive/orbd/dsp/freethedsp.c index 9c5ef05983..55c20e341f 100644 --- a/selfdrive/orbd/dsp/freethedsp.c +++ b/selfdrive/orbd/dsp/freethedsp.c @@ -22,6 +22,7 @@ #define PATCH_OLD "\x40\x3f\x20\x50" #define PATCH_NEW "\x40\x3f\x00\x5a" #define PATCH_LEN (sizeof(PATCH_OLD)-1) +#define _BITS_IOCTL_H_ // under 100 lines of code begins now #include diff --git a/selfdrive/orbd/dsp/gen/libcalculator_skel.so b/selfdrive/orbd/dsp/gen/libcalculator_skel.so new file mode 100755 index 0000000000..5311d07e7a --- /dev/null +++ b/selfdrive/orbd/dsp/gen/libcalculator_skel.so @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b94bcedb39d110b074a99fe3129da2506bc4b06cca7f84731cd0620683fd1179 +size 357400 diff --git a/selfdrive/orbd/orbd.cc b/selfdrive/orbd/orbd.cc index 064980e3b0..b35a38c5a2 100644 --- a/selfdrive/orbd/orbd.cc +++ b/selfdrive/orbd/orbd.cc @@ -96,6 +96,7 @@ int main(int argc, char *argv[]) { #endif uint64_t end = nanos_since_boot(); LOGD("total(%d): %6.2f ms to get %4d features on %d", ret, (end-start)/1000000.0, features->n_corners, extra.frame_id); + assert(ret == 0); if (last_frame_id+1 != extra.frame_id) { LOGW("dropped frame!"); diff --git a/selfdrive/sensord/gpsd b/selfdrive/sensord/gpsd index 79d04c36b1..1e80018cbd 100755 --- a/selfdrive/sensord/gpsd +++ b/selfdrive/sensord/gpsd @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c91b1fe6d8e5d1eb1f7fa4d5d8cd85a2d1ae63c63c29827045538a4b0dd1041e -size 981400 +oid sha256:dde86f27dead8dc5b8e404bfc6291a2b002fdb6a7866c6705021c5e92e4ea6cc +size 1171536 diff --git a/selfdrive/sensord/sensord b/selfdrive/sensord/sensord index 95aaa5096f..e0968053e5 100755 --- a/selfdrive/sensord/sensord +++ b/selfdrive/sensord/sensord @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9eaf11b754a4fbdcf0dd37586fd2287e1edb177125a98099ddb9b99b6bef24db -size 972296 +oid sha256:994fb6530dd9afeff691d06137346239ce4dd1e0eeb42f3468ee133f7c41ddba +size 1159008 diff --git a/selfdrive/service_list.yaml b/selfdrive/service_list.yaml index a5d7fd69c9..4195ee7b54 100644 --- a/selfdrive/service_list.yaml +++ b/selfdrive/service_list.yaml @@ -74,6 +74,8 @@ testModel: [8040, false] testLiveLocation: [8045, false] testJoystick: [8056, false] +# 8080 is reserved for slave testing daemon +# 8762 is reserved for logserver # manager -- base process to manage starting and stopping of all others # subscribes: health diff --git a/selfdrive/test/plant/plant.py b/selfdrive/test/plant/plant.py index f77f2a17b0..022a576ea7 100755 --- a/selfdrive/test/plant/plant.py +++ b/selfdrive/test/plant/plant.py @@ -36,7 +36,7 @@ def car_plant(pos, speed, grade, gas, brake): speed_base = power_peak/force_peak rolling_res = 0.01 g = 9.81 - #frontal_area = 2.2 TODO: use it! + frontal_area = 2.2 air_density = 1.225 gas_to_peak_linear_slope = 3.33 brake_to_peak_linear_slope = 0.3 @@ -56,7 +56,7 @@ def car_plant(pos, speed, grade, gas, brake): creep_accel = np.interp(speed, creep_accel_bp, creep_accel_v) force_creep = creep_accel * mass - force_resistance = -(rolling_res * mass * g + 0.5 * speed**2 * aero_cd * air_density) + force_resistance = -(rolling_res * mass * g + 0.5 * speed**2 * aero_cd * air_density * frontal_area) force = force_gas + force_brake + force_resistance + force_grade + force_creep acceleration = force / mass diff --git a/selfdrive/ui/spinner/spinner b/selfdrive/ui/spinner/spinner index 5752753201..392b5bccf2 100755 --- a/selfdrive/ui/spinner/spinner +++ b/selfdrive/ui/spinner/spinner @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ecc06d8929f61f6d074e354ef5b9f782ed234db99abbbd744d0aa7eb5f19a603 -size 205056 +oid sha256:e34e6c5cf0e3e26b5a666ebcfb6353cd0cee2d760625b5b69cb938d81fbf01b1 +size 205408 diff --git a/selfdrive/ui/spinner/spinner.c b/selfdrive/ui/spinner/spinner.c index f67e310a03..477cfe1cf3 100644 --- a/selfdrive/ui/spinner/spinner.c +++ b/selfdrive/ui/spinner/spinner.c @@ -15,7 +15,6 @@ #include "common/framebuffer.h" - int main(int argc, char** argv) { int err; @@ -35,40 +34,63 @@ int main(int argc, char** argv) { NVGcontext *vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES); assert(vg); - int font = nvgCreateFont(vg, "Bold", "../../assets/courbd.ttf"); + int font = nvgCreateFont(vg, "Bold", "../../assets/OpenSans-SemiBold.ttf"); assert(font >= 0); + int spinner_img = nvgCreateImage(vg, "../../assets/img_spinner_track.png", 0); + assert(spinner_img >= 0); + int spinner_img_s = 360; + int spinner_img_x = ((fb_w/2)-(spinner_img_s/2)); + int spinner_img_y = 260; + int spinner_img_xc = (fb_w/2); + int spinner_img_yc = (fb_h/2)-100; + int spinner_comma_img = nvgCreateImage(vg, "../../assets/img_spinner_comma.png", 0); + assert(spinner_comma_img >= 0); + for (int cnt = 0; ; cnt++) { glClearColor(0.1, 0.1, 0.1, 1.0); glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); - glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); nvgBeginFrame(vg, fb_w, fb_h, 1.0f); - - for (int k=0; k<3; k++) { - float ang = (2*M_PI * (float)cnt / 120.0) + (k / 3.0) * 2*M_PI; - - nvgBeginPath(vg); - nvgStrokeColor(vg, nvgRGBA(255, 255, 255, 255)); - nvgStrokeWidth(vg, 5); - - nvgMoveTo(vg, fb_w/2 + 50 * cosf(ang), fb_h/2 + 50 * sinf(ang)); - nvgLineTo(vg, fb_w/2 + 15 * cosf(ang), fb_h/2 + 15 * sinf(ang)); - nvgMoveTo(vg, fb_w/2 - 15 * cosf(ang), fb_h/2 - 15 * sinf(ang)); - nvgLineTo(vg, fb_w/2 - 50 * cosf(ang), fb_h/2 - 50 * sinf(ang)); - nvgStroke(vg); - } - + // background + nvgBeginPath(vg); + NVGpaint bg = nvgLinearGradient(vg, fb_w, 0, fb_w, fb_h, + nvgRGBA(0, 0, 0, 175), nvgRGBA(0, 0, 0, 255)); + nvgFillPaint(vg, bg); + nvgRect(vg, 0, 0, fb_w, fb_h); + nvgFill(vg); + + // spin track + nvgSave(vg); + nvgTranslate(vg, spinner_img_xc, spinner_img_yc); + nvgRotate(vg, (3.75*M_PI * cnt/120.0)); + nvgTranslate(vg, -spinner_img_xc, -spinner_img_yc); + NVGpaint spinner_imgPaint = nvgImagePattern(vg, spinner_img_x, spinner_img_y, + spinner_img_s, spinner_img_s, 0, spinner_img, 0.6f); + nvgBeginPath(vg); + nvgFillPaint(vg, spinner_imgPaint); + nvgRect(vg, spinner_img_x, spinner_img_y, spinner_img_s, spinner_img_s); + nvgFill(vg); + nvgRestore(vg); + + // comma + NVGpaint comma_imgPaint = nvgImagePattern(vg, spinner_img_x, spinner_img_y, + spinner_img_s, spinner_img_s, 0, spinner_comma_img, 1.0f); + nvgBeginPath(vg); + nvgFillPaint(vg, comma_imgPaint); + nvgRect(vg, spinner_img_x, spinner_img_y, spinner_img_s, spinner_img_s); + nvgFill(vg); + + // message if (spintext) { nvgTextAlign(vg, NVG_ALIGN_CENTER | NVG_ALIGN_TOP); nvgFontSize(vg, 96.0f); - nvgText(vg, fb_w / 2, fb_h*2/3, spintext, NULL); + nvgText(vg, fb_w/2, (fb_h*2/3)+24, spintext, NULL); } nvgEndFrame(vg); - eglSwapBuffers(display, surface); assert(glGetError() == GL_NO_ERROR); } diff --git a/selfdrive/ui/ui.c b/selfdrive/ui/ui.c index d29ec18a13..daac5a1c86 100644 --- a/selfdrive/ui/ui.c +++ b/selfdrive/ui/ui.c @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -300,7 +301,7 @@ static const mat4 device_transform = {{ 0.0, 0.0, 0.0, 1.0, }}; -// frame from 4/3 to box size with a 2x zoon +// frame from 4/3 to box size with a 2x zoom static const mat4 frame_transform = {{ 2*(4./3.)/((float)viz_w/box_h), 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, @@ -406,7 +407,6 @@ static void ui_init(UIState *s) { } } - // If the intrinsics are in the params entry, this copies them to // intrinsic_matrix and returns true. Otherwise returns false. static bool try_load_intrinsics(mat3 *intrinsic_matrix) { @@ -566,48 +566,9 @@ vec3 car_space_to_full_frame(const UIState *s, vec4 car_space_projective) { return p_image; } -static void draw_cross(UIState *s, float x_in, float y_in, float sz, NVGcolor color) { - const UIScene *scene = &s->scene; - - nvgSave(s->vg); - - // path coords are worked out in rgb-box space - nvgTranslate(s->vg, 240.0f, 0.0); - - // zooom in 2x - nvgTranslate(s->vg, -1440.0f / 2, -1080.0f / 2); - nvgScale(s->vg, 2.0, 2.0); - - nvgScale(s->vg, 1440.0f / s->rgb_width, 1080.0f / s->rgb_height); - - nvgBeginPath(s->vg); - nvgStrokeColor(s->vg, color); - nvgStrokeWidth(s->vg, 5); - - const vec4 p_car_space = (vec4){{x_in, y_in, 0., 1.}}; - const vec3 p_full_frame = car_space_to_full_frame(s, p_car_space); - - // scale with distance - // x_in = 0 -> sz = 30 (max) - // x_in = 90 -> sz = 15 (min) - sz *= 30; - sz /= (x_in / 3 + 30); - if (sz > 30) sz = 30; - if (sz < 15) sz = 15; - - float x = p_full_frame.v[0]; - float y = p_full_frame.v[1]; - if (x >= 0 && y >= 0.) { - nvgMoveTo(s->vg, x-sz, y); - nvgLineTo(s->vg, x+sz, y); - - nvgMoveTo(s->vg, x, y-sz); - nvgLineTo(s->vg, x, y+sz); - - nvgStroke(s->vg); - } - - nvgRestore(s->vg); +// Calculate an interpolation between two numbers at a specific increment +static float lerp(float v0, float v1, float t) { + return (1 - t) * v0 + t * v1; } static void draw_chevron(UIState *s, float x_in, float y_in, float sz, @@ -634,8 +595,8 @@ static void draw_chevron(UIState *s, float x_in, float y_in, float sz, // glow nvgBeginPath(s->vg); - float g_xo = 5; - float g_yo = 2; + float g_xo = sz/5; + float g_yo = sz/10; if (x >= 0 && y >= 0.) { nvgMoveTo(s->vg, x+(sz*1.35)+g_xo, y+sz+g_yo); nvgLineTo(s->vg, x, y-g_xo); @@ -661,39 +622,28 @@ static void draw_chevron(UIState *s, float x_in, float y_in, float sz, nvgRestore(s->vg); } -static void ui_draw_lane_edge(UIState *s, const float *points, float off, - NVGcolor color, int width) { +static void ui_draw_lane_line(UIState *s, const float *points, float off, + NVGcolor color, bool is_ghost) { const UIScene *scene = &s->scene; nvgSave(s->vg); - - // path coords are worked out in rgb-box space - nvgTranslate(s->vg, 240.0f, 0.0); - - // zooom in 2x - nvgTranslate(s->vg, -1440.0f / 2, -1080.0f / 2); + nvgTranslate(s->vg, 240.0f, 0.0); // rgb-box space + nvgTranslate(s->vg, -1440.0f / 2, -1080.0f / 2); // zoom 2x nvgScale(s->vg, 2.0, 2.0); - nvgScale(s->vg, 1440.0f / s->rgb_width, 1080.0f / s->rgb_height); - nvgBeginPath(s->vg); - nvgStrokeColor(s->vg, color); - nvgStrokeWidth(s->vg, width); - bool started = false; - for (int i=0; i<50; i++) { + bool started = false; + for (int i=0; i<49; i++) { float px = (float)i; - float py = points[i] + off; - + float py = points[i] - off; vec4 p_car_space = (vec4){{px, py, 0., 1.}}; vec3 p_full_frame = car_space_to_full_frame(s, p_car_space); - float x = p_full_frame.v[0]; float y = p_full_frame.v[1]; if (x < 0 || y < 0.) { continue; } - if (!started) { nvgMoveTo(s->vg, x, y); started = true; @@ -702,17 +652,31 @@ static void ui_draw_lane_edge(UIState *s, const float *points, float off, } } - nvgStroke(s->vg); + for (int i=49; i>0; i--) { + float px = (float)i; + float py = is_ghost?(points[i]-off):(points[i]+off); + vec4 p_car_space = (vec4){{px, py, 0., 1.}}; + vec3 p_full_frame = car_space_to_full_frame(s, p_car_space); + float x = p_full_frame.v[0]; + float y = p_full_frame.v[1]; + if (x < 0 || y < 0.) { + continue; + } + nvgLineTo(s->vg, x, y); + } + nvgClosePath(s->vg); + nvgFillColor(s->vg, color); + nvgFill(s->vg); nvgRestore(s->vg); } static void ui_draw_lane(UIState *s, const PathData path, NVGcolor color) { - ui_draw_lane_edge(s, path.points, 0.0, color, 5*path.prob); + ui_draw_lane_line(s, path.points, 0.025*path.prob, color, false); float var = min(path.std, 0.7); color.a /= 4; - ui_draw_lane_edge(s, path.points, -var, color, 2); - ui_draw_lane_edge(s, path.points, var, color, 2); + ui_draw_lane_line(s, path.points, -var, color, true); + ui_draw_lane_line(s, path.points, var, color, true); } static void ui_draw_track(UIState *s, bool is_mpc) { @@ -729,25 +693,20 @@ static void ui_draw_track(UIState *s, bool is_mpc) { nvgBeginPath(s->vg); bool started = false; - - int track_start_x = 0; - int track_start_y = 0; - int track_end_x = 0; - int track_end_y = 0; - - int lead_d = (int)scene->lead_d_rel*2.; - int path_height = is_mpc?((lead_d>5)?min(lead_d, 25)-min(lead_d/5,5):20) - :((lead_d>0)?min(lead_d, 50)-min(lead_d/2.5,15):50); float off = is_mpc?0.3:0.5; + float lead_d = scene->lead_d_rel*2.; + float path_height = is_mpc?(lead_d>5.)?min(lead_d, 25.)-min(lead_d*0.35, 10.):20. + :(lead_d>0.)?min(lead_d, 50.)-min(lead_d*0.35, 10.):49.; // left side up - for (int i=0; ivg, x, y); - track_start_x = x; - track_start_y = vwp_h; started = true; } else { nvgLineTo(s->vg, x, y); @@ -770,13 +727,14 @@ static void ui_draw_track(UIState *s, bool is_mpc) { } // right side down - for (int i=path_height-1; i>0; i--) { - float px, py; + for (int i=path_height; i>=0; i--) { + float px, py, mpx; if (is_mpc) { - px = mpc_x_coords[i]; + mpx = i==0?0.0:mpc_x_coords[i]; + px = lerp(mpx+1.0, mpx, i/100.0); py = mpc_y_coords[i] + off; } else { - px = (float)i; + px = lerp(i+1.0, i, i/100.0); py = path.points[i] + off; } @@ -788,26 +746,21 @@ static void ui_draw_track(UIState *s, bool is_mpc) { continue; } - if (!started) { - nvgMoveTo(s->vg, x, y); - track_end_y = vwp_h; - track_end_x = x; - started = true; - } else { - nvgLineTo(s->vg, x, y); - } + nvgLineTo(s->vg, x, y); } + nvgClosePath(s->vg); + NVGpaint track_bg; if (is_mpc) { - // green track + // Draw colored MPC track const uint8_t *clr = bg_colors[s->status]; - track_bg = nvgLinearGradient(s->vg, track_start_x, track_start_y, track_end_x, track_end_y, - nvgRGBA(clr[0], clr[1], clr[2], 255), nvgRGBA(clr[0], clr[1], clr[2], 150)); + track_bg = nvgLinearGradient(s->vg, vwp_w, vwp_h, vwp_w, vwp_h*.4, + nvgRGBA(clr[0], clr[1], clr[2], 255), nvgRGBA(clr[0], clr[1], clr[2], 255/2)); } else { - // white track - track_bg = nvgLinearGradient(s->vg, track_start_x, track_start_y, track_end_x, track_end_y, - nvgRGBA(255, 255, 255, 150), nvgRGBA(255, 255, 255, 75)); + // Draw white vision track + track_bg = nvgLinearGradient(s->vg, vwp_w, vwp_h, vwp_w, vwp_h*.4, + nvgRGBA(255, 255, 255, 255), nvgRGBA(255, 255, 255, 0)); } nvgFillPaint(s->vg, track_bg); @@ -822,7 +775,7 @@ static void draw_steering(UIState *s, float curvature) { points[i] = y_actual; } - ui_draw_lane_edge(s, points, 0.0, nvgRGBA(0, 0, 255, 128), 5); + // ui_draw_lane_edge(s, points, 0.0, nvgRGBA(0, 0, 255, 128), 5); } static void draw_frame(UIState *s) { @@ -879,178 +832,25 @@ static void draw_frame(UIState *s) { static void ui_draw_vision_lanes(UIState *s) { const UIScene *scene = &s->scene; - if ((nanos_since_boot() - scene->model_ts) < 1000000000ULL) { - // draw left lane edge - ui_draw_lane( - s, scene->model.left_lane, - nvgRGBAf(1.0, 1.0, 1.0, scene->model.left_lane.prob)); - - // draw right lane edge - ui_draw_lane( - s, scene->model.right_lane, - nvgRGBAf(1.0, 1.0, 1.0, scene->model.right_lane.prob)); - - // draw vision path - ui_draw_track(s, false); - - // draw MPC path when engaged - if (scene->engaged) { - ui_draw_track(s, true); - } + // Draw left lane edge + ui_draw_lane( + s, scene->model.left_lane, + nvgRGBAf(1.0, 1.0, 1.0, scene->model.left_lane.prob)); + + // Draw right lane edge + ui_draw_lane( + s, scene->model.right_lane, + nvgRGBAf(1.0, 1.0, 1.0, scene->model.right_lane.prob)); + + // Draw vision path + ui_draw_track(s, false); + + if (scene->engaged) { + // Draw MPC path when engaged + ui_draw_track(s, true); } } -static void ui_draw_vision_topbar(UIState *s) { - const UIScene *scene = &s->scene; - - const int bar_x = box_x; - const int bar_y = box_y; - const int bar_width = box_w; - const int bar_height = 250 - box_y; - - assert(s->status < ARRAYSIZE(bg_colors)); - const uint8_t *color = bg_colors[s->status]; - - nvgBeginPath(s->vg); - nvgRect(s->vg, bar_x, bar_y, bar_width, bar_height); - nvgFillColor(s->vg, nvgRGBA(color[0], color[1], color[2], color[3])); - nvgFill(s->vg); - - const int message_y = box_y; - const int message_height = bar_height; - const int message_width = 800; - const int message_x = box_x + box_w / 2 - message_width / 2; - - // message background - nvgBeginPath(s->vg); - NVGpaint bg = nvgLinearGradient(s->vg, message_x, message_y, message_x, message_y+message_height, - nvgRGBAf(0.0, 0.0, 0.0, 0.0), nvgRGBAf(0.0, 0.0, 0.0, 0.1)); - nvgFillPaint(s->vg, bg); - nvgRect(s->vg, message_x, message_y, message_width, message_height); - nvgFill(s->vg); - - nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); - - if (s->passive) { - if (s->scene.started_ts > 0) { - // draw drive time when passive - - uint64_t dt = nanos_since_boot() - s->scene.started_ts; - - nvgFontFace(s->vg, "sans-semibold"); - nvgFontSize(s->vg, 40*2.5); - nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); - - char time_str[64]; - if (dt > 60*60*1000000000ULL) { - // hours - snprintf(time_str, sizeof(time_str), "Drive time: %d:%02d:%02d", - (int)(dt/(60*60*1000000000ULL)), - (int)((dt%(60*60*1000000000ULL))/(60*1000000000ULL)), - (int)(dt%(60*1000000000ULL)/1000000000ULL)); - } else { - snprintf(time_str, sizeof(time_str), "Drive time: %d:%02d", - (int)(dt/(60*1000000000ULL)), - (int)(dt%(60*1000000000ULL)/1000000000ULL)); - } - nvgText(s->vg, message_x+message_width/2, message_y+message_height/2+15, time_str, NULL); - } - } else { - // status text - nvgFontFace(s->vg, "sans-semibold"); - nvgFontSize(s->vg, 48*2.5); - nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); - if (s->scene.alert_size == cereal_Live100Data_AlertSize_small) { - nvgFontSize(s->vg, 40*2.5); - nvgText(s->vg, message_x+message_width/2, 115, s->scene.alert_text1, NULL); - nvgFontSize(s->vg, 26*2.5); - nvgText(s->vg, message_x+message_width/2, 185, s->scene.alert_text2, NULL); - } else if (s->status == STATUS_DISENGAGED) { - nvgText(s->vg, message_x+message_width/2, message_y+message_height/2+15, "DISENGAGED", NULL); - } else if (s->status == STATUS_ENGAGED) { - nvgText(s->vg, message_x+message_width/2, message_y+message_height/2+15, "ENGAGED", NULL); - } - } - - // set speed - const int left_x = bar_x; - const int left_y = bar_y; - const int left_width = (bar_width - message_width) / 2; - const int left_height = bar_height; - - nvgFontFace(s->vg, "sans-semibold"); - nvgFontSize(s->vg, 40*2.5); - nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); - - if (scene->v_cruise != 255 && scene->v_cruise != 0) { - char speed_str[16]; - if (s->is_metric) { - snprintf(speed_str, sizeof(speed_str), "%3d kph", - (int)(scene->v_cruise + 0.5)); - } else { - /* Convert KPH to MPH. Using an approximated mph to kph - conversion factor of 1.60642 because this is what the Honda - hud seems to be using */ - snprintf(speed_str, sizeof(speed_str), "%3d mph", - (int)(scene->v_cruise * 0.6225 + 0.5)); - } - nvgText(s->vg, left_x+left_width/2, 115, speed_str, NULL); - } else { - nvgText(s->vg, left_x+left_width/2, 115, "N/A", NULL); - } - - nvgFontFace(s->vg, "sans-regular"); - nvgFontSize(s->vg, 26*2.5); - nvgText(s->vg, left_x+left_width/2, 185, "SET SPEED", NULL); - - // lead car - const int right_y = bar_y; - const int right_width = (bar_width - message_width) / 2; - const int right_x = bar_x+bar_width-right_width; - const int right_height = bar_height; - - nvgFontFace(s->vg, "sans-semibold"); - nvgFontSize(s->vg, 40*2.5); - nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); - - if (scene->lead_status) { - char radar_str[16]; - // lead car is always in meters - if (s->is_metric || true) { - snprintf(radar_str, sizeof(radar_str), "%d m", (int)scene->lead_d_rel); - } else { - snprintf(radar_str, sizeof(radar_str), "%d ft", (int)(scene->lead_d_rel * 3.28084)); - } - nvgText(s->vg, right_x+right_width/2, 115, radar_str, NULL); - } else { - nvgText(s->vg, right_x+right_width/2, 115, "N/A", NULL); - } - - nvgFontFace(s->vg, "sans-regular"); - nvgFontSize(s->vg, 26*2.5); - nvgText(s->vg, right_x+right_width/2, 185, "LEAD CAR", NULL); -} - -static void ui_draw_gpsplanner_status(UIState *s) { - const UIScene *scene = &s->scene; - - int rec_width = 1120; - int x_pos = 500; - nvgBeginPath(s->vg); - nvgStrokeWidth(s->vg, 14); - nvgRoundedRect(s->vg, (1920-rec_width)/2, 920, rec_width, 225, 20); - nvgStroke(s->vg); - nvgFillColor(s->vg, nvgRGBA(0,0,0,180)); - nvgFill(s->vg); - - nvgFontSize(s->vg, 40*2.5); - nvgTextAlign(s->vg, NVG_ALIGN_LEFT | NVG_ALIGN_BASELINE); - nvgFontFace(s->vg, "sans-semibold"); - nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 220)); - nvgText(s->vg, x_pos, 1010, "GPS planner active", NULL); -} - - // Draw all world space objects. static void ui_draw_world(UIState *s) { const UIScene *scene = &s->scene; @@ -1058,9 +858,26 @@ static void ui_draw_world(UIState *s) { return; } - //draw_steering(s, scene->curvature); - ui_draw_vision_lanes(s); + if ((nanos_since_boot() - scene->model_ts) < 1000000000ULL) { + // Draw lane edges and vision/mpc tracks + ui_draw_vision_lanes(s); + } + if (scene->lead_status) { + // Draw lead car indicator + float fillAlpha = 0; + float speedBuff = 10.; + float leadBuff = 40.; + if (scene->lead_d_rel < leadBuff) { + fillAlpha = 255*(1.0-(scene->lead_d_rel/leadBuff)); + if (scene->lead_v_rel < 0) { + fillAlpha += 255*(-1*(scene->lead_v_rel/speedBuff)); + } + fillAlpha = (int)(min(fillAlpha, 255)); + } + draw_chevron(s, scene->lead_d_rel+2.7, scene->lead_y_rel, 25, + nvgRGBA(201, 34, 49, fillAlpha), nvgRGBA(218, 202, 37, 255)); + } } static void ui_draw_vision_maxspeed(UIState *s) { @@ -1288,14 +1105,8 @@ static void ui_draw_vision(UIState *s) { nvgScissor(s->vg, ui_viz_rx, box_y, ui_viz_rw, box_h); nvgTranslate(s->vg, ui_viz_rx+ui_viz_ro, box_y + (box_h-inner_height)/2.0); nvgScale(s->vg, (float)viz_w / s->fb_w, (float)inner_height / s->fb_h); - if (!scene->frontview) { ui_draw_world(s); - - if (scene->lead_status) { - draw_chevron(s, scene->lead_d_rel+2.7, scene->lead_y_rel, 30, - nvgRGBA(201, 34, 49, 255), nvgRGBA(218, 202, 37, 255)); - } } nvgRestore(s->vg); @@ -1307,11 +1118,9 @@ static void ui_draw_vision(UIState *s) { // Controls Alerts ui_draw_vision_alert(s, s->scene.alert_size, s->status, s->scene.alert_text1, s->scene.alert_text2); - } else { + } else if (scene->cal_status == CALIBRATION_UNCALIBRATED) { // Calibration Status - if (scene->cal_status == CALIBRATION_UNCALIBRATED) { - ui_draw_calibration_status(s); - } + ui_draw_calibration_status(s); } nvgEndFrame(s->vg); @@ -1323,42 +1132,6 @@ static void ui_draw_blank(UIState *s) { glClear(GL_STENCIL_BUFFER_BIT | GL_COLOR_BUFFER_BIT); } -static void ui_draw_aside(UIState *s) { - char speed_str[32]; - float speed; - - bool is_cruise_set = (s->scene.v_cruise != 0 && s->scene.v_cruise != 255); - unsigned long last_cruise_update_dt = (nanos_since_boot() - s->scene.v_cruise_update_ts); - bool should_draw_cruise_speed = is_cruise_set && last_cruise_update_dt < 2000000000ULL; - if (should_draw_cruise_speed) { - speed = s->scene.v_cruise / 3.6; - nvgFillColor(s->vg, nvgRGBA(0xFF, 0xD8, 0xAC, 0xFF)); - } else { - speed = s->scene.v_ego; - nvgFillColor(s->vg, nvgRGBA(255, 255, 255, 255)); - } - - nvgTextAlign(s->vg, NVG_ALIGN_CENTER | NVG_ALIGN_BASELINE); - - nvgFontFace(s->vg, "sans-semibold"); - nvgFontSize(s->vg, 110); - if (s->is_metric) { - snprintf(speed_str, sizeof(speed_str), "%d", (int)(speed * 3.6 + 0.5)); - } else { - snprintf(speed_str, sizeof(speed_str), "%d", (int)(speed * 2.2374144 + 0.5)); - } - nvgText(s->vg, 150, 762, speed_str, NULL); - - nvgFontFace(s->vg, "sans-regular"); - nvgFontSize(s->vg, 70); - - if (s->is_metric) { - nvgText(s->vg, 150, 817, "kph", NULL); - } else { - nvgText(s->vg, 150, 817, "mph", NULL); - } -} - static void ui_draw(UIState *s) { if (s->vision_connected && s->plus_state == 0) { ui_draw_vision(s); diff --git a/selfdrive/visiond/visiond b/selfdrive/visiond/visiond index 79c7077382..2365c32197 100755 --- a/selfdrive/visiond/visiond +++ b/selfdrive/visiond/visiond @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dc70bac15f9016c3bb28847a218acc285fe3c768fe45f6145bad4a865f1374b8 -size 13386064 +oid sha256:44325092b1355c2e078671b8d7c63459bb2a902ce55981c1709a23ecb955203d +size 13508968