Skip to content

Commit 0932b36

Browse files
author
Vehicle Researcher
committed
openpilot v0.5.12 release
old-commit-hash: 3f9059f
1 parent d34a9b9 commit 0932b36

File tree

177 files changed

+2915
-832
lines changed

Some content is hidden

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

177 files changed

+2915
-832
lines changed

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ script:
1313
tmppilot /bin/sh -c 'cd /tmp/openpilot/ && pyflakes $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")'
1414
- docker run
1515
tmppilot /bin/sh -c 'cd /tmp/openpilot/ && pylint $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda"); exit $(($? & 3))'
16+
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover common'
17+
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover selfdrive/can'
18+
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover selfdrive/boardd'
19+
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover selfdrive/controls'
20+
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && python -m unittest discover selfdrive/loggerd'
1621
- docker run
1722
-v "$(pwd)"/selfdrive/test/tests/plant/out:/tmp/openpilot/selfdrive/test/tests/plant/out
1823
tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/tests/plant && OPTEST=1 ./test_longitudinal.py'

CONTRIBUTING.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,22 @@ Most open source development activity is coordinated through our [Discord](https
1010
* Make sure you have a [GitHub account](https://github.com/signup/free)
1111
* Fork [our repositories](https://github.com/commaai) on GitHub
1212

13+
## Testing
14+
15+
### Local Testing
16+
17+
You can test your changes on your machine by running `run_docker_tests.sh`. This will run some automated tests in docker against your code.
18+
19+
### Automated Testing
20+
21+
All PRs are automatically checked by travis. Check out `.travis.yml` for what travis runs. Any new tests sould be added to travis.
22+
23+
### Code Style and Linting
24+
25+
Code is automatically check for style by travis as part of the automated tests. You can also run these yourself by running `check_code_quality.sh`.
26+
1327
## Car Ports (openpilot)
1428

1529
We've released a [Model Port guide](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) for porting to Toyota/Lexus models.
1630

1731
If you port openpilot to a substantially new car brand, see this more generic [Brand Port guide](https://medium.com/@comma_ai/how-to-write-a-car-port-for-openpilot-7ce0785eda84). You might also be eligible for a bounty. See our bounties at [comma.ai/bounties.html](https://comma.ai/bounties.html)
18-

Dockerfile.openpilot

+5-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@ FROM ubuntu:16.04
22
ENV PYTHONUNBUFFERED 1
33

44
RUN apt-get update && apt-get install -y \
5+
autoconf \
56
build-essential \
67
clang \
7-
vim \
8-
screen \
98
wget \
109
bzip2 \
1110
git \
1211
libglib2.0-0 \
12+
libtool \
1313
python-pip \
14-
capnproto \
15-
libcapnp-dev \
1614
libzmq5-dev \
1715
libffi-dev \
1816
libusb-1.0-0 \
@@ -21,6 +19,9 @@ RUN apt-get update && apt-get install -y \
2119
ocl-icd-opencl-dev \
2220
opencl-headers
2321

22+
COPY phonelibs/install_capnp.sh /tmp/install_capnp.sh
23+
RUN /tmp/install_capnp.sh
24+
2425
RUN pip install --upgrade pip==18.0
2526
RUN pip install numpy==1.11.2 scipy==0.18.1 matplotlib==2.1.2
2627

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -92,17 +92,21 @@ Supported Cars
9292
| Kia | Sorento 2018 | All | Yes | Stock | 0mph | 0mph | Custom<sup>6</sup>|
9393
| Kia | Stinger 2018 | SCC + LKAS | Yes | Stock | 0mph | 0mph | Custom<sup>6</sup>|
9494
| Lexus | RX Hybrid 2016-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
95+
| Subaru | Crosstrek 2018 | EyeSight | Yes | Stock | 0mph | 0mph | Subaru |
9596
| Subaru | Impreza 2019 | EyeSight | Yes | Stock | 0mph | 0mph | Subaru |
97+
| Toyota | Avalon 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
9698
| Toyota | Camry 2018<sup>4</sup> | All | Yes | Stock | 0mph<sup>5</sup> | 0mph | Toyota |
9799
| Toyota | C-HR 2017-18<sup>4</sup> | All | Yes | Stock | 0mph | 0mph | Toyota |
98100
| Toyota | Corolla 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
101+
| Toyota | Corolla Hatchback 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
99102
| Toyota | Highlander 2017-18 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
100103
| Toyota | Highlander Hybrid 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
101104
| Toyota | Prius 2016 | TSS-P | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
102105
| Toyota | Prius 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
103106
| Toyota | Prius Prime 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
104107
| Toyota | Rav4 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
105108
| Toyota | Rav4 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
109+
| Toyota | Rav4 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
106110
| Toyota | Rav4 Hybrid 2017-18 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
107111

108112
<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.ai](https://comma.ai)***
@@ -159,6 +163,7 @@ Directory structure
159163
├── pyextra # Libraries used on EON
160164
└── selfdrive # Code needed to drive the car
161165
├── assets # Fonts and images for UI
166+
├── athena # Allows communication with the app
162167
├── boardd # Daemon to talk to the board
163168
├── can # Helpers for parsing CAN messages
164169
├── car # Car specific code to read states and control actuators
@@ -169,7 +174,6 @@ Directory structure
169174
├── logcatd # Android logcat as a service
170175
├── loggerd # Logger and uploader of car data
171176
├── mapd # Fetches map data and computes next global path
172-
├── orbd # Computes ORB features from frames
173177
├── proclogd # Logs information from proc
174178
├── sensord # IMU / GPS interface code
175179
├── test # Car simulator running code through virtual maneuvers

RELEASES.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
Version 0.5.12 (2019-05-16)
2+
==========================
3+
* Improve lateral control for the Prius and Prius Prime
4+
* Compress logs before writing to disk
5+
* Remove old driving data when storage reaches 90% full
6+
* Fix small offset in following distance
7+
* Various small CPU optimizations
8+
* Improve offroad power consumption: require NEOS Update
9+
* Add default speed limits for Estonia thanks to martinl!
10+
* Subaru Crosstrek support thanks to martinl!
11+
* Toyota Avalon support thanks to njbrown09!
12+
* Toyota Rav4 with TSS 2.0 support thansk to wocsor!
13+
* Toyota Corolla with TSS 2.0 support thansk to wocsor!
14+
115
Version 0.5.11 (2019-04-17)
216
========================
317
* Add support for Subaru

apk/ai.comma.plus.frame.apk

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:2d45eb035af4adeaf31fe96ab36fc310962cc8c375319ac2a5e707b2cdc03097
3-
size 2588994
2+
oid sha256:61fc21ef8cec4ca15be05b1b5fdb9c4d95f3a78be891a36d84bd2dd89441e28e
3+
size 2596571

cereal/Makefile

+13-13
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@ GENS := gen/cpp/car.capnp.c++ gen/cpp/log.capnp.c++
66
JS := gen/js/car.capnp.js gen/js/log.capnp.js
77

88
UNAME_M ?= $(shell uname -m)
9-
# only generate C++ for docker tests
10-
ifneq ($(OPTEST),1)
11-
GENS += gen/c/car.capnp.c gen/c/log.capnp.c gen/c/include/c++.capnp.h gen/c/include/java.capnp.h
12-
13-
ifeq ($(UNAME_M),x86_64)
14-
ifneq (, $(shell which capnpc-java))
15-
GENS += gen/java/Car.java gen/java/Log.java
16-
else
17-
$(warning capnpc-java not found, skipping java build)
18-
endif
19-
endif
209

10+
GENS += gen/c/car.capnp.c gen/c/log.capnp.c gen/c/include/c++.capnp.h gen/c/include/java.capnp.h
11+
12+
ifeq ($(UNAME_M),x86_64)
13+
14+
ifneq (, $(shell which capnpc-java))
15+
GENS += gen/java/Car.java gen/java/Log.java
16+
else
17+
$(warning capnpc-java not found, skipping java build)
2118
endif
2219

20+
endif
21+
22+
2323
ifeq ($(UNAME_M),aarch64)
24-
CAPNPC=PATH=$(PWD)/../phonelibs/capnp-cpp/aarch64/bin/:$$PATH capnpc
24+
CAPNPC=PATH=$(PWD)/../phonelibs/capnp-cpp/aarch64/bin/:$$PATH capnpc
2525
else
26-
CAPNPC=capnpc
26+
CAPNPC=capnpc
2727
endif
2828

2929
.PHONY: all

cereal/car.capnp

+78-65
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
7373
lowBattery @48;
7474
invalidGiraffeHonda @49;
7575
vehicleModelInvalid @50;
76+
controlsFailed @51;
7677
}
7778
}
7879

@@ -281,31 +282,83 @@ struct CarControl {
281282

282283
struct CarParams {
283284
carName @0 :Text;
284-
radarNameDEPRECATED @1 :Text;
285-
carFingerprint @2 :Text;
286-
287-
enableSteerDEPRECATED @3 :Bool;
288-
enableGasInterceptor @4 :Bool;
289-
enableBrakeDEPRECATED @5 :Bool;
290-
enableCruise @6 :Bool;
291-
enableCamera @26 :Bool;
292-
enableDsu @27 :Bool; # driving support unit
293-
enableApgs @28 :Bool; # advanced parking guidance system
294-
295-
minEnableSpeed @17 :Float32;
296-
minSteerSpeed @49 :Float32;
297-
safetyModel @18 :Int16;
298-
safetyParam @41 :Int16;
299-
300-
steerMaxBP @19 :List(Float32);
301-
steerMaxV @20 :List(Float32);
302-
gasMaxBP @21 :List(Float32);
303-
gasMaxV @22 :List(Float32);
304-
brakeMaxBP @23 :List(Float32);
305-
brakeMaxV @24 :List(Float32);
306-
307-
longPidDeadzoneBP @32 :List(Float32);
308-
longPidDeadzoneV @33 :List(Float32);
285+
carFingerprint @1 :Text;
286+
287+
enableGasInterceptor @2 :Bool;
288+
enableCruise @3 :Bool;
289+
enableCamera @4 :Bool;
290+
enableDsu @5 :Bool; # driving support unit
291+
enableApgs @6 :Bool; # advanced parking guidance system
292+
293+
minEnableSpeed @7 :Float32;
294+
minSteerSpeed @8 :Float32;
295+
safetyModel @9 :Int16;
296+
safetyParam @10 :Int16;
297+
298+
steerMaxBP @11 :List(Float32);
299+
steerMaxV @12 :List(Float32);
300+
gasMaxBP @13 :List(Float32);
301+
gasMaxV @14 :List(Float32);
302+
brakeMaxBP @15 :List(Float32);
303+
brakeMaxV @16 :List(Float32);
304+
305+
306+
# things about the car in the manual
307+
mass @17 :Float32; # [kg] running weight
308+
wheelbase @18 :Float32; # [m] distance from rear to front axle
309+
centerToFront @19 :Float32; # [m] GC distance to front axle
310+
steerRatio @20 :Float32; # [] ratio between front wheels and steering wheel angles
311+
steerRatioRear @21 :Float32; # [] rear steering ratio wrt front steering (usually 0)
312+
313+
# things we can derive
314+
rotationalInertia @22 :Float32; # [kg*m2] body rotational inertia
315+
tireStiffnessFront @23 :Float32; # [N/rad] front tire coeff of stiff
316+
tireStiffnessRear @24 :Float32; # [N/rad] rear tire coeff of stiff
317+
318+
longitudinalTuning @25 :LongitudinalPIDTuning;
319+
lateralTuning :union {
320+
pid @26 :LateralPIDTuning;
321+
indi @27 :LateralINDITuning;
322+
}
323+
324+
steerLimitAlert @28 :Bool;
325+
326+
vEgoStopping @29 :Float32; # Speed at which the car goes into stopping state
327+
directAccelControl @30 :Bool; # Does the car have direct accel control or just gas/brake
328+
stoppingControl @31 :Bool; # Does the car allows full control even at lows speeds when stopping
329+
startAccel @32 :Float32; # Required acceleraton to overcome creep braking
330+
steerRateCost @33 :Float32; # Lateral MPC cost on steering rate
331+
steerControlType @34 :SteerControlType;
332+
radarOffCan @35 :Bool; # True when radar objects aren't visible on CAN
333+
334+
steerActuatorDelay @36 :Float32; # Steering wheel actuator delay in seconds
335+
openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control?
336+
337+
struct LateralPIDTuning {
338+
kpBP @0 :List(Float32);
339+
kpV @1 :List(Float32);
340+
kiBP @2 :List(Float32);
341+
kiV @3 :List(Float32);
342+
kf @4 :Float32;
343+
}
344+
345+
struct LongitudinalPIDTuning {
346+
kpBP @0 :List(Float32);
347+
kpV @1 :List(Float32);
348+
kiBP @2 :List(Float32);
349+
kiV @3 :List(Float32);
350+
deadzoneBP @4 :List(Float32);
351+
deadzoneV @5 :List(Float32);
352+
}
353+
354+
355+
struct LateralINDITuning {
356+
outerLoopGain @0 :Float32;
357+
innerLoopGain @1 :Float32;
358+
timeConstant @2 :Float32;
359+
actuatorEffectiveness @3 :Float32;
360+
}
361+
309362

310363
enum SafetyModels {
311364
# does NOT match board setting
@@ -323,46 +376,6 @@ struct CarParams {
323376
subaru @11;
324377
}
325378

326-
# things about the car in the manual
327-
mass @7 :Float32; # [kg] running weight
328-
wheelbase @8 :Float32; # [m] distance from rear to front axle
329-
centerToFront @9 :Float32; # [m] GC distance to front axle
330-
steerRatio @10 :Float32; # [] ratio between front wheels and steering wheel angles
331-
steerRatioRear @11 :Float32; # [] rear steering ratio wrt front steering (usually 0)
332-
333-
# things we can derive
334-
rotationalInertia @12 :Float32; # [kg*m2] body rotational inertia
335-
tireStiffnessFront @13 :Float32; # [N/rad] front tire coeff of stiff
336-
tireStiffnessRear @14 :Float32; # [N/rad] rear tire coeff of stiff
337-
338-
# Kp and Ki for the lateral control
339-
steerKpBP @42 :List(Float32);
340-
steerKpV @43 :List(Float32);
341-
steerKiBP @44 :List(Float32);
342-
steerKiV @45 :List(Float32);
343-
steerKpDEPRECATED @15 :Float32;
344-
steerKiDEPRECATED @16 :Float32;
345-
steerKf @25 :Float32;
346-
347-
# Kp and Ki for the longitudinal control
348-
longitudinalKpBP @36 :List(Float32);
349-
longitudinalKpV @37 :List(Float32);
350-
longitudinalKiBP @38 :List(Float32);
351-
longitudinalKiV @39 :List(Float32);
352-
353-
steerLimitAlert @29 :Bool;
354-
355-
vEgoStopping @30 :Float32; # Speed at which the car goes into stopping state
356-
directAccelControl @31 :Bool; # Does the car have direct accel control or just gas/brake
357-
stoppingControl @34 :Bool; # Does the car allows full control even at lows speeds when stopping
358-
startAccel @35 :Float32; # Required acceleraton to overcome creep braking
359-
steerRateCost @40 :Float32; # Lateral MPC cost on steering rate
360-
steerControlType @46 :SteerControlType;
361-
radarOffCan @47 :Bool; # True when radar objects aren't visible on CAN
362-
363-
steerActuatorDelay @48 :Float32; # Steering wheel actuator delay in seconds
364-
openpilotLongitudinalControl @50 :Bool; # is openpilot doing the longitudinal control?
365-
366379
enum SteerControlType {
367380
torque @0;
368381
angle @1;

0 commit comments

Comments
 (0)