Skip to content
Permalink
Browse files

openpilot v0.5.12 release

  • Loading branch information...
Vehicle Researcher
Vehicle Researcher committed May 16, 2019
1 parent 52e55eb commit 3f9059fea886f1fa3b0c19a62a981d891dcc84eb
Showing with 10,386 additions and 840 deletions.
  1. +5 −0 .travis.yml
  2. +14 −1 CONTRIBUTING.md
  3. +5 −4 Dockerfile.openpilot
  4. +5 −1 README.md
  5. +14 −0 RELEASES.md
  6. BIN apk/ai.comma.plus.frame.apk
  7. +13 −13 cereal/Makefile
  8. +78 −65 cereal/car.capnp
  9. +35 −4 cereal/log.capnp
  10. +11 −0 check_code_quality.sh
  11. +10 −0 common/kalman/Makefile
  12. +8 −21 common/kalman/simple_kalman.py
  13. +16 −0 common/kalman/simple_kalman_impl.pxd
  14. +35 −0 common/kalman/simple_kalman_impl.pyx
  15. +23 −0 common/kalman/simple_kalman_old.py
  16. +5 −0 common/kalman/simple_kalman_setup.py
  17. 0 common/kalman/tests/__init__.py
  18. +116 −0 common/kalman/tests/test_ekf.py
  19. +85 −0 common/kalman/tests/test_simple_kalman.py
  20. +28 −0 common/timeout.py
  21. +11 −0 common/transformations/camera.py
  22. +11 −2 common/transformations/model.py
  23. +6 −0 phonelibs/bzip2/build.txt
  24. +282 −0 phonelibs/bzip2/bzlib.h
  25. BIN phonelibs/bzip2/libbz2.a
  26. +39 −0 phonelibs/install_capnp.sh
  27. +39 −0 phonelibs/zmq/x64/include/czmq.h
  28. +178 −0 phonelibs/zmq/x64/include/czmq_library.h
  29. +647 −0 phonelibs/zmq/x64/include/czmq_prelude.h
  30. +76 −0 phonelibs/zmq/x64/include/zactor.h
  31. +114 −0 phonelibs/zmq/x64/include/zarmour.h
  32. +100 −0 phonelibs/zmq/x64/include/zauth.h
  33. +86 −0 phonelibs/zmq/x64/include/zbeacon.h
  34. +128 −0 phonelibs/zmq/x64/include/zcert.h
  35. +92 −0 phonelibs/zmq/x64/include/zcertstore.h
  36. +163 −0 phonelibs/zmq/x64/include/zchunk.h
  37. +73 −0 phonelibs/zmq/x64/include/zclock.h
  38. +185 −0 phonelibs/zmq/x64/include/zconfig.h
  39. +65 −0 phonelibs/zmq/x64/include/zdigest.h
  40. +149 −0 phonelibs/zmq/x64/include/zdir.h
  41. +82 −0 phonelibs/zmq/x64/include/zdir_patch.h
  42. +177 −0 phonelibs/zmq/x64/include/zfile.h
  43. +176 −0 phonelibs/zmq/x64/include/zframe.h
  44. +95 −0 phonelibs/zmq/x64/include/zgossip.h
  45. +182 −0 phonelibs/zmq/x64/include/zhash.h
  46. +277 −0 phonelibs/zmq/x64/include/zhashx.h
  47. +77 −0 phonelibs/zmq/x64/include/ziflist.h
  48. +158 −0 phonelibs/zmq/x64/include/zlist.h
  49. +205 −0 phonelibs/zmq/x64/include/zlistx.h
  50. +163 −0 phonelibs/zmq/x64/include/zloop.h
  51. +73 −0 phonelibs/zmq/x64/include/zmonitor.h
  52. +643 −0 phonelibs/zmq/x64/include/zmq.h
  53. +48 −0 phonelibs/zmq/x64/include/zmq_utils.h
  54. +280 −0 phonelibs/zmq/x64/include/zmsg.h
  55. +87 −0 phonelibs/zmq/x64/include/zpoller.h
  56. +168 −0 phonelibs/zmq/x64/include/zproc.h
  57. +111 −0 phonelibs/zmq/x64/include/zproxy.h
  58. +82 −0 phonelibs/zmq/x64/include/zrex.h
  59. +1,159 −0 phonelibs/zmq/x64/include/zsock.h
  60. +110 −0 phonelibs/zmq/x64/include/zstr.h
  61. +395 −0 phonelibs/zmq/x64/include/zsys.h
  62. +90 −0 phonelibs/zmq/x64/include/ztimerset.h
  63. +106 −0 phonelibs/zmq/x64/include/ztrie.h
  64. +96 −0 phonelibs/zmq/x64/include/zuuid.h
  65. BIN phonelibs/zmq/x64/lib/libczmq.a
  66. +41 −0 phonelibs/zmq/x64/lib/libczmq.la
  67. +1 −0 phonelibs/zmq/x64/lib/libczmq.so
  68. +1 −0 phonelibs/zmq/x64/lib/libczmq.so.4
  69. BIN phonelibs/zmq/x64/lib/libczmq.so.4.0.2
  70. BIN phonelibs/zmq/x64/lib/libzmq.a
  71. +41 −0 phonelibs/zmq/x64/lib/libzmq.la
  72. +41 −0 phonelibs/zmq/x64/lib/libzmq.lai
  73. +1 −0 phonelibs/zmq/x64/lib/libzmq.so
  74. +1 −0 phonelibs/zmq/x64/lib/libzmq.so.5
  75. BIN phonelibs/zmq/x64/lib/libzmq.so.5.1.2
  76. +24 −0 phonelibs/zmq/x64/lib/pkgconfig/libczmq.pc
  77. +10 −0 phonelibs/zmq/x64/lib/pkgconfig/libzmq.pc
  78. +6 −0 run_docker_tests.sh
  79. +15 −0 selfdrive/athena/athenad.py
  80. +19 −1 selfdrive/boardd/Makefile
  81. +1 −0 selfdrive/boardd/boardd.cc
  82. +7 −239 selfdrive/boardd/boardd.py
  83. +25 −0 selfdrive/boardd/boardd_api_impl.pyx
  84. +25 −0 selfdrive/boardd/boardd_setup.py
  85. +36 −0 selfdrive/boardd/can_list_to_can_capnp.cc
  86. 0 selfdrive/boardd/tests/__init__.py
  87. +247 −0 selfdrive/boardd/tests/boardd_old.py
  88. +19 −0 selfdrive/boardd/tests/fuzzer.py
  89. +76 −0 selfdrive/boardd/tests/test_boardd_api.py
  90. +51 −0 selfdrive/boardd/tests/test_boardd_loopback.py
  91. +7 −3 selfdrive/can/Makefile
  92. +4 −0 selfdrive/can/packer.cc
  93. +7 −66 selfdrive/can/packer.py
  94. +111 −0 selfdrive/can/packer_impl.pyx
  95. +5 −0 selfdrive/can/packer_setup.py
  96. +1 −2 selfdrive/can/parser.py
  97. +3 −3 selfdrive/can/process_dbc.py
  98. 0 selfdrive/can/tests/__init__.py
  99. +67 −0 selfdrive/can/tests/packer_old.py
  100. +35 −0 selfdrive/can/tests/test_packer_chrysler.py
  101. +66 −0 selfdrive/can/tests/test_packer_gm.py
  102. +56 −0 selfdrive/can/tests/test_packer_honda.py
  103. +70 −0 selfdrive/can/tests/test_packer_hyundai.py
  104. +37 −0 selfdrive/can/tests/test_packer_subaru.py
  105. +88 −0 selfdrive/can/tests/test_packer_toyota.py
  106. +1 −1 selfdrive/car/chrysler/carcontroller.py
  107. +5 −6 selfdrive/car/chrysler/carstate.py
  108. +9 −9 selfdrive/car/chrysler/interface.py
  109. +4 −0 selfdrive/car/chrysler/values.py
  110. +5 −5 selfdrive/car/ford/carstate.py
  111. +9 −9 selfdrive/car/ford/interface.py
  112. +1 −1 selfdrive/car/gm/carcontroller.py
  113. +4 −4 selfdrive/car/gm/carstate.py
  114. +15 −13 selfdrive/car/gm/interface.py
  115. +6 −0 selfdrive/car/gm/values.py
  116. +1 −1 selfdrive/car/honda/carcontroller.py
  117. +1 −1 selfdrive/car/honda/carstate.py
  118. +60 −61 selfdrive/car/honda/interface.py
  119. +1 −1 selfdrive/car/hyundai/carcontroller.py
  120. +5 −6 selfdrive/car/hyundai/carstate.py
  121. +24 −24 selfdrive/car/hyundai/interface.py
  122. +6 −6 selfdrive/car/mock/interface.py
  123. +1 −1 selfdrive/car/subaru/carcontroller.py
  124. +14 −7 selfdrive/car/subaru/carstate.py
  125. +9 −9 selfdrive/car/subaru/interface.py
  126. +4 −0 selfdrive/car/subaru/values.py
  127. +3 −3 selfdrive/car/toyota/carcontroller.py
  128. +5 −5 selfdrive/car/toyota/carstate.py
  129. +66 −29 selfdrive/car/toyota/interface.py
  130. +27 −17 selfdrive/car/toyota/radar_interface.py
  131. +41 −24 selfdrive/car/toyota/values.py
  132. +2 −6 selfdrive/common/cereal.mk
  133. +1 −0 selfdrive/common/util.c
  134. +1 −1 selfdrive/common/version.h
  135. +51 −29 selfdrive/controls/controlsd.py
  136. +7 −1 selfdrive/controls/lib/drive_helpers.py
  137. +2 −1 selfdrive/controls/lib/driver_monitor.py
  138. +104 −0 selfdrive/controls/lib/latcontrol_indi.py
  139. +19 −15 selfdrive/controls/lib/{latcontrol.py → latcontrol_pid.py}
  140. +3 −3 selfdrive/controls/lib/longcontrol.py
  141. +2 −2 selfdrive/controls/lib/longitudinal_mpc/generator.cpp
  142. +2 −2 selfdrive/controls/lib/longitudinal_mpc/lib_mpc_export/acado_common.h
  143. BIN selfdrive/controls/lib/longitudinal_mpc/lib_mpc_export/acado_qpoases_interface.o
  144. +17 −20 selfdrive/controls/lib/longitudinal_mpc/lib_mpc_export/acado_solver.c
  145. BIN selfdrive/controls/lib/longitudinal_mpc/lib_mpc_export/acado_solver.o
  146. BIN selfdrive/controls/lib/longitudinal_mpc/libmpc1.so
  147. BIN selfdrive/controls/lib/longitudinal_mpc/longitudinal_mpc.o
  148. +4 −1 selfdrive/controls/lib/pathplanner.py
  149. +19 −18 selfdrive/controls/lib/planner.py
  150. +1 −1 selfdrive/controls/lib/radar_helpers.py
  151. +15 −8 selfdrive/controls/plannerd.py
  152. 0 selfdrive/controls/tests/__init__.py
  153. +90 −0 selfdrive/controls/tests/test_following_distance.py
  154. +41 −21 selfdrive/debug/cpu_usage_stat.py
  155. +67 −0 selfdrive/debug/tuner.py
  156. +2 −0 selfdrive/locationd/.gitignore
  157. +4 −0 selfdrive/locationd/kalman/.gitignore
  158. +39 −0 selfdrive/loggerd/deleter.py
  159. BIN selfdrive/loggerd/loggerd
  160. +35 −0 selfdrive/loggerd/tests/Makefile
  161. 0 selfdrive/loggerd/tests/__init__.py
  162. +27 −0 selfdrive/loggerd/tests/fill_eon.py
  163. +53 −0 selfdrive/loggerd/tests/loggerd_tests_common.py
  164. +104 −0 selfdrive/loggerd/tests/test_deleter.py
  165. +57 −0 selfdrive/loggerd/tests/testraw.cc
  166. +4 −22 selfdrive/loggerd/uploader.py
  167. +3 −1 selfdrive/manager.py
  168. +26 −2 selfdrive/mapd/default_speeds_generator.py
  169. +2 −3 selfdrive/mapd/mapd_helpers.py
  170. BIN selfdrive/sensord/gpsd
  171. BIN selfdrive/sensord/sensord
  172. +1 −1 selfdrive/test/plant/plant.py
  173. +2 −0 selfdrive/thermald.py
  174. +1 −1 selfdrive/tombstoned.py
  175. +13 −13 selfdrive/ui/slplay.c
  176. +2 −0 selfdrive/visiond/camera_qcom.c
  177. +1 −0 selfdrive/visiond/model.cc
@@ -13,6 +13,11 @@ script:
tmppilot /bin/sh -c 'cd /tmp/openpilot/ && pyflakes $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda")'
- docker run
tmppilot /bin/sh -c 'cd /tmp/openpilot/ && pylint $(find . -iname "*.py" | grep -vi "^\./pyextra.*" | grep -vi "^\./panda"); exit $(($? & 3))'
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover common'
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover selfdrive/can'
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover selfdrive/boardd'
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && make -C cereal && python -m unittest discover selfdrive/controls'
- docker run tmppilot /bin/sh -c 'cd /tmp/openpilot/ && python -m unittest discover selfdrive/loggerd'
- docker run
-v "$(pwd)"/selfdrive/test/tests/plant/out:/tmp/openpilot/selfdrive/test/tests/plant/out
tmppilot /bin/sh -c 'cd /tmp/openpilot/selfdrive/test/tests/plant && OPTEST=1 ./test_longitudinal.py'
@@ -10,9 +10,22 @@ Most open source development activity is coordinated through our [Discord](https
* Make sure you have a [GitHub account](https://github.com/signup/free)
* Fork [our repositories](https://github.com/commaai) on GitHub

## Testing

### Local Testing

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.

### Automated Testing

All PRs are automatically checked by travis. Check out `.travis.yml` for what travis runs. Any new tests sould be added to travis.

### Code Style and Linting

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`.

## Car Ports (openpilot)

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.

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)

@@ -2,17 +2,15 @@ FROM ubuntu:16.04
ENV PYTHONUNBUFFERED 1

RUN apt-get update && apt-get install -y \
autoconf \
build-essential \
clang \
vim \
screen \
wget \
bzip2 \
git \
libglib2.0-0 \
libtool \
python-pip \
capnproto \
libcapnp-dev \
libzmq5-dev \
libffi-dev \
libusb-1.0-0 \
@@ -21,6 +19,9 @@ RUN apt-get update && apt-get install -y \
ocl-icd-opencl-dev \
opencl-headers

COPY phonelibs/install_capnp.sh /tmp/install_capnp.sh
RUN /tmp/install_capnp.sh

RUN pip install --upgrade pip==18.0
RUN pip install numpy==1.11.2 scipy==0.18.1 matplotlib==2.1.2

@@ -92,17 +92,21 @@ Supported Cars
| Kia | Sorento 2018 | All | Yes | Stock | 0mph | 0mph | Custom<sup>6</sup>|
| Kia | Stinger 2018 | SCC + LKAS | Yes | Stock | 0mph | 0mph | Custom<sup>6</sup>|
| Lexus | RX Hybrid 2016-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Subaru | Crosstrek 2018 | EyeSight | Yes | Stock | 0mph | 0mph | Subaru |
| Subaru | Impreza 2019 | EyeSight | Yes | Stock | 0mph | 0mph | Subaru |
| Toyota | Avalon 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
| Toyota | Camry 2018<sup>4</sup> | All | Yes | Stock | 0mph<sup>5</sup> | 0mph | Toyota |
| Toyota | C-HR 2017-18<sup>4</sup> | All | Yes | Stock | 0mph | 0mph | Toyota |
| Toyota | Corolla 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
| Toyota | Corolla Hatchback 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
| Toyota | Highlander 2017-18 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Highlander Hybrid 2018 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Prius 2016 | TSS-P | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Prius 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Prius Prime 2017-19 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |
| Toyota | Rav4 2016 | TSS-P | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
| Toyota | Rav4 2017-18 | All | Yes | Yes<sup>2</sup>| 20mph<sup>1</sup>| 0mph | Toyota |
| Toyota | Rav4 2019 | All | Yes | Yes | 0mph | 0mph | Toyota |
| Toyota | Rav4 Hybrid 2017-18 | All | Yes | Yes<sup>2</sup>| 0mph | 0mph | Toyota |

<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
├── pyextra # Libraries used on EON
└── selfdrive # Code needed to drive the car
├── assets # Fonts and images for UI
├── athena # Allows communication with the app
├── boardd # Daemon to talk to the board
├── can # Helpers for parsing CAN messages
├── car # Car specific code to read states and control actuators
@@ -169,7 +174,6 @@ Directory structure
├── logcatd # Android logcat as a service
├── loggerd # Logger and uploader of car data
├── mapd # Fetches map data and computes next global path
├── orbd # Computes ORB features from frames
├── proclogd # Logs information from proc
├── sensord # IMU / GPS interface code
├── test # Car simulator running code through virtual maneuvers
@@ -1,3 +1,17 @@
Version 0.5.12 (2019-05-16)
==========================
* Improve lateral control for the Prius and Prius Prime
* Compress logs before writing to disk
* Remove old driving data when storage reaches 90% full
* Fix small offset in following distance
* Various small CPU optimizations
* Improve offroad power consumption: require NEOS Update
* Add default speed limits for Estonia thanks to martinl!
* Subaru Crosstrek support thanks to martinl!
* Toyota Avalon support thanks to njbrown09!
* Toyota Rav4 with TSS 2.0 support thansk to wocsor!
* Toyota Corolla with TSS 2.0 support thansk to wocsor!

Version 0.5.11 (2019-04-17)
========================
* Add support for Subaru
BIN +7.4 KB (100%) apk/ai.comma.plus.frame.apk
Binary file not shown.
@@ -6,24 +6,24 @@ GENS := gen/cpp/car.capnp.c++ gen/cpp/log.capnp.c++
JS := gen/js/car.capnp.js gen/js/log.capnp.js

UNAME_M ?= $(shell uname -m)
# only generate C++ for docker tests
ifneq ($(OPTEST),1)
GENS += gen/c/car.capnp.c gen/c/log.capnp.c gen/c/include/c++.capnp.h gen/c/include/java.capnp.h

ifeq ($(UNAME_M),x86_64)
ifneq (, $(shell which capnpc-java))
GENS += gen/java/Car.java gen/java/Log.java
else
$(warning capnpc-java not found, skipping java build)
endif
endif

GENS += gen/c/car.capnp.c gen/c/log.capnp.c gen/c/include/c++.capnp.h gen/c/include/java.capnp.h

ifeq ($(UNAME_M),x86_64)

ifneq (, $(shell which capnpc-java))
GENS += gen/java/Car.java gen/java/Log.java
else
$(warning capnpc-java not found, skipping java build)
endif

endif


ifeq ($(UNAME_M),aarch64)
CAPNPC=PATH=$(PWD)/../phonelibs/capnp-cpp/aarch64/bin/:$$PATH capnpc
CAPNPC=PATH=$(PWD)/../phonelibs/capnp-cpp/aarch64/bin/:$$PATH capnpc
else
CAPNPC=capnpc
CAPNPC=capnpc
endif

.PHONY: all
@@ -73,6 +73,7 @@ struct CarEvent @0x9b1657f34caf3ad3 {
lowBattery @48;
invalidGiraffeHonda @49;
vehicleModelInvalid @50;
controlsFailed @51;
}
}

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

struct CarParams {
carName @0 :Text;
radarNameDEPRECATED @1 :Text;
carFingerprint @2 :Text;

enableSteerDEPRECATED @3 :Bool;
enableGasInterceptor @4 :Bool;
enableBrakeDEPRECATED @5 :Bool;
enableCruise @6 :Bool;
enableCamera @26 :Bool;
enableDsu @27 :Bool; # driving support unit
enableApgs @28 :Bool; # advanced parking guidance system

minEnableSpeed @17 :Float32;
minSteerSpeed @49 :Float32;
safetyModel @18 :Int16;
safetyParam @41 :Int16;

steerMaxBP @19 :List(Float32);
steerMaxV @20 :List(Float32);
gasMaxBP @21 :List(Float32);
gasMaxV @22 :List(Float32);
brakeMaxBP @23 :List(Float32);
brakeMaxV @24 :List(Float32);

longPidDeadzoneBP @32 :List(Float32);
longPidDeadzoneV @33 :List(Float32);
carFingerprint @1 :Text;

enableGasInterceptor @2 :Bool;
enableCruise @3 :Bool;
enableCamera @4 :Bool;
enableDsu @5 :Bool; # driving support unit
enableApgs @6 :Bool; # advanced parking guidance system

minEnableSpeed @7 :Float32;
minSteerSpeed @8 :Float32;
safetyModel @9 :Int16;
safetyParam @10 :Int16;

steerMaxBP @11 :List(Float32);
steerMaxV @12 :List(Float32);
gasMaxBP @13 :List(Float32);
gasMaxV @14 :List(Float32);
brakeMaxBP @15 :List(Float32);
brakeMaxV @16 :List(Float32);


# things about the car in the manual
mass @17 :Float32; # [kg] running weight
wheelbase @18 :Float32; # [m] distance from rear to front axle
centerToFront @19 :Float32; # [m] GC distance to front axle
steerRatio @20 :Float32; # [] ratio between front wheels and steering wheel angles
steerRatioRear @21 :Float32; # [] rear steering ratio wrt front steering (usually 0)

# things we can derive
rotationalInertia @22 :Float32; # [kg*m2] body rotational inertia
tireStiffnessFront @23 :Float32; # [N/rad] front tire coeff of stiff
tireStiffnessRear @24 :Float32; # [N/rad] rear tire coeff of stiff

longitudinalTuning @25 :LongitudinalPIDTuning;
lateralTuning :union {
pid @26 :LateralPIDTuning;
indi @27 :LateralINDITuning;
}

steerLimitAlert @28 :Bool;

vEgoStopping @29 :Float32; # Speed at which the car goes into stopping state
directAccelControl @30 :Bool; # Does the car have direct accel control or just gas/brake
stoppingControl @31 :Bool; # Does the car allows full control even at lows speeds when stopping
startAccel @32 :Float32; # Required acceleraton to overcome creep braking
steerRateCost @33 :Float32; # Lateral MPC cost on steering rate
steerControlType @34 :SteerControlType;
radarOffCan @35 :Bool; # True when radar objects aren't visible on CAN

steerActuatorDelay @36 :Float32; # Steering wheel actuator delay in seconds
openpilotLongitudinalControl @37 :Bool; # is openpilot doing the longitudinal control?

struct LateralPIDTuning {
kpBP @0 :List(Float32);
kpV @1 :List(Float32);
kiBP @2 :List(Float32);
kiV @3 :List(Float32);
kf @4 :Float32;
}

struct LongitudinalPIDTuning {
kpBP @0 :List(Float32);
kpV @1 :List(Float32);
kiBP @2 :List(Float32);
kiV @3 :List(Float32);
deadzoneBP @4 :List(Float32);
deadzoneV @5 :List(Float32);
}


struct LateralINDITuning {
outerLoopGain @0 :Float32;
innerLoopGain @1 :Float32;
timeConstant @2 :Float32;
actuatorEffectiveness @3 :Float32;
}


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

# things about the car in the manual
mass @7 :Float32; # [kg] running weight
wheelbase @8 :Float32; # [m] distance from rear to front axle
centerToFront @9 :Float32; # [m] GC distance to front axle
steerRatio @10 :Float32; # [] ratio between front wheels and steering wheel angles
steerRatioRear @11 :Float32; # [] rear steering ratio wrt front steering (usually 0)

# things we can derive
rotationalInertia @12 :Float32; # [kg*m2] body rotational inertia
tireStiffnessFront @13 :Float32; # [N/rad] front tire coeff of stiff
tireStiffnessRear @14 :Float32; # [N/rad] rear tire coeff of stiff

# Kp and Ki for the lateral control
steerKpBP @42 :List(Float32);
steerKpV @43 :List(Float32);
steerKiBP @44 :List(Float32);
steerKiV @45 :List(Float32);
steerKpDEPRECATED @15 :Float32;
steerKiDEPRECATED @16 :Float32;
steerKf @25 :Float32;

# Kp and Ki for the longitudinal control
longitudinalKpBP @36 :List(Float32);
longitudinalKpV @37 :List(Float32);
longitudinalKiBP @38 :List(Float32);
longitudinalKiV @39 :List(Float32);

steerLimitAlert @29 :Bool;

vEgoStopping @30 :Float32; # Speed at which the car goes into stopping state
directAccelControl @31 :Bool; # Does the car have direct accel control or just gas/brake
stoppingControl @34 :Bool; # Does the car allows full control even at lows speeds when stopping
startAccel @35 :Float32; # Required acceleraton to overcome creep braking
steerRateCost @40 :Float32; # Lateral MPC cost on steering rate
steerControlType @46 :SteerControlType;
radarOffCan @47 :Bool; # True when radar objects aren't visible on CAN

steerActuatorDelay @48 :Float32; # Steering wheel actuator delay in seconds
openpilotLongitudinalControl @50 :Bool; # is openpilot doing the longitudinal control?

enum SteerControlType {
torque @0;
angle @1;
@@ -388,9 +388,9 @@ struct Live100Data {
ufAccelCmd @33 :Float32;
yActualDEPRECATED @6 :Float32;
yDesDEPRECATED @7 :Float32;
upSteer @8 :Float32;
uiSteer @9 :Float32;
ufSteer @34 :Float32;
upSteerDEPRECATED @8 :Float32;
uiSteerDEPRECATED @9 :Float32;
ufSteerDEPRECATED @34 :Float32;
aTargetMinDEPRECATED @10 :Float32;
aTargetMaxDEPRECATED @11 :Float32;
aTarget @35 :Float32;
@@ -428,6 +428,11 @@ struct Live100Data {
vCurvature @46 :Float32;
decelForTurn @47 :Bool;

lateralControlState :union {
indiState @52 :LateralINDIState;
pidState @53 :LateralPIDState;
}

enum ControlState {
disabled @0;
preEnabled @1;
@@ -455,6 +460,31 @@ struct Live100Data {
full @3; # full screen
}

struct LateralINDIState {
active @0 :Bool;
steerAngle @1 :Float32;
steerRate @2 :Float32;
steerAccel @3 :Float32;
rateSetPoint @4 :Float32;
accelSetPoint @5 :Float32;
accelError @6 :Float32;
delayedOutput @7 :Float32;
delta @8 :Float32;
output @9 :Float32;
}

struct LateralPIDState {
active @0 :Bool;
steerAngle @1 :Float32;
steerRate @2 :Float32;
angleError @3 :Float32;
p @4 :Float32;
i @5 :Float32;
f @6 :Float32;
output @7 :Float32;
saturated @8 :Bool;
}

}

struct LiveEventData {
@@ -545,7 +575,7 @@ struct LogRotate {
struct Plan {
mdMonoTime @9 :UInt64;
l20MonoTime @10 :UInt64;
events @13 :List(Car.CarEvent);
eventsDEPRECATED @13 :List(Car.CarEvent);

# lateral, 3rd order polynomial
lateralValidDEPRECATED @0 :Bool;
@@ -583,6 +613,7 @@ struct Plan {
decelForTurn @22 :Bool;
mapValid @25 :Bool;
radarValid @28 :Bool;
radarCommIssue @30 :Bool;

processingDelay @29 :Float32;

0 comments on commit 3f9059f

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