From bf338bf5e96d081f6df37d4dcae0187e88bf9332 Mon Sep 17 00:00:00 2001 From: Vehicle Researcher Date: Fri, 19 Nov 2021 15:24:51 -0800 Subject: [PATCH] openpilot v0.8.11 release --- .gitignore | 5 +- Jenkinsfile | 26 +- README.md | 4 +- RELEASES.md | 14 + SConstruct | 12 +- cereal/car.capnp | 12 +- cereal/log.capnp | 51 ++ cereal/services.py | 2 + cereal/visionipc/visionbuf.cc | 27 +- cereal/visionipc/visionbuf.h | 5 + cereal/visionipc/visionbuf_cl.cc | 15 +- cereal/visionipc/visionbuf_ion.cc | 21 +- cereal/visionipc/visionipc_server.cc | 1 - cereal/visionipc/visionipc_tests.cc | 2 + common/markdown.py | 48 ++ common/params_pxd.pxd | 28 - common/params_pyx.pyx | 64 +-- common/transformations/model.py | 3 + docs/CARS.md | 28 +- docs/INTEGRATION.md | 64 +-- docs/LIMITATIONS.md | 58 +++ docs/SAFETY.md | 34 -- opendbc/can/common.cc | 4 +- opendbc/lexus_ct200h_2018_pt_generated.dbc | 17 +- opendbc/lexus_is_2018_pt_generated.dbc | 17 +- opendbc/lexus_nx300_2018_pt_generated.dbc | 17 +- opendbc/lexus_nx300h_2018_pt_generated.dbc | 17 +- opendbc/lexus_rx_350_2016_pt_generated.dbc | 17 +- opendbc/lexus_rx_hybrid_2017_pt_generated.dbc | 17 +- opendbc/nissan_leaf_2018.dbc | 2 +- opendbc/tesla_powertrain.dbc | 179 +++++++ opendbc/toyota_avalon_2017_pt_generated.dbc | 17 +- .../toyota_camry_hybrid_2018_pt_generated.dbc | 17 +- opendbc/toyota_corolla_2017_pt_generated.dbc | 17 +- .../toyota_highlander_2017_pt_generated.dbc | 17 +- ...ta_highlander_hybrid_2018_pt_generated.dbc | 17 +- opendbc/toyota_nodsu_hybrid_pt_generated.dbc | 17 +- opendbc/toyota_nodsu_pt_generated.dbc | 17 +- opendbc/toyota_prius_2017_pt_generated.dbc | 17 +- opendbc/toyota_rav4_2017_pt_generated.dbc | 17 +- .../toyota_rav4_hybrid_2017_pt_generated.dbc | 17 +- .../toyota_sienna_xle_2018_pt_generated.dbc | 17 +- opendbc/vw_mqb_2010.dbc | 22 +- panda/__init__.py | 4 +- panda/board/can_definitions.h | 29 ++ panda/board/config.h | 10 - panda/board/dlc_to_len.h | 1 + panda/board/drivers/bxcan.h | 75 +-- panda/board/drivers/can_common.h | 86 ++-- panda/board/drivers/fdcan.h | 95 ++-- panda/board/drivers/gmlan_alt.h | 17 +- panda/board/drivers/usb.h | 7 +- panda/board/flasher.h | 2 +- panda/board/get_sdk.sh | 2 +- panda/board/get_sdk_mac.sh | 2 +- panda/board/libc.h | 37 +- panda/board/main.c | 59 +-- panda/board/pedal/main.c | 8 +- panda/board/safety.h | 29 +- panda/board/safety/safety_chrysler.h | 34 +- panda/board/safety/safety_defaults.h | 31 +- panda/board/safety/safety_elm327.h | 2 +- panda/board/safety/safety_ford.h | 8 +- panda/board/safety/safety_gm.h | 8 +- panda/board/safety/safety_gm_ascm.h | 43 -- panda/board/safety/safety_honda.h | 147 +++--- panda/board/safety/safety_hyundai.h | 30 +- panda/board/safety/safety_mazda.h | 69 +-- panda/board/safety/safety_nissan.h | 30 +- panda/board/safety/safety_subaru.h | 84 ++- panda/board/safety/safety_tesla.h | 145 ++++-- panda/board/safety/safety_toyota.h | 45 +- panda/board/safety/safety_volkswagen.h | 61 ++- panda/board/safety_declarations.h | 29 +- panda/board/stm32fx/stm32fx_config.h | 4 + panda/board/stm32h7/clock.h | 36 +- panda/board/stm32h7/llfdcan.h | 33 +- panda/board/stm32h7/stm32h7_config.h | 4 + panda/board/stm32h7/stm32h7x5_flash.ld | 6 + panda/board/usb_protocol.h | 108 ++++ panda/python/__init__.py | 181 +++++-- panda/python/ccp.py | 362 +++++++++++++ panda/python/uds.py | 13 +- pyextra/acados_template/acados_layout.json | 3 + pyextra/acados_template/acados_model.py | 9 + pyextra/acados_template/acados_ocp.py | 19 + pyextra/acados_template/acados_ocp_solver.py | 424 +++++++++++----- .../acados_template/acados_ocp_solver_pyx.pyx | 427 ++++++++++++++++ pyextra/acados_template/acados_sim.py | 38 +- .../acados_template/acados_sim_layout.json | 3 + pyextra/acados_template/acados_sim_solver.py | 15 +- .../acados_template/acados_solver_common.pxd | 102 ++++ .../c_templates_tera/Makefile.in | 35 +- .../c_templates_tera/acados_mex_create.in.c | 2 +- .../c_templates_tera/acados_mex_free.in.c | 2 +- .../c_templates_tera/acados_mex_set.in.c | 2 +- .../c_templates_tera/acados_mex_solve.in.c | 2 +- .../c_templates_tera/acados_sim_solver.in.c | 70 +-- .../c_templates_tera/acados_sim_solver.in.h | 5 + .../c_templates_tera/acados_solver.in.c | 197 +++++--- .../c_templates_tera/acados_solver.in.h | 107 +++- .../c_templates_tera/acados_solver.in.pxd | 22 + .../c_templates_tera/acados_solver_sfun.in.c | 6 +- .../c_templates_tera/main.in.c | 70 ++- .../c_templates_tera/main_sim.in.c | 19 +- .../generate_c_code_constraint.py | 2 +- .../generate_c_code_discrete_dynamics.py | 2 +- .../generate_c_code_explicit_ode.py | 2 +- .../generate_c_code_external_cost.py | 6 + .../acados_template/generate_c_code_gnsf.py | 2 +- .../generate_c_code_implicit_ode.py | 2 +- .../generate_c_code_nls_cost.py | 2 +- pyextra/acados_template/utils.py | 34 +- rednose/helpers/ekf_sym.cc | 4 +- release/files_common | 20 +- release/files_pc | 2 + release/files_tici | 6 + selfdrive/assets/fonts/Inter-Black.ttf | Bin 0 -> 294396 bytes selfdrive/assets/fonts/Inter-Bold.ttf | Bin 0 -> 293448 bytes selfdrive/assets/fonts/Inter-ExtraBold.ttf | Bin 0 -> 294072 bytes selfdrive/assets/fonts/Inter-ExtraLight.ttf | Bin 0 -> 288400 bytes selfdrive/assets/fonts/Inter-Light.ttf | Bin 0 -> 288088 bytes selfdrive/assets/fonts/Inter-Medium.ttf | Bin 0 -> 292140 bytes selfdrive/assets/fonts/Inter-Regular.ttf | Bin 0 -> 287928 bytes selfdrive/assets/fonts/Inter-SemiBold.ttf | Bin 0 -> 293028 bytes selfdrive/assets/fonts/Inter-Thin.ttf | Bin 0 -> 288568 bytes selfdrive/athena/athenad.py | 22 +- selfdrive/boardd/boardd.cc | 368 ++++++++------ selfdrive/boardd/can_list_to_can_capnp.cc | 8 +- selfdrive/boardd/panda.cc | 168 ++++-- selfdrive/boardd/panda.h | 37 +- selfdrive/boardd/pigeon.cc | 9 +- selfdrive/boardd/pigeon.h | 2 +- selfdrive/camerad/SConscript | 8 +- selfdrive/camerad/cameras/camera_common.cc | 113 +++-- selfdrive/camerad/cameras/camera_common.h | 5 +- selfdrive/camerad/cameras/camera_qcom2.cc | 134 ++--- selfdrive/camerad/cameras/camera_qcom2.h | 2 +- selfdrive/camerad/cameras/camera_replay.cc | 6 +- selfdrive/camerad/main.cc | 12 +- selfdrive/camerad/snapshot/snapshot.py | 60 ++- selfdrive/car/car_helpers.py | 27 +- selfdrive/car/fw_versions.py | 34 +- selfdrive/car/gm/carcontroller.py | 13 +- selfdrive/car/gm/carstate.py | 16 +- selfdrive/car/gm/interface.py | 31 +- selfdrive/car/gm/radar_interface.py | 2 +- selfdrive/car/gm/values.py | 7 + selfdrive/car/honda/carcontroller.py | 2 +- selfdrive/car/honda/carstate.py | 9 +- selfdrive/car/honda/interface.py | 18 +- selfdrive/car/honda/values.py | 187 ++++--- selfdrive/car/hyundai/carcontroller.py | 3 +- selfdrive/car/hyundai/carstate.py | 2 +- selfdrive/car/hyundai/hyundaican.py | 5 +- selfdrive/car/hyundai/interface.py | 19 +- selfdrive/car/hyundai/values.py | 160 +++++- selfdrive/car/interfaces.py | 29 +- selfdrive/car/mazda/carcontroller.py | 52 +- selfdrive/car/mazda/carstate.py | 77 +-- selfdrive/car/mazda/interface.py | 7 +- selfdrive/car/mazda/mazdacan.py | 95 ++-- selfdrive/car/mazda/values.py | 42 +- selfdrive/car/nissan/carstate.py | 5 +- selfdrive/car/nissan/values.py | 59 +++ selfdrive/car/tesla/carcontroller.py | 20 +- selfdrive/car/tesla/carstate.py | 10 +- selfdrive/car/tesla/interface.py | 27 +- selfdrive/car/tesla/teslacan.py | 28 +- selfdrive/car/tesla/values.py | 16 +- selfdrive/car/toyota/carcontroller.py | 4 +- selfdrive/car/toyota/carstate.py | 2 + selfdrive/car/toyota/interface.py | 153 ++---- selfdrive/car/toyota/toyotacan.py | 2 +- selfdrive/car/toyota/tunes.py | 142 ++++++ selfdrive/car/toyota/values.py | 112 ++-- selfdrive/car/volkswagen/interface.py | 8 + selfdrive/car/volkswagen/values.py | 47 +- selfdrive/common/clutil.cc | 19 +- selfdrive/common/clutil.h | 7 +- selfdrive/common/params.cc | 147 ++---- selfdrive/common/params.h | 57 +-- selfdrive/common/util.cc | 103 +++- selfdrive/common/util.h | 36 +- selfdrive/common/version.h | 2 +- selfdrive/common/visionimg.cc | 2 +- selfdrive/common/watchdog.cc | 13 +- selfdrive/controls/controlsd.py | 54 +- selfdrive/controls/lib/alertmanager.py | 79 +-- selfdrive/controls/lib/alerts_offroad.json | 18 +- selfdrive/controls/lib/events.py | 269 ++++------ .../controls/lib/lateral_mpc_lib/SConscript | 27 +- .../controls/lib/lateral_mpc_lib/lat_mpc.py | 32 +- selfdrive/controls/lib/lateral_planner.py | 12 +- selfdrive/controls/lib/longcontrol.py | 8 +- .../lib/longitudinal_mpc_lib/SConscript | 27 +- .../lib/longitudinal_mpc_lib/long_mpc.py | 73 ++- selfdrive/controls/plannerd.py | 1 - selfdrive/controls/radard.py | 16 +- selfdrive/debug/cycle_alerts.py | 7 +- selfdrive/debug/filter_log_message.py | 4 +- .../debug/hyundai_enable_radar_points.py | 14 +- selfdrive/debug/uiview.py | 3 +- selfdrive/hardware/base.h | 4 +- selfdrive/hardware/base.py | 2 +- selfdrive/hardware/eon/hardware.py | 2 +- selfdrive/hardware/pc/hardware.py | 2 +- selfdrive/hardware/tici/hardware.py | 17 +- selfdrive/locationd/locationd.cc | 24 +- selfdrive/locationd/models/constants.py | 1 + selfdrive/locationd/models/live_kf.cc | 4 +- selfdrive/locationd/models/live_kf.py | 40 +- selfdrive/locationd/ublox_msg.cc | 12 +- selfdrive/locationd/ubloxd.cc | 8 +- selfdrive/loggerd/SConscript | 2 +- selfdrive/loggerd/bootlog.cc | 25 +- selfdrive/loggerd/logger.cc | 21 +- selfdrive/loggerd/logger.h | 4 +- selfdrive/loggerd/loggerd.cc | 109 ++-- selfdrive/loggerd/omx_encoder.cc | 14 +- selfdrive/loggerd/raw_logger.cc | 1 + selfdrive/loggerd/uploader.py | 4 +- selfdrive/manager/manager.py | 27 +- selfdrive/manager/process.py | 3 +- selfdrive/manager/process_config.py | 3 +- selfdrive/manager/test/test_manager.py | 6 +- selfdrive/modeld/modeld.cc | 12 +- selfdrive/modeld/models/commonmodel.cc | 4 +- selfdrive/modeld/models/dmonitoring.cc | 25 +- selfdrive/modeld/models/driving.cc | 4 +- selfdrive/modeld/thneed/serialize.cc | 55 +- selfdrive/modeld/thneed/thneed.cc | 7 +- selfdrive/pandad.py | 115 +++-- selfdrive/proclogd/proclog.cc | 4 +- selfdrive/sensord/sensors_qcom2.cc | 17 +- selfdrive/swaglog.py | 10 + selfdrive/test/test_fingerprints.py | 60 +-- selfdrive/test/test_onroad.py | 53 +- selfdrive/thermald/thermald.py | 25 +- selfdrive/ui/.gitignore | 1 - selfdrive/ui/SConscript | 22 +- selfdrive/ui/navd/.gitignore | 1 + selfdrive/ui/navd/main.cc | 36 ++ selfdrive/ui/navd/navd | 4 + selfdrive/ui/navd/route_engine.cc | 339 +++++++++++++ selfdrive/ui/navd/route_engine.h | 55 ++ selfdrive/ui/paint.cc | 28 +- selfdrive/ui/paint.h | 1 + selfdrive/ui/qt/api.cc | 11 +- selfdrive/ui/qt/home.h | 1 - selfdrive/ui/qt/maps/map.cc | 477 ++++++------------ selfdrive/ui/qt/maps/map.h | 37 +- selfdrive/ui/qt/maps/map_helpers.cc | 17 + selfdrive/ui/qt/maps/map_helpers.h | 3 +- selfdrive/ui/qt/maps/map_settings.cc | 1 - selfdrive/ui/qt/offroad/driverview.cc | 2 +- selfdrive/ui/qt/offroad/networking.cc | 2 +- selfdrive/ui/qt/offroad/settings.cc | 164 +++--- selfdrive/ui/qt/offroad/settings.h | 71 ++- selfdrive/ui/qt/offroad/wifiManager.cc | 14 +- selfdrive/ui/qt/onroad.cc | 37 +- selfdrive/ui/qt/onroad.h | 1 + selfdrive/ui/qt/qt_window.cc | 30 ++ selfdrive/ui/qt/qt_window.h | 17 +- selfdrive/ui/qt/sidebar.cc | 2 + selfdrive/ui/qt/util.cc | 17 +- selfdrive/ui/qt/util.h | 3 + selfdrive/ui/qt/widgets/cameraview.cc | 180 ++++--- selfdrive/ui/qt/widgets/cameraview.h | 34 +- selfdrive/ui/qt/widgets/controls.cc | 8 +- selfdrive/ui/qt/widgets/drive_stats.cc | 2 - selfdrive/ui/qt/widgets/offroad_alerts.cc | 18 +- selfdrive/ui/qt/widgets/offroad_alerts.h | 3 + selfdrive/ui/qt/widgets/prime.cc | 14 +- selfdrive/ui/qt/window.cc | 11 +- selfdrive/ui/replay/camera.cc | 88 ++++ selfdrive/ui/replay/camera.h | 42 ++ selfdrive/ui/replay/filereader.cc | 62 +++ selfdrive/ui/replay/filereader.h | 20 + selfdrive/ui/replay/framereader.cc | 280 ++++++---- selfdrive/ui/replay/framereader.h | 32 +- selfdrive/ui/replay/logreader.cc | 82 +++ selfdrive/ui/replay/logreader.h | 63 +++ selfdrive/ui/replay/main.cc | 149 ++++++ selfdrive/ui/replay/replay.cc | 345 +++++++++++++ selfdrive/ui/replay/replay.h | 82 +++ selfdrive/ui/replay/route.cc | 136 +++++ selfdrive/ui/replay/route.h | 67 +++ selfdrive/ui/replay/util.cc | 219 ++++++++ selfdrive/ui/replay/util.h | 13 + selfdrive/ui/soundd.cc | 108 ---- selfdrive/ui/soundd/.gitignore | 1 + selfdrive/ui/soundd/main.cc | 22 + selfdrive/ui/soundd/sound.cc | 73 +++ selfdrive/ui/soundd/sound.h | 32 ++ selfdrive/ui/{ => soundd}/soundd | 1 + selfdrive/ui/ui.cc | 105 ++-- selfdrive/ui/ui.h | 56 +- selfdrive/updated.py | 9 +- third_party/acados/aarch64/lib/libacados.so | Bin 567753 -> 575769 bytes third_party/acados/aarch64/lib/libblasfeo.so | Bin 694193 -> 694193 bytes third_party/acados/aarch64/lib/libhpipm.so | Bin 1324409 -> 1324409 bytes .../include/acados/ocp_nlp/ocp_nlp_common.h | 7 + .../acados/sim/sim_collocation_utils.h | 67 +-- .../acados/include/acados/sim/sim_common.h | 3 +- .../acados/include/acados/utils/math.h | 2 +- .../acados/include/acados/utils/timing.h | 2 +- .../include/acados_c/ocp_nlp_interface.h | 13 +- .../acados/include/acados_c/sim_interface.h | 10 +- .../blasfeo/include/blasfeo_block_size.h | 23 +- .../blasfeo/include/blasfeo_d_blasfeo_api.h | 16 +- .../include/blasfeo_d_blasfeo_ref_api.h | 19 +- .../blasfeo/include/blasfeo_d_kernel.h | 211 +++++++- .../blasfeo/include/blasfeo_s_blasfeo_api.h | 12 +- .../include/blasfeo_s_blasfeo_ref_api.h | 15 +- .../blasfeo/include/blasfeo_s_kernel.h | 10 + third_party/acados/larch64/lib/libacados.so | Bin 485104 -> 484904 bytes third_party/acados/larch64/lib/libblasfeo.so | Bin 730608 -> 730608 bytes third_party/acados/larch64/lib/libhpipm.so | Bin 1367352 -> 1367352 bytes third_party/acados/x86_64/lib/libacados.so | Bin 525968 -> 521320 bytes third_party/acados/x86_64/lib/libblasfeo.so | Bin 1265064 -> 1265064 bytes third_party/acados/x86_64/lib/libhpipm.so | Bin 1572648 -> 1572648 bytes third_party/nanovg/nanovg_gl_utils.h | 8 +- tools/lib/README.md | 4 +- tools/lib/auth.py | 115 ++++- tools/lib/framereader.py | 4 +- tools/lib/robust_logreader.py | 60 +++ tools/lib/route.py | 4 +- 328 files changed, 9243 insertions(+), 3954 deletions(-) create mode 100755 common/markdown.py delete mode 100644 common/params_pxd.pxd create mode 100644 docs/LIMITATIONS.md delete mode 100644 docs/SAFETY.md create mode 100644 opendbc/tesla_powertrain.dbc create mode 100644 panda/board/can_definitions.h create mode 100644 panda/board/dlc_to_len.h delete mode 100644 panda/board/safety/safety_gm_ascm.h create mode 100644 panda/board/usb_protocol.h create mode 100644 panda/python/ccp.py create mode 100644 pyextra/acados_template/acados_ocp_solver_pyx.pyx create mode 100644 pyextra/acados_template/acados_solver_common.pxd create mode 100644 pyextra/acados_template/c_templates_tera/acados_solver.in.pxd create mode 100644 selfdrive/assets/fonts/Inter-Black.ttf create mode 100644 selfdrive/assets/fonts/Inter-Bold.ttf create mode 100644 selfdrive/assets/fonts/Inter-ExtraBold.ttf create mode 100644 selfdrive/assets/fonts/Inter-ExtraLight.ttf create mode 100644 selfdrive/assets/fonts/Inter-Light.ttf create mode 100644 selfdrive/assets/fonts/Inter-Medium.ttf create mode 100644 selfdrive/assets/fonts/Inter-Regular.ttf create mode 100644 selfdrive/assets/fonts/Inter-SemiBold.ttf create mode 100644 selfdrive/assets/fonts/Inter-Thin.ttf create mode 100644 selfdrive/car/toyota/tunes.py create mode 100644 selfdrive/ui/navd/.gitignore create mode 100644 selfdrive/ui/navd/main.cc create mode 100755 selfdrive/ui/navd/navd create mode 100644 selfdrive/ui/navd/route_engine.cc create mode 100644 selfdrive/ui/navd/route_engine.h create mode 100644 selfdrive/ui/qt/qt_window.cc create mode 100644 selfdrive/ui/replay/camera.cc create mode 100644 selfdrive/ui/replay/camera.h create mode 100644 selfdrive/ui/replay/filereader.cc create mode 100644 selfdrive/ui/replay/filereader.h create mode 100644 selfdrive/ui/replay/logreader.cc create mode 100644 selfdrive/ui/replay/logreader.h create mode 100644 selfdrive/ui/replay/main.cc create mode 100644 selfdrive/ui/replay/replay.cc create mode 100644 selfdrive/ui/replay/replay.h create mode 100644 selfdrive/ui/replay/route.cc create mode 100644 selfdrive/ui/replay/route.h create mode 100644 selfdrive/ui/replay/util.cc create mode 100644 selfdrive/ui/replay/util.h delete mode 100644 selfdrive/ui/soundd.cc create mode 100644 selfdrive/ui/soundd/.gitignore create mode 100644 selfdrive/ui/soundd/main.cc create mode 100644 selfdrive/ui/soundd/sound.cc create mode 100644 selfdrive/ui/soundd/sound.h rename selfdrive/ui/{ => soundd}/soundd (74%) create mode 100755 tools/lib/robust_logreader.py diff --git a/.gitignore b/.gitignore index b4385e16d..5fc18bb07 100644 --- a/.gitignore +++ b/.gitignore @@ -42,7 +42,6 @@ selfdrive/logcatd/logcatd selfdrive/mapd/default_speeds_by_region.json selfdrive/proclogd/proclogd selfdrive/ui/_ui -selfdrive/ui/_soundd selfdrive/test/longitudinal_maneuvers/out selfdrive/visiond/visiond selfdrive/loggerd/loggerd @@ -78,3 +77,7 @@ selfdrive/modeld/thneed/compile models/*.thneed *.bz2 + +build/ + +!**/.gitkeep diff --git a/Jenkinsfile b/Jenkinsfile index d41a1f904..bcdb7c99f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,7 +37,7 @@ EOF""" def phone_steps(String device_type, steps) { lock(resource: "", label: device_type, inversePrecedence: true, variable: 'device_ip', quantity: 1) { - timeout(time: 150, unit: 'MINUTES') { + timeout(time: 60, unit: 'MINUTES') { phone(device_ip, "git checkout", readFile("selfdrive/test/setup_device_ci.sh"),) steps.each { item -> phone(device_ip, item[0], item[1]) @@ -53,7 +53,7 @@ pipeline { SOURCE_DIR = "/data/openpilot_source/" } options { - timeout(time: 3, unit: 'HOURS') + timeout(time: 4, unit: 'HOURS') } stages { @@ -145,10 +145,10 @@ pipeline { stages { stage('parallel tests') { parallel { - stage('Devel Tests') { + stage('C2: build') { steps { phone_steps("eon-build", [ - ["build devel", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"], + ["build master-ci", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"], ["build openpilot", "cd selfdrive/manager && ./build.py"], ["test manager", "python selfdrive/manager/test/test_manager.py"], ["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"], @@ -157,7 +157,7 @@ pipeline { } } - stage('Replay Tests') { + stage('C2: replay') { steps { phone_steps("eon2", [ ["build", "cd selfdrive/manager && ./build.py"], @@ -166,7 +166,7 @@ pipeline { } } - stage('HW + Unit Tests') { + stage('C2: HW + Unit Tests') { steps { phone_steps("eon", [ ["build", "cd selfdrive/manager && ./build.py"], @@ -201,29 +201,33 @@ pipeline { } */ - stage('tici Build') { + stage('C3: build') { environment { R3_PUSH = "${env.BRANCH_NAME == 'master' ? '1' : ' '}" } steps { phone_steps("tici", [ - ["build", "cd selfdrive/manager && ./build.py"], + ["build master-ci", "cd $SOURCE_DIR/release && EXTRA_FILES='tools/' ./build_devel.sh"], + ["build openpilot", "cd selfdrive/manager && ./build.py"], + ["test manager", "python selfdrive/manager/test/test_manager.py"], ["onroad tests", "cd selfdrive/test/ && ./test_onroad.py"], + ["test car interfaces", "cd selfdrive/car/tests/ && ./test_car_interfaces.py"], ]) } } - stage('Unit Tests (tici)') { + stage('C3: HW + Unit Tests') { steps { phone_steps("tici2", [ ["build", "cd selfdrive/manager && ./build.py"], + ["test boardd loopback", "python selfdrive/boardd/tests/test_boardd_loopback.py"], ["test loggerd", "python selfdrive/loggerd/tests/test_loggerd.py"], ["test encoder", "LD_LIBRARY_PATH=/usr/local/lib python selfdrive/loggerd/tests/test_encoder.py"], ]) } } - stage('EON camerad') { + stage('C2: camerad') { steps { phone_steps("eon-party", [ ["build", "cd selfdrive/manager && ./build.py"], @@ -233,7 +237,7 @@ pipeline { } } - stage('tici camerad') { + stage('C3: camerad') { steps { phone_steps("tici-party", [ ["build", "cd selfdrive/manager && ./build.py"], diff --git a/README.md b/README.md index abe87a72f..b9a58f6a1 100755 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Table of Contents What is openpilot? ------ -[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, openpilot performs the functions of Adaptive Cruise Control (ACC), Automated Lane Centering (ALC), Forward Collision Warning (FCW) and Lane Departure Warning (LDW) for a growing variety of [supported car makes, models and model years](docs/CARS.md). In addition, while openpilot is engaged, a camera based Driver Monitoring (DM) feature alerts distracted and asleep drivers. See more about [the vehicle integration and limitations here](docs/INTEGRATION.md). +[openpilot](http://github.com/commaai/openpilot) is an open source driver assistance system. Currently, openpilot performs the functions of Adaptive Cruise Control (ACC), Automated Lane Centering (ALC), Forward Collision Warning (FCW) and Lane Departure Warning (LDW) for a growing variety of [supported car makes, models and model years](docs/CARS.md). In addition, while openpilot is engaged, a camera based Driver Monitoring (DM) feature alerts distracted and asleep drivers. See more about [the vehicle integration](docs/INTEGRATION.md) and [limitations](docs/LIMITATIONS.md). @@ -61,6 +61,8 @@ Community and Contributing openpilot is developed by [comma](https://comma.ai/) and by users like you. We welcome both pull requests and issues on [GitHub](http://github.com/commaai/openpilot). Bug fixes and new car ports are encouraged. Check out [the contributing docs](docs/CONTRIBUTING.md). +Documentation related to openpilot development can be found on [docs.comma.ai](https://docs.comma.ai). Information about running openpilot (e.g. FAQ, fingerprinting, troubleshooting, custom forks, community hardware) should go on the [wiki](https://github.com/commaai/openpilot/wiki). + You can add support for your car by following guides we have written for [Brand](https://blog.comma.ai/how-to-write-a-car-port-for-openpilot/) and [Model](https://blog.comma.ai/openpilot-port-guide-for-toyota-models/) ports. Generally, a car with adaptive cruise control and lane keep assist is a good candidate. [Join our Discord](https://discord.comma.ai) to discuss car ports: most car makes have a dedicated channel. Want to get paid to work on openpilot? [comma is hiring](https://comma.ai/jobs/). diff --git a/RELEASES.md b/RELEASES.md index 64f0814e2..12a90fba6 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,17 @@ +Version 0.8.11 (2021-11-29) +======================== + * Support for CAN FD on the red panda + * Support for an external panda on the comma three + * Navigation: Show more detailed instructions when approaching maneuver + * Fixed occasional steering faults on GM cars thanks to jyoung8607! + * Nissan ECU firmware fingerprinting thanks to robin-reckmann, martinl, and razem-io! + * Cadillac Escalade ESV 2016 support thanks to Gibby! + * Genesis G70 2020 support thanks to tecandrew! + * Hyundai Santa Fe Hybrid 2022 support thanks to sunnyhaibin! + * Mazda CX-9 2021 support thanks to Jacar! + * Volkswagen Polo 2020 support thanks to jyoung8607! + * Volkswagen T-Roc 2021 support thanks to jyoung8607! + Version 0.8.10 (2021-11-01) ======================== * New driving model diff --git a/SConstruct b/SConstruct index 18c8d2f12..67acd3eac 100644 --- a/SConstruct +++ b/SConstruct @@ -13,9 +13,9 @@ AddOption('--test', action='store_true', help='build test files') -AddOption('--setup', +AddOption('--extras', action='store_true', - help='build setup and installer files') + help='build misc extras, like setup and installer files') AddOption('--kaitai', action='store_true', @@ -68,6 +68,7 @@ lenv = { "PYTHONPATH": Dir("#").abspath + ":" + Dir("#pyextra/").abspath, "ACADOS_SOURCE_DIR": Dir("#third_party/acados/acados").abspath, + "ACADOS_PYTHON_INTERFACE_PATH": Dir("#pyextra/acados_template").abspath, "TERA_PATH": Dir("#").abspath + f"/third_party/acados/{arch}/t_renderer", } @@ -181,12 +182,14 @@ env = Environment( "-O2", "-Wunused", "-Werror", + "-Wshadow", "-Wno-unknown-warning-option", "-Wno-deprecated-register", "-Wno-register", "-Wno-inconsistent-missing-override", "-Wno-c99-designator", "-Wno-reorder-init-list", + "-Wno-error=unused-but-set-variable", ] + cflags + ccflags, CPPPATH=cpppath + [ @@ -267,7 +270,7 @@ def abspath(x): py_include = sysconfig.get_paths()['include'] envCython = env.Clone() envCython["CPPPATH"] += [py_include, np.get_include()] -envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-deprecated-declarations"] +envCython["CCFLAGS"] += ["-Wno-#warnings", "-Wno-shadow", "-Wno-deprecated-declarations"] envCython["LIBS"] = [] if arch == "Darwin": @@ -429,6 +432,9 @@ SConscript(['selfdrive/ui/SConscript']) if arch != "Darwin": SConscript(['selfdrive/logcatd/SConscript']) +if GetOption('test'): + SConscript('panda/tests/safety/SConscript') + external_sconscript = GetOption('external_sconscript') if external_sconscript: SConscript([external_sconscript]) diff --git a/cereal/car.capnp b/cereal/car.capnp index d78acb28e..ce81c7eaf 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -104,6 +104,7 @@ struct CarEvent @0x9b1657f34caf3ad3 { wideRoadCameraError @102; localizerMalfunction @103; highCpuUsage @105; + cruiseMismatch @106; driverMonitorLowAccDEPRECATED @68; radarCanErrorDEPRECATED @15; @@ -150,6 +151,7 @@ struct CarState { # brake pedal, 0.0-1.0 brake @5 :Float32; # this is user pedal only brakePressed @6 :Bool; # this is user pedal only + brakeHoldActive @38 :Bool; # steering wheel steeringAngleDeg @7 :Float32; @@ -289,6 +291,8 @@ struct CarControl { active @7 :Bool; actuators @6 :Actuators; + roll @8 :Float32; + pitch @9 :Float32; cruiseControl @4 :CruiseControl; hudControl @5 :HUDControl; @@ -350,11 +354,11 @@ struct CarControl { chimeEngage @1; chimeDisengage @2; chimeError @3; - chimeWarning1 @4; - chimeWarning2 @5; - chimeWarningRepeat @6; + chimeWarning1 @4; # unused + chimeWarningRepeat @5; + chimeWarningRepeatInfinite @6; chimePrompt @7; - chimeWarning2Repeat @8; + chimeWarning2RepeatInfinite @8; } } diff --git a/cereal/log.capnp b/cereal/log.capnp index 8c6245ab5..92ec6429d 100644 --- a/cereal/log.capnp +++ b/cereal/log.capnp @@ -307,6 +307,7 @@ struct DeviceState @0xa4d8b5af2aa492eb { chargingDisabled @18 :Bool; offroadPowerUsageUwh @23 :UInt32; carBatteryCapacityUwh @25 :UInt32; + powerDrawW @40 :Float32; # device thermals cpuTempC @26 :List(Float32); @@ -315,11 +316,18 @@ struct DeviceState @0xa4d8b5af2aa492eb { ambientTempC @30 :Float32; nvmeTempC @35 :List(Float32); modemTempC @36 :List(Float32); + pmicTempC @39 :List(Float32); + thermalZones @38 :List(ThermalZone); thermalStatus @14 :ThermalStatus; fanSpeedPercentDesired @10 :UInt16; screenBrightnessPercent @37 :Int8; + struct ThermalZone { + name @0 :Text; + temp @1 :Float32; + } + enum ThermalStatus { green @0; yellow @1; @@ -685,6 +693,7 @@ struct ModelDataV2 { orientation @5 :XYZTData; velocity @6 :XYZTData; orientationRate @7 :XYZTData; + acceleration @19 :XYZTData; # prediction lanelines and road edges laneLines @8 :List(XYZTData); @@ -1285,6 +1294,7 @@ struct DriverMonitoringState @0xb83cda094a1da284 { struct Boot { wallTimeNanos @0 :UInt64; pstore @4 :Map(Text, Data); + commands @5 :Map(Text, Data); launchLog @3 :Text; lastKmsgDEPRECATED @1 :Data; @@ -1372,6 +1382,44 @@ struct UploaderState { lastFilename @6 :Text; } +struct NavInstruction { + maneuverPrimaryText @0 :Text; + maneuverSecondaryText @1 :Text; + maneuverDistance @2 :Float32; # m + maneuverType @3 :Text; # TODO: Make Enum + maneuverModifier @4 :Text; # TODO: Make Enum + + distanceRemaining @5 :Float32; # m + timeRemaining @6 :Float32; # s + timeRemainingTypical @7 :Float32; # s + + lanes @8 :List(Lane); + showFull @9 :Bool; + + struct Lane { + directions @0 :List(Direction); + active @1 :Bool; + activeDirection @2 :Direction; + } + + enum Direction { + none @0; + left @1; + right @2; + straight @3; + } + +} + +struct NavRoute { + coordinates @0 :List(Coordinate); + + struct Coordinate { + latitude @0 :Float32; + longitude @1 :Float32; + } +} + struct Event { logMonoTime @0 :UInt64; # nanoseconds valid @67 :Bool = true; @@ -1429,6 +1477,9 @@ struct Event { deviceState @6 :DeviceState; logMessage @18 :Text; + # navigation + navInstruction @82 :NavInstruction; + navRoute @83 :NavRoute; # *********** debug *********** testJoystick @52 :Joystick; diff --git a/cereal/services.py b/cereal/services.py index 4cf10a344..7b9287780 100755 --- a/cereal/services.py +++ b/cereal/services.py @@ -62,6 +62,8 @@ services = { "modelV2": (True, 20., 40), "managerState": (True, 2., 1), "uploaderState": (True, 0., 1), + "navInstruction": (True, 0.), + "navRoute": (True, 0.), # debug "testJoystick": (False, 0.), diff --git a/cereal/visionipc/visionbuf.cc b/cereal/visionipc/visionbuf.cc index 39c521913..e94a8bbc0 100644 --- a/cereal/visionipc/visionbuf.cc +++ b/cereal/visionipc/visionbuf.cc @@ -22,19 +22,28 @@ void visionbuf_compute_aligned_width_and_height(int width, int height, int *alig #endif } -void VisionBuf::init_rgb(size_t width, size_t height, size_t stride) { +void VisionBuf::init_rgb(size_t init_width, size_t init_height, size_t init_stride) { this->rgb = true; - this->width = width; - this->height = height; - this->stride = stride; + this->width = init_width; + this->height = init_height; + this->stride = init_stride; } -void VisionBuf::init_yuv(size_t width, size_t height){ +void VisionBuf::init_yuv(size_t init_width, size_t init_height){ this->rgb = false; - this->width = width; - this->height = height; + this->width = init_width; + this->height = init_height; this->y = (uint8_t *)this->addr; - this->u = this->y + (width * height); - this->v = this->u + (width / 2 * height / 2); + this->u = this->y + (this->width * this->height); + this->v = this->u + (this->width / 2 * this->height / 2); +} + + +uint64_t VisionBuf::get_frame_id() { + return *frame_id; +} + +void VisionBuf::set_frame_id(uint64_t id) { + *frame_id = id; } diff --git a/cereal/visionipc/visionbuf.h b/cereal/visionipc/visionbuf.h index 165a3dbdd..418cbacb9 100644 --- a/cereal/visionipc/visionbuf.h +++ b/cereal/visionipc/visionbuf.h @@ -18,6 +18,7 @@ enum VisionStreamType { VISION_STREAM_YUV_BACK, VISION_STREAM_YUV_FRONT, VISION_STREAM_YUV_WIDE, + VISION_STREAM_RGB_MAP, VISION_STREAM_MAX, }; @@ -26,6 +27,7 @@ class VisionBuf { size_t len = 0; size_t mmap_len = 0; void * addr = nullptr; + uint64_t *frame_id; int fd = 0; bool rgb = false; @@ -57,6 +59,9 @@ class VisionBuf { void init_yuv(size_t width, size_t height); int sync(int dir); int free(); + + void set_frame_id(uint64_t id); + uint64_t get_frame_id(); }; void visionbuf_compute_aligned_width_and_height(int width, int height, int *aligned_w, int *aligned_h); diff --git a/cereal/visionipc/visionbuf_cl.cc b/cereal/visionipc/visionbuf_cl.cc index c203c944c..0286d28fd 100644 --- a/cereal/visionipc/visionbuf_cl.cc +++ b/cereal/visionipc/visionbuf_cl.cc @@ -32,14 +32,11 @@ static void *malloc_with_fd(size_t len, int *fd) { return addr; } -void VisionBuf::allocate(size_t len) { - int fd; - void *addr = malloc_with_fd(len, &fd); - - this->len = len; - this->mmap_len = len; - this->addr = addr; - this->fd = fd; +void VisionBuf::allocate(size_t length) { + this->len = length; + this->mmap_len = this->len; + this->addr = malloc_with_fd(this->len, &this->fd); + this->frame_id = (uint64_t*)((uint8_t*)this->addr + this->len); } void VisionBuf::init_cl(cl_device_id device_id, cl_context ctx){ @@ -57,6 +54,8 @@ void VisionBuf::import(){ assert(this->fd >= 0); this->addr = mmap(NULL, this->mmap_len, PROT_READ | PROT_WRITE, MAP_SHARED, this->fd, 0); assert(this->addr != MAP_FAILED); + + this->frame_id = (uint64_t*)((uint8_t*)this->addr + this->len); } diff --git a/cereal/visionipc/visionbuf_ion.cc b/cereal/visionipc/visionbuf_ion.cc index c367304e9..c66b668c6 100644 --- a/cereal/visionipc/visionbuf_ion.cc +++ b/cereal/visionipc/visionbuf_ion.cc @@ -47,13 +47,13 @@ static void ion_init() { } } -void VisionBuf::allocate(size_t len) { +void VisionBuf::allocate(size_t length) { int err; ion_init(); struct ion_allocation_data ion_alloc = {0}; - ion_alloc.len = len + PADDING_CL; + ion_alloc.len = length + PADDING_CL + sizeof(uint64_t); ion_alloc.align = 4096; ion_alloc.heap_id_mask = 1 << ION_IOMMU_HEAP_ID; ion_alloc.flags = ION_FLAG_CACHED; @@ -66,18 +66,19 @@ void VisionBuf::allocate(size_t len) { err = HANDLE_EINTR(ioctl(ion_fd, ION_IOC_SHARE, &ion_fd_data)); assert(err == 0); - void *addr = mmap(NULL, ion_alloc.len, - PROT_READ | PROT_WRITE, - MAP_SHARED, ion_fd_data.fd, 0); - assert(addr != MAP_FAILED); + void *mmap_addr = mmap(NULL, ion_alloc.len, + PROT_READ | PROT_WRITE, + MAP_SHARED, ion_fd_data.fd, 0); + assert(mmap_addr != MAP_FAILED); - memset(addr, 0, ion_alloc.len); + memset(mmap_addr, 0, ion_alloc.len); - this->len = len; + this->len = length; this->mmap_len = ion_alloc.len; - this->addr = addr; + this->addr = mmap_addr; this->handle = ion_alloc.handle; this->fd = ion_fd_data.fd; + this->frame_id = (uint64_t*)((uint8_t*)this->addr + this->len + PADDING_CL); } void VisionBuf::import(){ @@ -95,6 +96,8 @@ void VisionBuf::import(){ this->handle = fd_data.handle; this->addr = mmap(NULL, this->mmap_len, PROT_READ | PROT_WRITE, MAP_SHARED, this->fd, 0); assert(this->addr != MAP_FAILED); + + this->frame_id = (uint64_t*)((uint8_t*)this->addr + this->len + PADDING_CL); } void VisionBuf::init_cl(cl_device_id device_id, cl_context ctx) { diff --git a/cereal/visionipc/visionipc_server.cc b/cereal/visionipc/visionipc_server.cc index fdacd7843..e15c1aee4 100644 --- a/cereal/visionipc/visionipc_server.cc +++ b/cereal/visionipc/visionipc_server.cc @@ -45,7 +45,6 @@ void VisionIpcServer::create_buffers(VisionStreamType type, size_t num_buffers, size = width * height * 3 / 2; } - // Create map + alloc requested buffers for (size_t i = 0; i < num_buffers; i++){ VisionBuf* buf = new VisionBuf(); diff --git a/cereal/visionipc/visionipc_tests.cc b/cereal/visionipc/visionipc_tests.cc index c2cd43da2..a68bda0b8 100644 --- a/cereal/visionipc/visionipc_tests.cc +++ b/cereal/visionipc/visionipc_tests.cc @@ -68,6 +68,7 @@ TEST_CASE("Send single buffer"){ VisionIpcBufExtra extra = {0}; extra.frame_id = 1337; + buf->set_frame_id(extra.frame_id); server.send(buf, &extra); @@ -76,6 +77,7 @@ TEST_CASE("Send single buffer"){ REQUIRE(recv_buf != nullptr); REQUIRE(*(uint64_t*)recv_buf->addr == 1234); REQUIRE(extra_recv.frame_id == extra.frame_id); + REQUIRE(recv_buf->get_frame_id() == extra.frame_id); } diff --git a/common/markdown.py b/common/markdown.py new file mode 100755 index 000000000..30c5bc2c0 --- /dev/null +++ b/common/markdown.py @@ -0,0 +1,48 @@ +from typing import List + +HTML_REPLACEMENTS = [ + (r'&', r'&'), + (r'"', r'"'), +] + + +def parse_markdown(text: str, tab_length: int = 2) -> str: + lines = text.split("\n") + output: List[str] = [] + list_level = 0 + + def end_outstanding_lists(level: int, end_level: int) -> int: + while level > end_level: + level -= 1 + output.append("") + if level > 0: + output.append("") + return end_level + + for i, line in enumerate(lines): + if i + 1 < len(lines) and lines[i + 1].startswith("==="): # heading + output.append(f"

{line}

") + elif line.startswith("==="): + pass + elif line.lstrip().startswith("* "): # list + line_level = 1 + line.count(" " * tab_length, 0, line.index("*")) + if list_level >= line_level: + list_level = end_outstanding_lists(list_level, line_level) + else: + list_level += 1 + if list_level > 1: + output[-1] = output[-1].replace("", "") + output.append("