Skip to content

Commit 1c19479

Browse files
ntstrubpd0wmandyh2
authored
Devel (#6)
* Squashed 'cereal/' changes from b8382bb..01942b8 01942b8 add TODO b74a456 don't hardcode the lists ed5a4bf add face stds 396a2bb add can error counter to controlsState c6b5c73 Switch default to msgq (commaai#21) a457ffa Fix indentation in readme.md a1fc8c7 explicitly mention Python for syntax colouring (commaai#20) 19e2393 Fix expected for cameraOdometry and liveCalibration e7d2f97 Add radar comm issue error db64cd4 Reserve safety commaai#21 for VAG PQ35/PQ46/NMS (commaai#19) 79d638d separate honda safety models between Bosch Giraffe and Bosch Nidec 2614a65 better name b6b84cd add longitudinal 78f5934 Add canRxErrs to health 6758899 qlog liveCalibration df80b87 add more stuff to fw log in CarParams a87805a fix doxs 4746b20 got doxed 21cf3f5 build on mac 31ac47c Add carUnrecognized event git-subtree-dir: cereal git-subtree-split: 01942b8 * Remove old panda subtree * Squashed 'panda/' content from commit 3b35621 git-subtree-dir: panda git-subtree-split: 3b35621 * Squashed 'opendbc/' changes from 4f82d01..5081966 5081966 One more fix fa5dc68 Fix honda dbc files after steer torque addition e4dfb2f update honda steering signals (commaai#208) 53fc448 added generator test (commaai#207) cb27d6e Honda Nidec: add new ACC_HUD signals to all other cars other than the CIVIC 6e6779f build on mac AND linux, also gotta not use these python files 79dbfc1 build on mac git-subtree-dir: opendbc git-subtree-split: 5081966 * openpilot v0.7.1 release * registration: send up both imeis * hotfix panda#426 * Panda signature needs to be bytes * update offroad apk: fix pairing * apk lib: Grant offroad access to TelephonyManager * update frame apk * catch exception in uploader.py * update common/android.py * update athenad.py Co-authored-by: Willem Melching <willem.melching@gmail.com> Co-authored-by: Andy <andyh2@me.com>
1 parent a2ae18d commit 1c19479

File tree

200 files changed

+5867
-4154
lines changed

Some content is hidden

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

200 files changed

+5867
-4154
lines changed

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ venv/
33
.tags
44
.ipynb_checkpoints
55
.idea
6+
.overlay_init
7+
.overlay_consistent
68
.sconsign.dblite
79
.vscode
810
model2.png
911
a.out
1012

13+
*.dylib
1114
*.DSYM
1215
*.d
1316
*.pyc
@@ -27,6 +30,7 @@ a.out
2730
config.json
2831
clcache
2932

33+
persist
3034
board/obj/
3135
selfdrive/boardd/boardd
3236
selfdrive/logcatd/logcatd
@@ -51,4 +55,5 @@ panda_jungle
5155

5256
.coverage*
5357
htmlcov
58+
pandaextra
5459

Dockerfile.openpilot

+2
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@ RUN apt-get update && apt-get install -y \
1717
libffi-dev \
1818
libglew-dev \
1919
libgles2-mesa-dev \
20+
libglfw3-dev \
2021
libglib2.0-0 \
2122
liblzma-dev \
2223
libmysqlclient-dev \
2324
libomp-dev \
2425
libopencv-dev \
2526
libssl-dev \
27+
libsqlite3-dev \
2628
libtool \
2729
libusb-1.0-0-dev \
2830
libzmq5-dev \

Pipfile

+3-24
Original file line numberDiff line numberDiff line change
@@ -8,71 +8,54 @@ opencv-python= "==3.4.2.17"
88
PyQt5 = "*"
99
ipython = "*"
1010
networkx = "==2.3"
11-
azure-common = "==1.1.23"
11+
azure-core = "==1.1.1"
12+
azure-common = "==1.1.24"
1213
azure-nspkg = "==3.0.2"
1314
azure-storage-blob = "==2.1.0"
1415
azure-storage-common = "==2.1.0"
1516
azure-storage-nspkg = "==3.1.0"
16-
bincopy = "*"
17-
bleach = "*"
1817
boto = "*"
1918
"boto3" = "*"
20-
celery = "*"
2119
control = "*"
2220
datadog = "*"
23-
decorator = "*"
2421
dlib = "*"
25-
dominate = "*"
2622
elasticsearch = "*"
27-
fasteners = "*"
2823
future = "*"
2924
futures = "*"
30-
gevent = "*"
3125
pycocotools = {git = "https://github.com/cocodataset/cocoapi.git",subdirectory = "PythonAPI"}
3226
gunicorn = "*"
3327
"h5py" = "*"
3428
hexdump = "*"
3529
"html5lib" = "*"
3630
imageio = "*"
37-
intervaltree = "*"
3831
ipykernel = "*"
3932
joblib = "*"
4033
json-logging-py = "*"
4134
jupyter = "*"
4235
libarchive = "*"
4336
lru-dict = "*"
44-
lxml = "*"
4537
"mpld3" = "*"
4638
msgpack-python = "*"
4739
nbstripout = "*"
48-
nose-parameterized = "*"
4940
numpy = "*"
5041
osmium = "*"
5142
pbr = "*"
5243
percache = "*"
5344
pprofile = "*"
54-
psutil = "*"
5545
pycurl = "*"
5646
git-pylint-commit-hook = "*"
5747
pymongo = "*"
5848
"pynmea2" = "*"
5949
pypolyline = "*"
60-
pysendfile = "*"
6150
python-logstash = "*"
62-
pyvcd = "*"
6351
redis = "*"
64-
redlock = "*"
6552
"s2sphere" = "*"
6653
scikit-image = "*"
6754
"subprocess32" = "*"
68-
supervisor = "*"
6955
tenacity = "*"
7056
tensorflow-gpu = ""
71-
utm = "*"
72-
"v4l2" = "*"
7357
PyJWT = "==1.4.1"
7458
PyMySQL = "==0.9.2"
75-
Theano = "*"
7659
Werkzeug = "*"
7760
"backports.lzma" = "*"
7861
Flask-Cors = "*"
@@ -84,23 +67,20 @@ PyNaCl = "*"
8467
reverse_geocoder = "*"
8568
Shapely = "*"
8669
SQLAlchemy = "*"
87-
uWSGI = "*"
8870
scipy = "*"
8971
fastcluster = "*"
9072
backports-abc = "*"
9173
pygame = "*"
9274
simplejson = "*"
9375
python-logstash-async = "*"
9476
seaborn = "*"
95-
tensorflow-estimator = "*"
9677
pyproj = "*"
9778
mock = "*"
98-
blinker = "*"
99-
gast = "==0.2.2"
10079
matplotlib = "*"
10180
dictdiffer = "*"
10281
aenum = "*"
10382
coverage = "*"
83+
azure-cli-core = "*"
10484

10585
[packages]
10686
overpy = {git = "https://github.com/commaai/python-overpy.git",ref = "f86529af402d4642e1faeb146671c40284007323"}
@@ -144,6 +124,5 @@ pillow = "*"
144124
scons = "*"
145125
cysignals = "*"
146126

147-
148127
[requires]
149128
python_version = "3.7.3"

Pipfile.lock

+678-744
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ openpilot should preserve all other vehicle's stock features, including, but are
5757
Supported Hardware
5858
------
5959

60-
At the moment, openpilot supports the [EON DevKit](https://comma.ai/shop/products/eon-dashcam-devkit). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect the EON to the car. In the future, we'd like to support other platforms as well.
60+
At the moment, openpilot supports the [EON DevKit](https://comma.ai/shop/products/eon-dashcam-devkit) and the [comma two](https://comma.ai/shop/products/comma-two-devkit). A [car harness](https://comma.ai/shop/products/car-harness) is recommended to connect the EON or comma two to the car. In the future, we'd like to support other platforms as well, like gaming PCs.
6161

6262
Supported Cars
6363
------
@@ -159,6 +159,8 @@ Limitations of openpilot ALC and LDW
159159

160160
openpilot ALC and openpilot LDW do not automatically drive the vehicle or reduce the amount of attention that must be paid to operate your vehicle. The driver must always keep control of the steering wheel and be ready to correct the openpilot ALC action at all times.
161161

162+
While changing lanes, openpilot is not capable of looking next to you or checking your blind spot. Only nudge the wheel to initiate a lane change after you have confirmed it's safe to do so.
163+
162164
Many factors can impact the performance of openpilot ALC and openpilot LDW, causing them to be unable to function as intended. These include, but are not limited to:
163165

164166
* Poor visibility (heavy rain, snow, fog, etc.) or weather conditions that may interfere with sensor operation.

RELEASES.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
Version 0.7.1 (2020-01-20)
2+
========================
3+
* comma two support!
4+
* Lane Change Assist above 45 mph!
5+
* Replace zmq with custom messaging library, msgq!
6+
* Supercombo model: calibration and driving models are combined for better lead estimate
7+
* More robust updater thanks to jyoung8607! Requires NEOS update
8+
* Improve low speed ACC tuning
9+
110
Version 0.7 (2019-12-13)
211
========================
312
* Move to SCons build system!

SConstruct

+7-2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ else:
4646
"#phonelibs/capnp-cpp/include",
4747
"#phonelibs/capnp-c/include",
4848
"#phonelibs/zmq/x64/include",
49+
"#external/tensorflow/include",
4950
]
5051
libpath = [
5152
"#phonelibs/capnp-cpp/x64/lib",
@@ -55,13 +56,15 @@ else:
5556
"#phonelibs/zmq/x64/lib",
5657
"#phonelibs/libyuv/x64/lib",
5758
"#external/zmq/lib",
59+
"#external/tensorflow/lib",
5860
"#cereal",
5961
"#selfdrive/common",
6062
"/usr/lib",
6163
"/usr/local/lib",
6264
]
6365

6466
rpath = ["phonelibs/capnp-cpp/x64/lib",
67+
"external/tensorflow/lib",
6568
"cereal",
6669
"selfdrive/common"]
6770

@@ -201,11 +204,13 @@ SConscript(['selfdrive/controls/lib/longitudinal_mpc/SConscript'])
201204
SConscript(['selfdrive/boardd/SConscript'])
202205
SConscript(['selfdrive/proclogd/SConscript'])
203206

207+
SConscript(['selfdrive/ui/SConscript'])
208+
SConscript(['selfdrive/loggerd/SConscript'])
209+
204210
if arch == "aarch64":
205211
SConscript(['selfdrive/logcatd/SConscript'])
206-
SConscript(['selfdrive/ui/SConscript'])
207212
SConscript(['selfdrive/sensord/SConscript'])
208-
SConscript(['selfdrive/loggerd/SConscript'])
213+
SConscript(['selfdrive/clocksd/SConscript'])
209214

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

apk/ai.comma.plus.frame.apk

1.7 KB
Binary file not shown.

apk/ai.comma.plus.offroad.apk

563 KB
Binary file not shown.

cereal/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ libmessaging.*
1010
libmessaging_shared.*
1111
services.h
1212
.sconsign.dblite
13-
libcereal_shared.so
13+
libcereal_shared.*
1414

cereal/README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
What is cereal?
2+
----
3+
4+
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.
5+
6+
Imagine this use case:
7+
* A sensor process reads gyro measurements directly from an IMU and publishes a sensorEvents packet
8+
* A calibration process subscribes to the sensorEvents packet to use the IMU
9+
* A localization process subscribes to the sensorEvents packet to use the IMU also
10+
11+
12+
Messaging Spec
13+
----
14+
15+
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.
16+
17+
All Events have a logMonoTime and a valid. Then a big union defines the packet type.
18+
19+
20+
Pub Sub Backends
21+
----
22+
23+
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.
24+
25+
Example
26+
---
27+
```python
28+
import cereal.messaging as messaging
29+
30+
# in subscriber
31+
sm = messaging.SubMaster(['sensorEvents'])
32+
while 1:
33+
sm.update()
34+
print(sm['sensorEvents'])
35+
36+
# in publisher
37+
pm = messaging.PubMaster(['sensorEvents'])
38+
dat = messaging.new_message()
39+
dat.init('sensorEvents', 1)
40+
dat.sensorEvents[0] = {"gyro": {"v": [0.1, -0.1, 0.1]}}
41+
pm.send('sensorEvents', dat)
42+
```

cereal/SConscript

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cereal_objects = env.SharedObject([
2929
])
3030

3131
env.Library('cereal', cereal_objects)
32-
env.SharedLibrary('cereal_shared', cereal_objects)
32+
env.SharedLibrary('cereal_shared', cereal_objects, LIBS=["capnp_c"])
3333

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

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

5555
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq'])

cereal/car.capnp

+16-4
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ struct CarEvent @0x9b1657f34caf3ad3 {
8888
lowMemory @63;
8989
stockAeb @64;
9090
ldw @65;
91+
carUnrecognized @66;
92+
radarCommIssue @67;
9193
}
9294
}
9395

@@ -410,11 +412,11 @@ struct CarParams {
410412

411413
enum SafetyModel {
412414
silent @0;
413-
honda @1;
415+
hondaNidec @1;
414416
toyota @2;
415417
elm327 @3;
416418
gm @4;
417-
hondaBosch @5;
419+
hondaBoschGiraffe @5;
418420
ford @6;
419421
cadillac @7;
420422
hyundai @8;
@@ -428,7 +430,9 @@ struct CarParams {
428430
toyotaIpas @16;
429431
allOutput @17;
430432
gmAscm @18;
431-
noOutput @19; # like silent but with silent CAN TXs
433+
noOutput @19; # like silent but without silent CAN TXs
434+
hondaBoschHarness @20;
435+
volkswagenPq @21;
432436
}
433437

434438
enum SteerControlType {
@@ -444,13 +448,21 @@ struct CarParams {
444448

445449
struct CarFw {
446450
ecu @0 :Ecu;
447-
fwVersion @1 :Text;
451+
fwVersion @1 :Data;
452+
address @2: UInt32;
453+
subAddress @3: UInt8;
448454
}
449455

450456
enum Ecu {
451457
eps @0;
452458
esp @1;
453459
fwdRadar @2;
454460
fwdCamera @3;
461+
engine @4;
462+
unknown @5;
463+
464+
# Toyota only
465+
dsu @6;
466+
apgs @7;
455467
}
456468
}

cereal/log.capnp

+11
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ struct HealthData {
310310
hasGps @6 :Bool;
311311
canSendErrs @7 :UInt32;
312312
canFwdErrs @8 :UInt32;
313+
canRxErrs @19 :UInt32;
313314
gmlanSendErrs @9 :UInt32;
314315
hwType @10 :HwType;
315316
fanSpeedRpm @11 :UInt16;
@@ -484,6 +485,7 @@ struct ControlsState @0x97ff69c53601abf1 {
484485
decelForTurn @47 :Bool;
485486

486487
decelForModel @54 :Bool;
488+
canErrorCounter @57 :UInt32;
487489

488490
lateralControlState :union {
489491
indiState @52 :LateralINDIState;
@@ -575,6 +577,7 @@ struct ModelData {
575577
leadFuture @7 :LeadData;
576578
speed @8 :List(Float32);
577579
meta @10 :MetaData;
580+
longitudinal @11 :LongitudinalData;
578581

579582
struct PathData {
580583
points @0 :List(Float32);
@@ -605,13 +608,19 @@ struct ModelData {
605608
yuvCorrection @5 :List(Float32);
606609
inputTransform @6 :List(Float32);
607610
}
611+
608612
struct MetaData {
609613
engagedProb @0 :Float32;
610614
desirePrediction @1 :List(Float32);
611615
brakeDisengageProb @2 :Float32;
612616
gasDisengageProb @3 :Float32;
613617
steerOverrideProb @4 :Float32;
614618
}
619+
620+
struct LongitudinalData {
621+
speeds @0 :List(Float32);
622+
accelerations @1 :List(Float32);
623+
}
615624
}
616625

617626
struct CalibrationFeatures {
@@ -1757,6 +1766,8 @@ struct DriverMonitoring {
17571766
leftBlinkProb @8 :Float32;
17581767
rightBlinkProb @9 :Float32;
17591768
irPwrDEPRECATED @10 :Float32;
1769+
faceOrientationStd @11 :List(Float32);
1770+
facePositionStd @12 :List(Float32);
17601771
}
17611772

17621773
struct Boot {

0 commit comments

Comments
 (0)