Skip to content

Commit

Permalink
Merge pull request emmertex#46 from Kyroapps/HKG_community
Browse files Browse the repository at this point in the history
Lane Change Assist With Blind Spot Monitoring
  • Loading branch information
xx979xx authored Jan 25, 2020
2 parents 9fb5d10 + 84b853d commit 63502ac
Show file tree
Hide file tree
Showing 205 changed files with 6,094 additions and 4,336 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ venv/
.tags
.ipynb_checkpoints
.idea
.overlay_init
.overlay_consistent
.sconsign.dblite
.vscode
model2.png
a.out

*.dylib
*.DSYM
*.d
*.pyc
Expand All @@ -27,6 +30,7 @@ a.out
config.json
clcache

persist
board/obj/
selfdrive/boardd/boardd
selfdrive/logcatd/logcatd
Expand All @@ -51,4 +55,5 @@ panda_jungle

.coverage*
htmlcov
pandaextra

2 changes: 2 additions & 0 deletions Dockerfile.openpilot
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ RUN apt-get update && apt-get install -y \
libffi-dev \
libglew-dev \
libgles2-mesa-dev \
libglfw3-dev \
libglib2.0-0 \
liblzma-dev \
libmysqlclient-dev \
libomp-dev \
libopencv-dev \
libssl-dev \
libsqlite3-dev \
libtool \
libusb-1.0-0-dev \
libzmq5-dev \
Expand Down
27 changes: 3 additions & 24 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,71 +8,54 @@ opencv-python= "==3.4.2.17"
PyQt5 = "*"
ipython = "*"
networkx = "==2.3"
azure-common = "==1.1.23"
azure-core = "==1.1.1"
azure-common = "==1.1.24"
azure-nspkg = "==3.0.2"
azure-storage-blob = "==2.1.0"
azure-storage-common = "==2.1.0"
azure-storage-nspkg = "==3.1.0"
bincopy = "*"
bleach = "*"
boto = "*"
"boto3" = "*"
celery = "*"
control = "*"
datadog = "*"
decorator = "*"
dlib = "*"
dominate = "*"
elasticsearch = "*"
fasteners = "*"
future = "*"
futures = "*"
gevent = "*"
pycocotools = {git = "https://github.com/cocodataset/cocoapi.git",subdirectory = "PythonAPI"}
gunicorn = "*"
"h5py" = "*"
hexdump = "*"
"html5lib" = "*"
imageio = "*"
intervaltree = "*"
ipykernel = "*"
joblib = "*"
json-logging-py = "*"
jupyter = "*"
libarchive = "*"
lru-dict = "*"
lxml = "*"
"mpld3" = "*"
msgpack-python = "*"
nbstripout = "*"
nose-parameterized = "*"
numpy = "*"
osmium = "*"
pbr = "*"
percache = "*"
pprofile = "*"
psutil = "*"
pycurl = "*"
git-pylint-commit-hook = "*"
pymongo = "*"
"pynmea2" = "*"
pypolyline = "*"
pysendfile = "*"
python-logstash = "*"
pyvcd = "*"
redis = "*"
redlock = "*"
"s2sphere" = "*"
scikit-image = "*"
"subprocess32" = "*"
supervisor = "*"
tenacity = "*"
tensorflow-gpu = ""
utm = "*"
"v4l2" = "*"
PyJWT = "==1.4.1"
PyMySQL = "==0.9.2"
Theano = "*"
Werkzeug = "*"
"backports.lzma" = "*"
Flask-Cors = "*"
Expand All @@ -84,23 +67,20 @@ PyNaCl = "*"
reverse_geocoder = "*"
Shapely = "*"
SQLAlchemy = "*"
uWSGI = "*"
scipy = "*"
fastcluster = "*"
backports-abc = "*"
pygame = "*"
simplejson = "*"
python-logstash-async = "*"
seaborn = "*"
tensorflow-estimator = "*"
pyproj = "*"
mock = "*"
blinker = "*"
gast = "==0.2.2"
matplotlib = "*"
dictdiffer = "*"
aenum = "*"
coverage = "*"
azure-cli-core = "*"

[packages]
overpy = {git = "https://github.com/commaai/python-overpy.git",ref = "f86529af402d4642e1faeb146671c40284007323"}
Expand Down Expand Up @@ -144,6 +124,5 @@ pillow = "*"
scons = "*"
cysignals = "*"


[requires]
python_version = "3.7.3"
1,422 changes: 678 additions & 744 deletions Pipfile.lock

Large diffs are not rendered by default.

147 changes: 74 additions & 73 deletions README_openpilot.md

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
Version 0.7.1 (2020-01-20)
========================
* comma two support!
* Lane Change Assist above 45 mph!
* Replace zmq with custom messaging library, msgq!
* Supercombo model: calibration and driving models are combined for better lead estimate
* More robust updater thanks to jyoung8607! Requires NEOS update
* Improve low speed ACC tuning

Version 0.7 (2019-12-13)
========================
* Move to SCons build system!
Expand Down
9 changes: 7 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ else:
"#phonelibs/capnp-cpp/include",
"#phonelibs/capnp-c/include",
"#phonelibs/zmq/x64/include",
"#external/tensorflow/include",
]
libpath = [
"#phonelibs/capnp-cpp/x64/lib",
Expand All @@ -55,13 +56,15 @@ else:
"#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",
"external/tensorflow/lib",
"cereal",
"selfdrive/common"]

Expand Down Expand Up @@ -201,11 +204,13 @@ SConscript(['selfdrive/controls/lib/longitudinal_mpc/SConscript'])
SConscript(['selfdrive/boardd/SConscript'])
SConscript(['selfdrive/proclogd/SConscript'])

SConscript(['selfdrive/ui/SConscript'])
SConscript(['selfdrive/loggerd/SConscript'])

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

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

Expand Down
Binary file modified apk/ai.comma.plus.frame.apk
Binary file not shown.
Binary file modified apk/ai.comma.plus.offroad.apk
Binary file not shown.
2 changes: 1 addition & 1 deletion cereal/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ libmessaging.*
libmessaging_shared.*
services.h
.sconsign.dblite
libcereal_shared.so
libcereal_shared.*

42 changes: 42 additions & 0 deletions cereal/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
What is cereal?
----

cereal is both a messaging spec for robotics systems as well as generic high performance IPC pub sub messaging with a single publisher and multiple subscribers.

Imagine this use case:
* A sensor process reads gyro measurements directly from an IMU and publishes a sensorEvents packet
* A calibration process subscribes to the sensorEvents packet to use the IMU
* A localization process subscribes to the sensorEvents packet to use the IMU also


Messaging Spec
----

You'll find the message types in [log.capnp](log.capnp). It uses [Cap'n proto](https://capnproto.org/capnp-tool.html) and defines one struct called Event.

All Events have a logMonoTime and a valid. Then a big union defines the packet type.


Pub Sub Backends
----

cereal supports two backends, one based on [zmq](https://zeromq.org/), the other called msgq, a custom pub sub based on shared memory that doesn't require the bytes to pass through the kernel.

Example
---
```python
import cereal.messaging as messaging

# in subscriber
sm = messaging.SubMaster(['sensorEvents'])
while 1:
sm.update()
print(sm['sensorEvents'])

# in publisher
pm = messaging.PubMaster(['sensorEvents'])
dat = messaging.new_message()
dat.init('sensorEvents', 1)
dat.sensorEvents[0] = {"gyro": {"v": [0.1, -0.1, 0.1]}}
pm.send('sensorEvents', dat)
```
4 changes: 2 additions & 2 deletions cereal/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cereal_objects = env.SharedObject([
])

env.Library('cereal', cereal_objects)
env.SharedLibrary('cereal_shared', cereal_objects)
env.SharedLibrary('cereal_shared', cereal_objects, LIBS=["capnp_c"])

cereal_dir = Dir('.')
services_h = env.Command(
Expand All @@ -49,7 +49,7 @@ Depends('messaging/impl_zmq.cc', services_h)

# note, this rebuilds the deps shared, zmq is statically linked to make APK happy
# TODO: get APK to load system zmq to remove the static link
shared_lib_shared_lib = [zmq, 'm', 'stdc++'] + ["gnustl_shared"] if arch == "aarch64" else []
shared_lib_shared_lib = [zmq, 'm', 'stdc++'] + ["gnustl_shared"] if arch == "aarch64" else [zmq]
env.SharedLibrary('messaging_shared', messaging_objects, LIBS=shared_lib_shared_lib)

env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq'])
Expand Down
27 changes: 21 additions & 6 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,13 @@ struct CarEvent @0x9b1657f34caf3ad3 {
lowMemory @63;
stockAeb @64;
ldw @65;
turningIndicatorOn @66;
lkasButtonOff @67;
carUnrecognized @66;
radarCommIssue @67;
turningIndicatorOn @68;
lkasButtonOff @69;
rightLCAbsm @70;
leftLCAbsm @71;
preventLCA @72;
}
}

Expand Down Expand Up @@ -419,11 +424,11 @@ struct CarParams {

enum SafetyModel {
silent @0;
honda @1;
hondaNidec @1;
toyota @2;
elm327 @3;
gm @4;
hondaBosch @5;
hondaBoschGiraffe @5;
ford @6;
cadillac @7;
hyundai @8;
Expand All @@ -437,7 +442,9 @@ struct CarParams {
toyotaIpas @16;
allOutput @17;
gmAscm @18;
noOutput @19; # like silent but with silent CAN TXs
noOutput @19; # like silent but without silent CAN TXs
hondaBoschHarness @20;
volkswagenPq @21;
}

enum SteerControlType {
Expand All @@ -453,13 +460,21 @@ struct CarParams {

struct CarFw {
ecu @0 :Ecu;
fwVersion @1 :Text;
fwVersion @1 :Data;
address @2: UInt32;
subAddress @3: UInt8;
}

enum Ecu {
eps @0;
esp @1;
fwdRadar @2;
fwdCamera @3;
engine @4;
unknown @5;

# Toyota only
dsu @6;
apgs @7;
}
}
Loading

0 comments on commit 63502ac

Please sign in to comment.