Skip to content
Permalink
Browse files

openpilot v0.6.4 release

  • Loading branch information...
Vehicle Researcher
Vehicle Researcher committed Sep 9, 2019
1 parent af4f9f1 commit 61229779e4a38431e934cabe700a93e120dfa468
Showing with 2,409 additions and 1,089 deletions.
  1. +1 −0 .gitignore
  2. +63 −61 README.md
  3. +10 −0 RELEASES.md
  4. BIN apk/ai.comma.plus.offroad.apk
  5. +11 −3 common/api/__init__.py
  6. +4 −13 common/file_helpers.py
  7. +13 −2 common/params.py
  8. +73 −0 common/stat_live.py
  9. +38 −5 common/transformations/camera.py
  10. +3 −3 common/transformations/model.py
  11. BIN installer/updater/updater
  12. +70 −8 installer/updater/updater.cc
  13. BIN models/driving_model.dlc
  14. BIN panda/board/obj/panda.bin.signed
  15. +274 −0 phonelibs/boringssl/LICENSE
  16. +42 −0 phonelibs/bzip2/LICENSE
  17. BIN phonelibs/hierarchy/lib/_hierarchy.so
  18. +29 −0 phonelibs/libyuv/LICENSE
  19. +0 −1 phonelibs/openblas/libopenblas.so
  20. BIN phonelibs/openblas/libopenblas_armv8p-r0.2.19.so
  21. +19 −0 phonelibs/yaml-cpp/LICENSE
  22. +1 −1 run_docker_tests.sh
  23. BIN selfdrive/assets/sounds/disengaged.wav
  24. BIN selfdrive/assets/sounds/engaged.wav
  25. BIN selfdrive/assets/sounds/error.wav
  26. BIN selfdrive/assets/sounds/warning_1.wav
  27. BIN selfdrive/assets/sounds/warning_2.wav
  28. +2 −7 selfdrive/athena/athenad.py
  29. +4 −0 selfdrive/boardd/boardd.cc
  30. +1 −1 selfdrive/can/libdbc_py.py
  31. +15 −11 selfdrive/can/parser.cc
  32. +5 −5 selfdrive/can/parser_pyx.pxd
  33. +10 −10 selfdrive/can/parser_pyx.pyx
  34. +2 −2 selfdrive/can/tests/parser_old.py
  35. +6 −4 selfdrive/can/tests/test_packer_toyota.py
  36. +2 −3 selfdrive/can/tests/test_parser.py
  37. +12 −1 selfdrive/car/car_helpers.py
  38. +1 −1 selfdrive/car/chrysler/carcontroller.py
  39. +8 −6 selfdrive/car/chrysler/carstate.py
  40. +9 −13 selfdrive/car/chrysler/interface.py
  41. +1 −3 selfdrive/car/chrysler/radar_interface.py
  42. +87 −0 selfdrive/car/ford/carcontroller.py
  43. +54 −0 selfdrive/car/ford/fordcan.py
  44. +2 −2 selfdrive/car/ford/interface.py
  45. +1 −3 selfdrive/car/ford/radar_interface.py
  46. +12 −11 selfdrive/car/gm/interface.py
  47. +1 −3 selfdrive/car/gm/radar_interface.py
  48. +5 −2 selfdrive/car/honda/carstate.py
  49. +1 −1 selfdrive/car/honda/hondacan.py
  50. +17 −15 selfdrive/car/honda/interface.py
  51. +3 −4 selfdrive/car/honda/radar_interface.py
  52. +2 −2 selfdrive/car/honda/values.py
  53. +8 −8 selfdrive/car/hyundai/interface.py
  54. +5 −3 selfdrive/car/hyundai/radar_interface.py
  55. +7 −6 selfdrive/car/subaru/interface.py
  56. +5 −4 selfdrive/car/subaru/radar_interface.py
  57. +12 −4 selfdrive/car/toyota/carcontroller.py
  58. +25 −9 selfdrive/car/toyota/carstate.py
  59. +22 −10 selfdrive/car/toyota/interface.py
  60. +1 −3 selfdrive/car/toyota/radar_interface.py
  61. +14 −2 selfdrive/car/toyota/toyotacan.py
  62. +19 −5 selfdrive/car/toyota/values.py
  63. +4 −4 selfdrive/common/touch.c
  64. +1 −1 selfdrive/common/version.h
  65. +2 −1 selfdrive/config.py
  66. +42 −42 selfdrive/controls/controlsd.py
  67. +0 −20 selfdrive/controls/lib/drive_helpers.py
  68. +87 −80 selfdrive/controls/lib/driver_monitor.py
  69. +1 −3 selfdrive/controls/lib/fcw.py
  70. +17 −0 selfdrive/controls/lib/gps_helpers.py
  71. +12 −5 selfdrive/controls/lib/lane_planner.py
  72. +0 −62 selfdrive/controls/lib/latcontrol_helpers.py
  73. +11 −6 selfdrive/controls/lib/latcontrol_lqr.py
  74. +5 −6 selfdrive/controls/lib/long_mpc.py
  75. +9 −14 selfdrive/controls/lib/pathplanner.py
  76. +7 −13 selfdrive/controls/lib/planner.py
  77. +2 −1 selfdrive/controls/lib/radar_helpers.py
  78. +11 −12 selfdrive/controls/plannerd.py
  79. +13 −10 selfdrive/controls/radard.py
  80. +7 −6 selfdrive/controls/tests/test_following_distance.py
  81. +193 −0 selfdrive/controls/tests/test_monitoring.py
  82. +15 −12 selfdrive/locationd/calibrationd.py
  83. +52 −26 selfdrive/locationd/locationd_yawrate.cc
  84. +9 −8 selfdrive/locationd/locationd_yawrate.h
  85. +1 −1 selfdrive/locationd/params_learner.cc
  86. +20 −21 selfdrive/locationd/paramsd.cc
  87. +8 −12 selfdrive/loggerd/uploader.py
  88. +7 −5 selfdrive/manager.py
  89. +22 −3 selfdrive/messaging.py
  90. +1 −1 selfdrive/service_list.yaml
  91. +70 −20 selfdrive/test/{test_car_models_openpilot.py → test_car_models.py}
  92. +0 −1 selfdrive/test/tests/plant/test_longitudinal.py
  93. +9 −0 selfdrive/test/tests/process_replay/README.md
  94. +21 −5 selfdrive/test/tests/process_replay/compare_logs.py
  95. +184 −85 selfdrive/test/tests/process_replay/process_replay.py
  96. +1 −1 selfdrive/test/tests/process_replay/ref_commit
  97. +74 −0 selfdrive/ui/spinner/Makefile
  98. BIN selfdrive/ui/spinner/spinner
  99. +2 −81 selfdrive/ui/spinner/spinner.c
  100. +53 −79 selfdrive/ui/ui.c
  101. +172 −0 selfdrive/visiond/cameras/camera_frame_stream.cc
  102. +56 −0 selfdrive/visiond/cameras/camera_frame_stream.h
  103. +0 −131 selfdrive/visiond/models/commonmodel.c
  104. +0 −4 selfdrive/visiond/models/commonmodel.h
  105. +66 −1 selfdrive/visiond/models/driving.cc
  106. +17 −1 selfdrive/visiond/models/driving.h
  107. +25 −1 selfdrive/visiond/models/monitoring.cc
  108. +6 −0 selfdrive/visiond/models/monitoring.h
  109. +1 −0 selfdrive/visiond/runners/runmodel.h
  110. +14 −5 selfdrive/visiond/runners/snpemodel.cc
  111. +4 −1 selfdrive/visiond/runners/snpemodel.h
  112. +43 −37 selfdrive/visiond/visiond.cc
@@ -39,5 +39,6 @@ selfdrive/sensord/sensord

one
openpilot
notebooks
xx

124 README.md

Large diffs are not rendered by default.

@@ -1,3 +1,13 @@
Version 0.6.4 (2019-09-08)
========================
* Forward stock AEB for Honda Nidec
* Improve lane centering on banked roads
* Always-on forward collision warning
* Always-on driver monitoring, except for right hand drive countries
* Driver monitoring learns the user's normal driving position
* Honda Fit support thanks to energee!
* Lexus IS support

Version 0.6.3 (2019-08-12)
========================
* Alert sounds from EON: requires NEOS update
BIN +605 KB (100%) apk/ai.comma.plus.offroad.apk
Binary file not shown.
@@ -5,9 +5,10 @@
from selfdrive.version import version

class Api(object):
def __init__(self, dongle_id, private_key):
def __init__(self, dongle_id):
self.dongle_id = dongle_id
self.private_key = private_key
with open('/persist/comma/id_rsa') as f:
self.private_key = f.read()

def get(self, *args, **kwargs):
return self.request('GET', *args, **kwargs)
@@ -19,7 +20,14 @@ def request(self, method, endpoint, timeout=None, access_token=None, **params):
return api_get(endpoint, method=method, timeout=timeout, access_token=access_token, **params)

def get_token(self):
return jwt.encode({'identity': self.dongle_id, 'exp': datetime.utcnow() + timedelta(hours=1)}, self.private_key, algorithm='RS256')
now = datetime.utcnow()
payload = {
'identity': self.dongle_id,
'nbf': now,
'iat': now,
'exp': now + timedelta(hours=1)
}
return jwt.encode(payload, self.private_key, algorithm='RS256')

def api_get(endpoint, method='GET', timeout=None, access_token=None, **params):
backend = "https://api.commadotai.com/"
@@ -24,21 +24,12 @@ def rm_tree_or_link(path):
shutil.rmtree(path)

def get_tmpdir_on_same_filesystem(path):
# TODO(mgraczyk): HACK, we should actually check for which filesystem.
normpath = os.path.normpath(path)
parts = normpath.split("/")
if len(parts) > 1:
if parts[1].startswith("raid") or parts[1].startswith("datasets"):
if len(parts) > 2 and parts[2] == "runner":
return "/{}/runner/tmp".format(parts[1])
elif len(parts) > 2 and parts[2] == "aws":
return "/{}/aws/tmp".format(parts[1])
else:
return "/{}/tmp".format(parts[1])
elif parts[1] == "aws":
return "/aws/tmp"
elif parts[1] == "scratch":
return "/scratch/tmp"
if len(parts) > 1 and parts[1] == "scratch":
return "/scratch/tmp"
elif len(parts) > 2 and parts[2] == "runner":
return "/{}/runner/tmp".format(parts[1])
return "/tmp"

class AutoMoveTempdir(object):
@@ -27,6 +27,7 @@
import shutil
import fcntl
import tempfile
import threading
from enum import Enum


@@ -63,10 +64,9 @@ class UnknownKeyName(Exception):
"GitCommit": [TxType.PERSISTENT],
"GitRemote": [TxType.PERSISTENT],
"HasAcceptedTerms": [TxType.PERSISTENT],
"IsDriverMonitoringEnabled": [TxType.PERSISTENT],
"IsFcwEnabled": [TxType.PERSISTENT],
"IsGeofenceEnabled": [TxType.PERSISTENT],
"IsMetric": [TxType.PERSISTENT],
"IsRHD": [TxType.PERSISTENT],
"IsUpdateAvailable": [TxType.PERSISTENT],
"IsUploadRawEnabled": [TxType.PERSISTENT],
"IsUploadVideoOverCellularEnabled": [TxType.PERSISTENT],
@@ -346,6 +346,17 @@ def put(self, key, dat):

write_db(self.db, key, dat)


def put_nonblocking(key, val):
def f(key, val):
params = Params()
params.put(key, val)

t = threading.Thread(target=f, args=(key, val))
t.start()
return t


if __name__ == "__main__":
params = Params()
if len(sys.argv) > 2:
@@ -0,0 +1,73 @@
import numpy as np

class RunningStat():
# tracks realtime mean and standard deviation without storing any data
def __init__(self, priors=None, max_trackable=-1):
self.max_trackable = max_trackable
if priors is not None:
# initialize from history
self.M = priors[0]
self.S = priors[1]
self.n = priors[2]
self.M_last = self.M
self.S_last = self.S

else:
self.reset()

def reset(self):
self.M = 0.
self.S = 0.
self.M_last = 0.
self.S_last = 0.
self.n = 0

def push_data(self, new_data):
# short term memory hack
if self.max_trackable < 0 or self.n < self.max_trackable:
self.n += 1
if self.n == 0:
self.M_last = new_data
self.M = self.M_last
self.S_last = 0.
else:
self.M = self.M_last + (new_data - self.M_last) / self.n
self.S = self.S_last + (new_data - self.M_last) * (new_data - self.M);
self.M_last = self.M
self.S_last = self.S

def mean(self):
return self.M

def variance(self):
if self.n >= 2:
return self.S / (self.n - 1.)
else:
return 0

def std(self):
return np.sqrt(self.variance())

def params_to_save(self):
return [self.M, self.S, self.n]

class RunningStatFilter():
def __init__(self, raw_priors=None, filtered_priors=None, max_trackable=-1):
self.raw_stat = RunningStat(raw_priors, max_trackable)
self.filtered_stat = RunningStat(filtered_priors, max_trackable)

def reset(self):
self.raw_stat.reset()
self.filtered_stat.reset()

def push_and_update(self, new_data):
_std_last = self.raw_stat.std()
self.raw_stat.push_data(new_data)
_delta_std = self.raw_stat.std() - _std_last
if _delta_std<=0:
self.filtered_stat.push_data(new_data)
else:
pass
# self.filtered_stat.push_data(self.filtered_stat.mean())

# class SequentialBayesian():
@@ -154,17 +154,40 @@ def rotate_img(img, eulers, crop=None, intrinsics=eon_intrinsics):
W_border: size[1] - W_border]


def get_camera_frame_from_calib_frame(camera_frame_from_road_frame):
camera_frame_from_ground = camera_frame_from_road_frame[:, (0, 1, 3)]
calib_frame_from_ground = np.dot(eon_intrinsics,
get_view_frame_from_road_frame(0, 0, 0, 1.22))[:, (0, 1, 3)]
ground_from_calib_frame = np.linalg.inv(calib_frame_from_ground)
camera_frame_from_calib_frame = np.dot(camera_frame_from_ground, ground_from_calib_frame)
return camera_frame_from_calib_frame


def pretransform_from_calib(calib):
roll, pitch, yaw, height = calib
view_frame_from_road_frame = get_view_frame_from_road_frame(roll, pitch, yaw, height)
camera_frame_from_road_frame = np.dot(eon_intrinsics, view_frame_from_road_frame)
camera_frame_from_calib_frame = get_camera_frame_from_calib_frame(camera_frame_from_road_frame)
return np.linalg.inv(camera_frame_from_calib_frame)


def transform_img(base_img,
augment_trans=np.array([0,0,0]),
augment_eulers=np.array([0,0,0]),
from_intr=eon_intrinsics,
to_intr=eon_intrinsics,
calib_rot_view=None,
output_size=None,
pretransform=None,
top_hacks=True):
top_hacks=False,
yuv=False,
alpha=1.0,
beta=0,
blur=0):
import cv2

if yuv:
base_img = cv2.cvtColor(base_img, cv2.COLOR_YUV2RGB_I420)

size = base_img.shape[:2]
if not output_size:
output_size = size[::-1]
@@ -180,8 +203,6 @@ def get_M(h=1.22):
h*np.ones(4),
h/quadrangle_norm[:,1]))
rot = orient.rot_from_euler(augment_eulers)
if calib_rot_view is not None:
rot = calib_rot_view.dot(rot)
to_extrinsics = np.hstack((rot.T, -augment_trans[:,None]))
to_KE = to_intr.dot(to_extrinsics)
warped_quadrangle_full = np.einsum('jk,ik->ij', to_KE, np.hstack((quadrangle_world, np.ones((4,1)))))
@@ -202,7 +223,19 @@ def get_M(h=1.22):
M = M.dot(pretransform)
augmented_rgb[:cyy] = cv2.warpPerspective(base_img, M, (output_size[0], cyy), borderMode=cv2.BORDER_REPLICATE)

return augmented_rgb
# brightness and contrast augment
augmented_rgb = np.clip((float(alpha)*augmented_rgb + beta), 0, 255).astype(np.uint8)

# gaussian blur
if blur > 0:
augmented_rgb = cv2.GaussianBlur(augmented_rgb,(blur*2+1,blur*2+1),cv2.BORDER_DEFAULT)

if yuv:
augmented_img = cv2.cvtColor(augmented_rgb, cv2.COLOR_RGB2YUV_I420)
else:
augmented_img = augmented_rgb
return augmented_img


def yuv_crop(frame, output_size, center=None):
# output_size in camera coordinates so u,v
@@ -1,8 +1,8 @@
import numpy as np

from common.transformations.camera import eon_focal_length, \
vp_from_ke, get_view_frame_from_road_frame, \
FULL_FRAME_SIZE
from common.transformations.camera import (FULL_FRAME_SIZE, eon_focal_length,
get_view_frame_from_road_frame,
vp_from_ke)

# segnet

BIN +4 KB (100%) installer/updater/updater
Binary file not shown.

0 comments on commit 6122977

Please sign in to comment.
You can’t perform that action at this time.