Skip to content

Commit baffaee

Browse files
author
Vehicle Researcher
committed
openpilot v0.8.8 release
1 parent 444aace commit baffaee

File tree

193 files changed

+60557
-1924
lines changed

Some content is hidden

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

193 files changed

+60557
-1924
lines changed

Jenkinsfile

-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ def phone_steps(String device_type, steps) {
4949
pipeline {
5050
agent none
5151
environment {
52-
COMMA_JWT = credentials('athena-test-jwt')
5352
TEST_DIR = "/data/openpilot"
5453
SOURCE_DIR = "/data/openpilot_source/"
5554
}

README.md

+8-4
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ Supported Cars
6767
| Acura | ILX 2016-19 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 25mph |
6868
| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph<sup>1</sup> | 12mph |
6969
| Acura | RDX 2019-21 | All | Stock | 0mph | 3mph |
70-
| Honda | Accord 2018-20 | All | Stock | 0mph | 3mph |
71-
| Honda | Accord Hybrid 2018-20 | All | Stock | 0mph | 3mph |
70+
| Honda | Accord 2018-21 | All | Stock | 0mph | 3mph |
71+
| Honda | Accord Hybrid 2018-21 | All | Stock | 0mph | 3mph |
7272
| Honda | Civic Hatchback 2017-21 | Honda Sensing | Stock | 0mph | 12mph |
7373
| Honda | Civic Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
7474
| Honda | Civic Coupe 2019-20 | All | Stock | 0mph | 2mph<sup>2</sup> |
@@ -110,7 +110,7 @@ Supported Cars
110110
| Toyota | C-HR 2017-20 | All | Stock | 0mph | 0mph |
111111
| Toyota | C-HR Hybrid 2017-19 | All | Stock | 0mph | 0mph |
112112
| Toyota | Corolla 2017-19 | All | Stock<sup>3</sup>| 20mph<sup>1</sup> | 0mph |
113-
| Toyota | Corolla 2020-21 | All | openpilot | 0mph | 0mph |
113+
| Toyota | Corolla 2020-22 | All | openpilot | 0mph | 0mph |
114114
| Toyota | Corolla Hatchback 2019-21 | All | openpilot | 0mph | 0mph |
115115
| Toyota | Corolla Hybrid 2020-21 | All | openpilot | 0mph | 0mph |
116116
| Toyota | Highlander 2017-19 | All | Stock<sup>3</sup>| 0mph | 0mph |
@@ -163,28 +163,32 @@ Community Maintained Cars and Features
163163
| Hyundai | Ioniq PHEV 2020 | SCC + LKAS | Stock | 0mph | 0mph |
164164
| Hyundai | Kona 2020 | SCC + LKAS | Stock | 0mph | 0mph |
165165
| Hyundai | Kona EV 2019 | SCC + LKAS | Stock | 0mph | 0mph |
166+
| Hyundai | Kona Hybrid 2020 | SCC + LKAS | Stock | 0mph | 0mph |
166167
| Hyundai | Santa Fe 2019-20 | All | Stock | 0mph | 0mph |
167168
| Hyundai | Sonata 2018-2019 | SCC + LKAS | Stock | 0mph | 0mph |
169+
| Hyundai | Sonata Hybrid 2021 | All | Stock | 0mph | 0mph |
168170
| Hyundai | Veloster 2019-20 | SCC + LKAS | Stock | 5mph | 0mph |
169171
| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
170172
| Jeep | Grand Cherokee 2019-20 | Adaptive Cruise | Stock | 0mph | 39mph |
171173
| Kia | Forte 2018-2021 | SCC + LKAS | Stock | 0mph | 0mph |
172174
| Kia | Niro EV 2020 | SCC + LKAS | Stock | 0mph | 0mph |
175+
| Kia | Niro Hybrid 2021 | SCC + LKAS | Stock | 0mph | 0mph |
173176
| Kia | Niro PHEV 2019 | SCC + LKAS | Stock | 10mph | 32mph |
174177
| Kia | Optima 2017 | SCC + LKAS | Stock | 0mph | 32mph |
175178
| Kia | Optima 2019 | SCC + LKAS | Stock | 0mph | 0mph |
176179
| Kia | Seltos 2021 | SCC + LKAS | Stock | 0mph | 0mph |
177180
| Kia | Sorento 2018-19 | SCC + LKAS | Stock | 0mph | 0mph |
178181
| Kia | Stinger 2018 | SCC + LKAS | Stock | 0mph | 0mph |
179182
| Kia | Ceed 2019 | SCC + LKAS | Stock | 0mph | 0mph |
183+
| Kia | Telluride 2020 | SCC + LKAS | Stock | 0mph | 0mph |
180184
| Nissan | Altima 2019-20 | ProPILOT | Stock | 0mph | 0mph |
181185
| Nissan | Leaf 2018-20 | ProPILOT | Stock | 0mph | 0mph |
182186
| Nissan | Rogue 2018-20 | ProPILOT | Stock | 0mph | 0mph |
183187
| Nissan | X-Trail 2017 | ProPILOT | Stock | 0mph | 0mph |
184188
| SEAT | Ateca 2018 | Driver Assistance | Stock | 0mph | 0mph |
185189
| SEAT | Leon 2014-2020 | Driver Assistance | Stock | 0mph | 0mph |
186190
| Škoda | Kodiaq 2018 | Driver Assistance | Stock | 0mph | 0mph |
187-
| Škoda | Octavia 2015, 2019 | Driver Assistance | Stock | 0mph | 0mph |
191+
| Škoda | Octavia 2015, 2018-19 | Driver Assistance | Stock | 0mph | 0mph |
188192
| Škoda | Octavia RS 2016 | Driver Assistance | Stock | 0mph | 0mph |
189193
| Škoda | Scala 2020 | Driver Assistance | Stock | 0mph | 0mph |
190194
| Škoda | Superb 2015-18 | Driver Assistance | Stock | 0mph | 0mph |

RELEASES.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
Version 0.8.8 (2021-08-27)
2+
========================
3+
* New driving model with improved laneless performance
4+
* Trained on 5000+ hours of diverse driving data from 3000+ users in 40+ countries
5+
* Better anti-cheating methods during simulator training ensure the model hugs less when in laneless mode
6+
* All new desire ground-truthing stack makes the model better at lane changes
7+
* New driver monitoring model: improved performance on comma three
8+
* NEOS 18 for comma two: update packages
9+
* AGNOS 1.3 for comma three: fix display init at high temperatures
10+
* Improved auto-exposure on comma three
11+
* Honda Accord 2021 support thanks to csouers!
12+
* Honda Accord Hybrid 2021 support thanks to csouers!
13+
* Hyundai Kona Hybrid 2020 support thanks to haram-KONA!
14+
* Hyundai Sonata Hybrid 2021 support thanks to Matt-Wash-Burn!
15+
* Kia Niro Hybrid 2021 support thanks to tetious!
16+
117
Version 0.8.7 (2021-07-31)
218
========================
319
* comma three support!

SAFETY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ used safely** and openpilot is provided with no warranty of fitness for any purp
1515
openpilot is developed in good faith to be compliant with FMVSS requirements and to follow
1616
industry standards of safety for Level 2 Driver Assistance Systems. In particular, we observe
1717
ISO26262 guidelines, including those from [pertinent documents](https://www.nhtsa.gov/sites/nhtsa.dot.gov/files/documents/13498a_812_573_alcsystemreport.pdf)
18-
released by NHTSA. In addition, we impose strict coding guidelines (like [MISRA C : 2012](https://www.misra.org.uk/MISRAHome/MISRAC2012/tabid/196/Default.aspx))
18+
released by NHTSA. In addition, we impose strict coding guidelines (like [MISRA C : 2012](https://www.misra.org.uk/what-is-misra/))
1919
on parts of openpilot that are safety relevant. We also perform software-in-the-loop,
2020
hardware-in-the-loop and in-vehicle tests before each software release.
2121

SConstruct

+16-12
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,10 @@ else:
166166
if arch != "Darwin":
167167
ldflags += ["-Wl,--as-needed"]
168168

169+
# Enable swaglog include in submodules
170+
cflags += ["-DSWAGLOG"]
171+
cxxflags += ["-DSWAGLOG"]
172+
169173
# change pythonpath to this
170174
lenv["PYTHONPATH"] = Dir("#").path
171175

@@ -344,6 +348,17 @@ if GetOption("clazy"):
344348

345349
Export('env', 'qt_env', 'arch', 'real_arch', 'SHARED', 'USE_WEBCAM')
346350

351+
SConscript(['selfdrive/common/SConscript'])
352+
Import('_common', '_gpucommon', '_gpu_libs')
353+
354+
if SHARED:
355+
common, gpucommon = abspath(common), abspath(gpucommon)
356+
else:
357+
common = [_common, 'json11']
358+
gpucommon = [_gpucommon] + _gpu_libs
359+
360+
Export('common', 'gpucommon')
361+
347362
# cereal and messaging are shared with the system
348363
SConscript(['cereal/SConscript'])
349364
if SHARED:
@@ -354,18 +369,7 @@ else:
354369
messaging = [File('#cereal/libmessaging.a')]
355370
visionipc = [File('#cereal/libvisionipc.a')]
356371

357-
Export('cereal', 'messaging')
358-
359-
SConscript(['selfdrive/common/SConscript'])
360-
Import('_common', '_gpucommon', '_gpu_libs')
361-
362-
if SHARED:
363-
common, gpucommon = abspath(common), abspath(gpucommon)
364-
else:
365-
common = [_common, 'json11']
366-
gpucommon = [_gpucommon] + _gpu_libs
367-
368-
Export('common', 'gpucommon', 'visionipc')
372+
Export('cereal', 'messaging', 'visionipc')
369373

370374
# Build rednose library and ekf models
371375

cereal/SConscript

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Import('env', 'envCython', 'arch')
1+
Import('env', 'envCython', 'arch', 'common')
22

33
import shutil
44

@@ -40,10 +40,10 @@ messaging_objects = env.SharedObject([
4040
messaging_lib = env.Library('messaging', messaging_objects)
4141
Depends('messaging/impl_zmq.cc', services_h)
4242

43-
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq'])
43+
env.Program('messaging/bridge', ['messaging/bridge.cc'], LIBS=[messaging_lib, 'zmq', common])
4444
Depends('messaging/bridge.cc', services_h)
4545

46-
envCython.Program('messaging/messaging_pyx.so', 'messaging/messaging_pyx.pyx', LIBS=envCython["LIBS"]+[messaging_lib, "zmq"])
46+
envCython.Program('messaging/messaging_pyx.so', 'messaging/messaging_pyx.pyx', LIBS=envCython["LIBS"]+[messaging_lib, "zmq", common])
4747

4848

4949
# Build Vision IPC
@@ -63,7 +63,7 @@ vipc_objects = env.SharedObject(vipc_sources)
6363
vipc = env.Library('visionipc', vipc_objects)
6464

6565

66-
libs = envCython["LIBS"]+["OpenCL", "zmq", vipc, messaging_lib]
66+
libs = envCython["LIBS"]+["OpenCL", "zmq", vipc, messaging_lib, common]
6767
if arch == "aarch64":
6868
libs += ["adreno_utils"]
6969
if arch == "Darwin":
@@ -73,5 +73,5 @@ envCython.Program('visionipc/visionipc_pyx.so', 'visionipc/visionipc_pyx.pyx', L
7373

7474

7575
if GetOption('test'):
76-
env.Program('messaging/test_runner', ['messaging/test_runner.cc', 'messaging/msgq_tests.cc'], LIBS=[messaging_lib])
77-
env.Program('visionipc/test_runner', ['visionipc/test_runner.cc', 'visionipc/visionipc_tests.cc'], LIBS=[vipc, messaging_lib, 'zmq', 'pthread', 'OpenCL'])
76+
env.Program('messaging/test_runner', ['messaging/test_runner.cc', 'messaging/msgq_tests.cc'], LIBS=[messaging_lib, common])
77+
env.Program('visionipc/test_runner', ['visionipc/test_runner.cc', 'visionipc/visionipc_tests.cc'], LIBS=[vipc, messaging_lib, 'zmq', 'pthread', 'OpenCL', common])

cereal/car.capnp

+3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
108108
driverCameraError @101;
109109
wideRoadCameraError @102;
110110
localizerMalfunction @103;
111+
highCpuUsage @105;
111112

112113
driverMonitorLowAccDEPRECATED @68;
113114
radarCanErrorDEPRECATED @15;
@@ -156,6 +157,7 @@ struct CarState {
156157

157158
# steering wheel
158159
steeringAngleDeg @7 :Float32;
160+
steeringAngleOffsetDeg @37 :Float32; # Offset betweens sensors in case there multiple
159161
steeringRateDeg @15 :Float32;
160162
steeringTorque @8 :Float32; # TODO: standardize units
161163
steeringTorqueEps @27 :Float32; # TODO: standardize units
@@ -302,6 +304,7 @@ struct CarControl {
302304
# range from -1.0 - 1.0
303305
steer @2: Float32;
304306
steeringAngleDeg @3: Float32;
307+
accel @4: Float32; # m/s^2
305308
}
306309

307310
struct CruiseControl {

cereal/log.capnp

+10-7
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,11 @@ struct CanData {
289289
}
290290

291291
struct DeviceState @0xa4d8b5af2aa492eb {
292-
freeSpacePercent @7 :Float32;
293-
memoryUsagePercent @19 :Int8;
294-
cpuUsagePercent @20 :Int8;
295-
gpuUsagePercent @33 :Int8;
296292
usbOnline @12 :Bool;
297293
networkType @22 :NetworkType;
298294
networkInfo @31 :NetworkInfo;
299-
offroadPowerUsageUwh @23 :UInt32;
300295
networkStrength @24 :NetworkStrength;
296+
offroadPowerUsageUwh @23 :UInt32;
301297
carBatteryCapacityUwh @25 :UInt32;
302298

303299
fanSpeedPercentDesired @10 :UInt16;
@@ -306,6 +302,12 @@ struct DeviceState @0xa4d8b5af2aa492eb {
306302

307303
lastAthenaPingTime @32 :UInt64;
308304

305+
# system utilization
306+
freeSpacePercent @7 :Float32;
307+
memoryUsagePercent @19 :Int8;
308+
gpuUsagePercent @33 :Int8;
309+
cpuUsagePercent @34 :List(Int8); # per-core cpu usage
310+
309311
# power
310312
batteryPercent @8 :Int16;
311313
batteryStatus @9 :Text;
@@ -365,6 +367,7 @@ struct DeviceState @0xa4d8b5af2aa492eb {
365367
gpuDEPRECATED @5 :UInt16;
366368
batDEPRECATED @6 :UInt32;
367369
pa0DEPRECATED @21 :UInt16;
370+
cpuUsagePercentDEPRECATED @20 :Int8;
368371
}
369372

370373
struct PandaState @0xa7649e2575e4591e {
@@ -432,7 +435,7 @@ struct PandaState @0xa7649e2575e4591e {
432435
pedal @4;
433436
uno @5;
434437
dos @6;
435-
red @7;
438+
redPanda @7;
436439
}
437440

438441
enum UsbPowerMode {
@@ -934,7 +937,7 @@ struct LiveLocationKalman {
934937
angularVelocityDevice @8 : Measurement;
935938

936939
# orientationNEDCalibrated transforms to rot matrix: NED_from_calibrated
937-
orientationNEDCalibrated @9 : Measurement;
940+
calibratedOrientationNED @9 : Measurement;
938941

939942
# Calibrated frame is simply device frame
940943
# aligned with the vehicle

cereal/logger/logger.h

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#pragma once
2+
3+
#ifdef SWAGLOG
4+
#include "selfdrive/common/swaglog.h"
5+
#else
6+
7+
#define CLOUDLOG_DEBUG 10
8+
#define CLOUDLOG_INFO 20
9+
#define CLOUDLOG_WARNING 30
10+
#define CLOUDLOG_ERROR 40
11+
#define CLOUDLOG_CRITICAL 50
12+
13+
#define cloudlog(lvl, fmt, ...) printf(fmt "\n", ## __VA_ARGS__)
14+
15+
#define LOGD(fmt, ...) cloudlog(CLOUDLOG_DEBUG, fmt, ## __VA_ARGS__)
16+
#define LOG(fmt, ...) cloudlog(CLOUDLOG_INFO, fmt, ## __VA_ARGS__)
17+
#define LOGW(fmt, ...) cloudlog(CLOUDLOG_WARNING, fmt, ## __VA_ARGS__)
18+
#define LOGE(fmt, ...) cloudlog(CLOUDLOG_ERROR, fmt, ## __VA_ARGS__)
19+
20+
#endif

cereal/messaging/__init__.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
assert MultiplePublishersError
1414
assert MessagingError
1515

16+
NO_TRAVERSAL_LIMIT = 2**64-1
1617
AVG_FREQ_HISTORY = 100
1718
SIMULATION = "SIMULATION" in os.environ
1819

@@ -26,6 +27,9 @@
2627

2728
context = Context()
2829

30+
def log_from_bytes(dat: bytes) -> capnp.lib.capnp._DynamicStructReader:
31+
return log.Event.from_bytes(dat, traversal_limit_in_words=NO_TRAVERSAL_LIMIT)
32+
2933
def new_message(service: Optional[str] = None, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder:
3034
dat = log.Event.new_message()
3135
dat.logMonoTime = int(sec_since_boot() * 1e9)
@@ -83,7 +87,7 @@ def drain_sock(sock: SubSocket, wait_for_one: bool = False) -> List[capnp.lib.ca
8387
if dat is None: # Timeout hit
8488
break
8589

86-
dat = log.Event.from_bytes(dat)
90+
dat = log_from_bytes(dat)
8791
ret.append(dat)
8892

8993
return ret
@@ -106,28 +110,28 @@ def recv_sock(sock: SubSocket, wait: bool = False) -> Union[None, capnp.lib.capn
106110
dat = rcv
107111

108112
if dat is not None:
109-
dat = log.Event.from_bytes(dat)
113+
dat = log_from_bytes(dat)
110114

111115
return dat
112116

113117
def recv_one(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
114118
dat = sock.receive()
115119
if dat is not None:
116-
dat = log.Event.from_bytes(dat)
120+
dat = log_from_bytes(dat)
117121
return dat
118122

119123
def recv_one_or_none(sock: SubSocket) -> Union[None, capnp.lib.capnp._DynamicStructReader]:
120124
dat = sock.receive(non_blocking=True)
121125
if dat is not None:
122-
dat = log.Event.from_bytes(dat)
126+
dat = log_from_bytes(dat)
123127
return dat
124128

125129
def recv_one_retry(sock: SubSocket) -> capnp.lib.capnp._DynamicStructReader:
126130
"""Keep receiving until we get a message"""
127131
while True:
128132
dat = sock.receive()
129133
if dat is not None:
130-
return log.Event.from_bytes(dat)
134+
return log_from_bytes(dat)
131135

132136
class SubMaster():
133137
def __init__(self, services: List[str], poll: Optional[List[str]] = None,

cereal/messaging/messaging.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class SubMaster {
6969
SubMaster(const std::vector<const char *> &service_list,
7070
const char *address = nullptr, const std::vector<const char *> &ignore_alive = {});
7171
void update(int timeout = 1000);
72-
void update_msgs(uint64_t current_time, std::vector<std::pair<std::string, cereal::Event::Reader>> messages);
72+
void update_msgs(uint64_t current_time, const std::vector<std::pair<std::string, cereal::Event::Reader>> &messages);
7373
inline bool allAlive(const std::vector<const char *> &service_list = {}) { return all_(service_list, false, true); }
7474
inline bool allValid(const std::vector<const char *> &service_list = {}) { return all_(service_list, true, false); }
7575
inline bool allAliveAndValid(const std::vector<const char *> &service_list = {}) { return all_(service_list, true, true); }

cereal/messaging/socketmaster.cc

+4-2
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,17 @@ void SubMaster::update(int timeout) {
9292
SubMessage *m = messages_.at(s);
9393

9494
m->msg_reader->~FlatArrayMessageReader();
95-
m->msg_reader = new (m->allocated_msg_reader) capnp::FlatArrayMessageReader(m->aligned_buf.align(msg));
95+
capnp::ReaderOptions options;
96+
options.traversalLimitInWords = kj::maxValue; // Don't limit
97+
m->msg_reader = new (m->allocated_msg_reader) capnp::FlatArrayMessageReader(m->aligned_buf.align(msg), options);
9698
delete msg;
9799
messages.push_back({m->name, m->msg_reader->getRoot<cereal::Event>()});
98100
}
99101

100102
update_msgs(current_time, messages);
101103
}
102104

103-
void SubMaster::update_msgs(uint64_t current_time, std::vector<std::pair<std::string, cereal::Event::Reader>> messages){
105+
void SubMaster::update_msgs(uint64_t current_time, const std::vector<std::pair<std::string, cereal::Event::Reader>> &messages){
104106
if (++frame == UINT64_MAX) frame = 1;
105107

106108
for(auto &kv : messages) {

cereal/services.py

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ def __init__(self, port: int, should_log: bool, frequency: float, decimation: Op
6161
"modelV2": (True, 20., 40),
6262
"managerState": (True, 2., 1),
6363
"uploaderState": (True, 0., 1),
64+
65+
# debug
66+
"testJoystick": (False, 0.),
6467
}
6568
service_list = {name: Service(new_port(idx), *vals) for # type: ignore
6669
idx, (name, vals) in enumerate(services.items())}

cereal/visionipc/visionbuf.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ class VisionBuf {
5555
void init_cl(cl_device_id device_id, cl_context ctx);
5656
void init_rgb(size_t width, size_t height, size_t stride);
5757
void init_yuv(size_t width, size_t height);
58-
void sync(int dir);
59-
void free();
58+
int sync(int dir);
59+
int free();
6060
};
6161

6262
void visionbuf_compute_aligned_width_and_height(int width, int height, int *aligned_w, int *aligned_h);

0 commit comments

Comments
 (0)