Skip to content

Commit

Permalink
openpilot v0.7.6 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Vehicle Researcher committed May 31, 2020
1 parent 2d659de commit 4fd2b0e
Show file tree
Hide file tree
Showing 733 changed files with 6,131 additions and 211,233 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ panda_jungle

.coverage*
coverage.xml
cppcheck_report.txt
htmlcov
pandaextra

.mypy_cache/
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Our software is open source so you can solve your own problems without needing help from others. And if you solve a problem and are so kind, you can upstream it for the rest of the world to use.

Most open source development activity is coordinated through our [Discord](https://discord.comma.ai). A lot of documentation is available on our [medium](https://medium.com/@comma_ai/)
Most open source development activity is coordinated through our [Discord](https://discord.comma.ai). A lot of documentation is available on our [medium](https://medium.com/@comma_ai/).

## Getting Started

Expand All @@ -18,7 +18,7 @@ You can test your changes on your machine by running `run_docker_tests.sh`. This

### Automated Testing

All PRs are automatically checked by Github Actions. Check out `.github/workflows/` for what Github Actions runs. Any new tests sould be added to Github Actions.
All PRs and commits are automatically checked by Github Actions. Check out `.github/workflows/` for what Github Actions runs. Any new tests sould be added to Github Actions.

### Code Style and Linting

Expand Down Expand Up @@ -48,3 +48,4 @@ Modules that are in seperate repositories include:
* laika
* opendbc
* panda
* rednose
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Supported Cars
| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
| Honda | Civic Sedan/Coupe 2019-20 | Honda Sensing | Stock | 0mph | 2mph<sup>2</sup> |
| Honda | CR-V 2015-16 | Touring | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | CR-V 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | CR-V 2017-20 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Stock | 0mph | 12mph |
| Honda | Fit 2018-19 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
| Honda | HR-V 2019 | Honda Sensing | openpilot | 25mph<sup>1</sup> | 12mph |
Expand All @@ -91,6 +91,7 @@ Supported Cars
| Lexus | RX 2016-17 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | RX 2020 | All | openpilot | 0mph | 0mph |
| Lexus | RX Hybrid 2016-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Lexus | RX Hybrid 2020 | All | openpilot | 0mph | 0mph |
| Toyota | Avalon 2016 | TSS-P | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Avalon 2017-18 | All | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
| Toyota | Camry 2018-20 | All | Stock | 0mph<sup>4</sup> | 0mph |
Expand All @@ -114,7 +115,7 @@ Supported Cars
| Toyota | Rav4 Hybrid 2016 | TSS-P | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2017-18 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Rav4 Hybrid 2019-20 | All | openpilot | 0mph | 0mph |
| Toyota | Sienna 2018 | All | Stock<sup>3</sup>| 0mph | 0mph |
| Toyota | Sienna 2018-20 | All | Stock<sup>3</sup>| 0mph | 0mph |

<sup>1</sup>[Comma Pedal](https://community.comma.ai/wiki/index.php/Comma_Pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. Here is how to [build a Comma Pedal](https://medium.com/@jfrux/comma-pedal-building-with-macrofab-6328bea791e8). ***NOTE: The Comma Pedal is not officially supported by [comma](https://comma.ai).*** <br />
<sup>2</sup>2019 Honda Civic 1.6L Diesel Sedan does not have ALC below 12mph. <br />
Expand All @@ -135,34 +136,32 @@ Community Maintained Cars and Features
| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Chrysler | Pacifica Hybrid 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
| Genesis | G80 2018<sup>2</sup> | All | Stock | 0mph | 0mph |
| Genesis | G90 2018<sup>2</sup> | All | Stock | 0mph | 0mph |
| GMC | Acadia Denali 2018<sup>3</sup>| Adaptive Cruise | openpilot | 0mph | 7mph |
| Genesis | G90 2018 | All | Stock | 0mph | 0mph |
| GMC | Acadia Denali 2018<sup>2</sup>| Adaptive Cruise | openpilot | 0mph | 7mph |
| Holden | Astra 2017<sup>1</sup> | Adaptive Cruise | openpilot | 0mph | 7mph |
| Hyundai | Elantra 2017-19<sup>2</sup> | SCC + LKAS | Stock | 19mph | 34mph |
| Hyundai | Genesis 2015-16<sup>2</sup> | SCC + LKAS | Stock | 19mph | 37mph |
| Hyundai | Ioniq 2017<sup>2</sup> | SCC + LKAS | Stock | 0mph | 32mph |
| Hyundai | Ioniq 2019 EV<sup>2</sup> | SCC + LKAS | Stock | 0mph | 32mph |
| Hyundai | Kona 2017-19<sup>2</sup> | SCC + LKAS | Stock | 22mph | 0mph |
| Hyundai | Kona 2019 EV<sup>2</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Hyundai | Palisade 2020<sup>2</sup> | All | Stock | 0mph | 0mph |
| Hyundai | Santa Fe 2019<sup>2</sup> | All | Stock | 0mph | 0mph |
| Hyundai | Sonata 2020<sup>2</sup> | All | Stock | 0mph | 0mph |
| Hyundai | Santa Fe 2019 | All | Stock | 0mph | 0mph |
| Hyundai | Sonata 2019-20 | All | Stock | 0mph | 0mph |
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
| Jeep | Grand Cherokee 2019 | Adaptive Cruise | Stock | 0mph | 39mph |
| Kia | Forte 2018<sup>2</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Forte 2018-19<sup>2</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Optima 2017<sup>2</sup> | SCC + LKAS/LDWS | Stock | 0mph | 32mph |
| Kia | Optima 2019<sup>2</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Sorento 2018<sup>2</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Kia | Stinger 2018<sup>2</sup> | SCC + LKAS | Stock | 0mph | 0mph |
| Nissan | Leaf 2019 | Propilot | Stock | 0mph | 0mph |
| Nissan | X-Trail 2018 | Propilot | Stock | 0mph | 0mph |
| Nissan | Leaf 2018-19<sup>2</sup> | Propilot | Stock | 0mph | 0mph |
| Nissan | Rogue 2019<sup>2</sup> | Propilot | Stock | 0mph | 0mph |
| Nissan | X-Trail 2017<sup>2</sup> | Propilot | Stock | 0mph | 0mph |
| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
| Subaru | Impreza 2018-20 | EyeSight | Stock | 0mph | 0mph |
| Volkswagen| Golf 2016-19<sup>3</sup> | Driver Assistance | Stock | 0mph | 0mph |
| Volkswagen| Golf 2015-19 | Driver Assistance | Stock | 0mph | 0mph |

<sup>1</sup>Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and [community built giraffe](https://zoneos.com/volt/). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).*** <br />
<sup>2</sup>Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and open sourced [Hyundai giraffe](https://github.com/commaai/neo/tree/master/giraffe/hyundai), designed for the 2019 Sante Fe; pinout may differ for other Hyundai and Kia models. <br />
<sup>3</sup>Requires a [custom connector](https://community.comma.ai/wiki/index.php/Volkswagen#Integration_at_R242_Camera) for the [car harness](https://comma.ai/shop/products/car-harness) <br />
<sup>2</sup>May require a custom connector for the developer [car harness](https://comma.ai/shop/products/car-harness) <br />

Although it's not upstream, there's a community of people getting openpilot to run on Tesla's [here](https://tinkla.us/)

Expand Down Expand Up @@ -328,6 +327,7 @@ NO WARRANTY EXPRESSED OR IMPLIED.**

<img src="https://d1qb2nb5cznatu.cloudfront.net/startups/i/1061157-bc7e9bf3b246ece7322e6ffe653f6af8-medium_jpg.jpg?buster=1458363130" width="75"></img> <img src="https://cdn-images-1.medium.com/max/1600/1*C87EjxGeMPrkTuVRVWVg4w.png" width="225"></img>

[![openpilot tests](https://github.com/commaai/openpilot/workflows/openpilot%20tests/badge.svg)](https://github.com/commaai/openpilot/actions)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/commaai/openpilot.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/commaai/openpilot/alerts/)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/commaai/openpilot.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/commaai/openpilot/context:python)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/commaai/openpilot.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/commaai/openpilot/context:cpp)
Expand Down
9 changes: 8 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
Version 0.7.6 (2020-06-05)
========================
* White panda is deprecated, upgrade to comma two or black panda
* 2017 Nissan X-Trail, 2018-19 Leaf and 2019 Rogue support thanks to avolmensky!
* 2017 Mazda CX-5 support in dashcam mode thanks to Jafaral!
* Huge CPU savings in modeld by using thneed!
* Lots of code cleanup and refactors

Version 0.7.5 (2020-05-13)
========================
* Right-Hand Drive support for both driving and driver monitoring!
* New driving model: improved at sharp turns and lead speed estimation
* New driver monitoring model: overall improvement on comma two
* Driver camera preview in settings to improve mounting position
* Added support for many Hyundai, Kia, Genesis models thanks to xx979xx!
* 2019 Nissan X-Trail and 2018 Nissan Leaf support thanks to avolmensky!
* Improved lateral tuning for 2020 Toyota Rav 4 (hybrid)

Version 0.7.4 (2020-03-20)
Expand Down
35 changes: 11 additions & 24 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,9 @@ if arch == "aarch64" or arch == "larch64":
]

if arch == "larch64":
cpppath += ["#phonelibs/capnp-cpp/include"]
libpath += ["#phonelibs/snpe/larch64"]
libpath += ["#phonelibs/libyuv/larch64/lib"]
libpath += ["#external/capnparm/lib", "/usr/lib/aarch64-linux-gnu"]
libpath += ["/usr/lib/aarch64-linux-gnu"]
cflags = ["-DQCOM2", "-mcpu=cortex-a57"]
cxxflags = ["-DQCOM2", "-mcpu=cortex-a57"]
rpath = ["/usr/local/lib"]
Expand All @@ -62,14 +61,11 @@ else:
"PATH": "#external/bin:" + os.environ['PATH'],
}
cpppath = [
"#phonelibs/capnp-cpp/include",
"#phonelibs/zmq/x64/include",
"#external/tensorflow/include",
]

if arch == "Darwin":
libpath = [
"#phonelibs/capnp-cpp/mac/lib",
"#phonelibs/libyuv/mac/lib",
"#cereal",
"#selfdrive/common",
Expand All @@ -78,20 +74,16 @@ else:
]
else:
libpath = [
"#phonelibs/capnp-cpp/x64/lib",
"#phonelibs/snpe/x86_64-linux-clang",
"#phonelibs/zmq/x64/lib",
"#phonelibs/libyuv/x64/lib",
"#external/zmq/lib",
"#external/tensorflow/lib",
"#cereal",
"#selfdrive/common",
"/usr/lib",
"/usr/local/lib",
]

rpath = ["phonelibs/capnp-cpp/x64/lib",
"phonelibs/zmq/x64/lib",
rpath = [
"external/tensorflow/lib",
"cereal",
"selfdrive/common"]
Expand All @@ -114,11 +106,9 @@ env = Environment(
"-g",
"-fPIC",
"-O2",
"-Werror=implicit-function-declaration",
"-Werror=incompatible-pointer-types",
"-Werror=int-conversion",
"-Werror=return-type",
"-Werror=format-extra-args",
"-Werror",
"-Wno-deprecated-register",
"-Wno-inconsistent-missing-override",
] + cflags + ccflags_asan,

CPPPATH=cpppath + [
Expand All @@ -128,7 +118,6 @@ env = Environment(
"#phonelibs/libyuv/include",
"#phonelibs/openmax/include",
"#phonelibs/json11",
"#phonelibs/eigen",
"#phonelibs/curl/include",
#"#phonelibs/opencv/include", # use opencv4 instead
"#phonelibs/libgralloc/include",
Expand Down Expand Up @@ -189,10 +178,7 @@ def abspath(x):
return x[0].path.rsplit("/", 1)[1][:-3]

# still needed for apks
if arch == 'larch64':
zmq = 'zmq'
else:
zmq = FindFile("libzmq.a", libpath)
zmq = 'zmq'
Export('env', 'arch', 'zmq', 'SHARED', 'webcam')

# cereal and messaging are shared with the system
Expand Down Expand Up @@ -238,11 +224,12 @@ SConscript(['selfdrive/proclogd/SConscript'])
SConscript(['selfdrive/ui/SConscript'])
SConscript(['selfdrive/loggerd/SConscript'])

SConscript(['selfdrive/locationd/SConscript'])
SConscript(['selfdrive/locationd/models/SConscript'])

if arch == "aarch64":
SConscript(['selfdrive/logcatd/SConscript'])
SConscript(['selfdrive/sensord/SConscript'])
SConscript(['selfdrive/clocksd/SConscript'])

SConscript(['selfdrive/locationd/SConscript'])
SConscript(['selfdrive/locationd/kalman/SConscript'])
SConscript(['tools/lib/index_log/SConscript'])
else:
SConscript(['tools/lib/index_log/SConscript'])
Binary file modified apk/ai.comma.plus.offroad.apk
Binary file not shown.
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
comment: false
coverage:
status:
project:
Expand Down
5 changes: 3 additions & 2 deletions common/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ def get_imei(slot):
if slot not in ("0", "1"):
raise ValueError("SIM slot must be 0 or 1")

ret = parse_service_call_string(service_call(["iphonesubinfo", "3" ,"i32", str(slot)]))
ret = parse_service_call_string(service_call(["iphonesubinfo", "3" , "i32", str(slot)]))
if not ret:
# allow non android to be identified differently
ret = "%015d" % random.randint(0, 1<<32)
ret = "%015d" % random.randint(0, 1 << 32)
return ret

def get_serial():
Expand Down Expand Up @@ -132,6 +132,7 @@ def get_network_type():

def get_network_strength(network_type):
network_strength = NetworkStrength.unknown

# from SignalStrength.java
def get_lte_level(rsrp, rssnr):
INT_MAX = 2147483647
Expand Down
1 change: 0 additions & 1 deletion common/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,3 @@ def api_get(endpoint, method='GET', timeout=None, access_token=None, **params):
headers['User-Agent'] = "openpilot-" + version

return requests.request(method, backend+endpoint, timeout=timeout, headers = headers, params=params)

2 changes: 1 addition & 1 deletion common/apk.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_installed_apks():
ret = {}
for x in dat:
if x.startswith("package:"):
v,k = x.split("package:")[1].split("=")
v, k = x.split("package:")[1].split("=")
ret[k] = v
return ret

Expand Down
1 change: 0 additions & 1 deletion common/basedir.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@
else:
PERSIST = os.path.join(BASEDIR, "persist")
PARAMS = os.path.join(BASEDIR, "persist", "params")

6 changes: 4 additions & 2 deletions common/file_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def name(self):
def close(self):
os.rename(self._path, self._target_path)

def __enter__(self): return self
def __enter__(self):
return self

def __exit__(self, type, value, traceback):
if type is None:
Expand All @@ -63,7 +64,8 @@ def name(self):
def close(self):
shutil.rmtree(self._path)

def __enter__(self): return self
def __enter__(self):
return self

def __exit__(self, type, value, traceback):
self.close()
Expand Down
7 changes: 5 additions & 2 deletions common/logging_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ class SwagErrorFilter(logging.Filter):
def filter(self, record):
return record.levelno < logging.ERROR

_tmpfunc = lambda: 0
_srcfile = os.path.normcase(_tmpfunc.__code__.co_filename)
def _tmpfunc():
return 0

def _srcfile():
return os.path.normcase(_tmpfunc.__code__.co_filename)

class SwagLogger(logging.Logger):
def __init__(self):
Expand Down
4 changes: 2 additions & 2 deletions common/manager_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ def print_cpu_usage(first_proc, last_proc):
r = 0
procs = [
("selfdrive.controls.controlsd", 59.46),
("./_modeld", 48.94),
("./_modeld", 6.75),
("./loggerd", 28.49),
("selfdrive.controls.plannerd", 19.77),
("selfdrive.controls.radard", 9.54),
("./_ui", 9.54),
("./camerad", 7.07),
("selfdrive.locationd.locationd", 7.13),
("selfdrive.locationd.locationd", 27.46),
("./_sensord", 6.17),
("selfdrive.controls.dmonitoringd", 5.48),
("./boardd", 3.63),
Expand Down
5 changes: 3 additions & 2 deletions common/numpy_fast.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def clip(x, lo, hi):

def interp(x, xp, fp):
N = len(xp)

def get_interp(xv):
hi = 0
while hi < N and xv > xp[hi]:
Expand All @@ -14,8 +15,8 @@ def get_interp(xv):
return fp[-1] if hi == N and xv > xp[low] else (
fp[0] if hi == 0 else
(xv - xp[low]) * (fp[hi] - fp[low]) / (xp[hi] - xp[low]) + fp[low])
return [get_interp(v) for v in x] if hasattr(
x, '__iter__') else get_interp(x)

return [get_interp(v) for v in x] if hasattr(x, '__iter__') else get_interp(x)

def mean(x):
return sum(x) / len(x)
25 changes: 2 additions & 23 deletions common/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
"""
import time
import os
import string
import binascii
import errno
import sys
import shutil
import fcntl
import tempfile
Expand Down Expand Up @@ -198,7 +195,8 @@ def __enter__(self):
finally:
lock.release()

def __exit__(self, type, value, traceback): pass
def __exit__(self, type, value, traceback):
pass


class DBWriter(DBAccessor):
Expand Down Expand Up @@ -401,22 +399,3 @@ def f(key, val):
t = threading.Thread(target=f, args=(key, val))
t.start()
return t


if __name__ == "__main__":
params = Params()
if len(sys.argv) > 2:
params.put(sys.argv[1], sys.argv[2])
else:
for k in keys:
pp = params.get(k)
if pp is None:
print("%s is None" % k)
elif all(chr(c) in string.printable for c in pp):
print("%s = %s" % (k, pp))
else:
print("%s = %s" % (k, binascii.hexlify(pp)))

# Test multiprocess:
# seq 0 100000 | xargs -P20 -I{} python common/params.py DongleId {} && sleep 0.05
# while python common/params.py DongleId; do sleep 0.05; done
1 change: 0 additions & 1 deletion common/profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@ def display(self):
else:
print("%30s: %9.2f percent: %3.0f" % (n, ms*1000.0, ms/self.tot*100))
print("Iter clock: %2.6f TOTAL: %2.2f" % (self.tot/self.iter, self.tot))

Loading

0 comments on commit 4fd2b0e

Please sign in to comment.