From 6087e5ad7f13a67e966549b784bdc4844aa0e50d Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Thu, 16 Jul 2026 01:04:49 -0400 Subject: [PATCH] sync: fix upstream conflicts --- .gitmodules | 2 +- SConstruct | 2 +- opendbc_repo | 2 +- {common => openpilot/common}/api/__init__.py | 0 {common => openpilot/common}/api/base.py | 2 +- .../common}/api/comma_connect.py | 0 openpilot/selfdrive/car/helpers.py | 2 +- openpilot/selfdrive/modeld/compile_warp.py | 201 ----------------- .../selfdrive/monitoring/test_monitoring.py | 4 +- .../selfdrive}/ui/sunnypilot/__init__.py | 0 .../ui/sunnypilot/layouts/__init__.py | 0 .../ui/sunnypilot/layouts/onboarding.py | 2 +- .../sunnypilot/layouts/settings/__init__.py | 0 .../ui/sunnypilot/layouts/settings/cruise.py | 0 .../cruise_sub_layouts/speed_limit_policy.py | 0 .../speed_limit_settings.py | 0 .../sunnypilot/layouts/settings/developer.py | 0 .../ui/sunnypilot/layouts/settings/device.py | 0 .../ui/sunnypilot/layouts/settings/display.py | 0 .../ui/sunnypilot/layouts/settings/models.py | 2 +- .../sunnypilot/layouts/settings/navigation.py | 0 .../ui/sunnypilot/layouts/settings/network.py | 0 .../ui/sunnypilot/layouts/settings/osm.py | 0 .../sunnypilot/layouts/settings/settings.py | 0 .../sunnypilot/layouts/settings/software.py | 0 .../sunnypilot/layouts/settings/steering.py | 2 +- .../lane_change_settings.py | 0 .../steering_sub_layouts/mads_settings.py | 0 .../steering_sub_layouts/torque_settings.py | 2 +- .../sunnypilot/layouts/settings/sunnylink.py | 4 +- .../ui/sunnypilot/layouts/settings/trips.py | 0 .../layouts/settings/vehicle/__init__.py | 0 .../settings/vehicle/brands/__init__.py | 0 .../layouts/settings/vehicle/brands/base.py | 0 .../layouts/settings/vehicle/brands/body.py | 0 .../settings/vehicle/brands/chrysler.py | 0 .../settings/vehicle/brands/factory.py | 0 .../layouts/settings/vehicle/brands/ford.py | 0 .../layouts/settings/vehicle/brands/gm.py | 0 .../layouts/settings/vehicle/brands/honda.py | 0 .../settings/vehicle/brands/hyundai.py | 0 .../layouts/settings/vehicle/brands/mazda.py | 0 .../layouts/settings/vehicle/brands/nissan.py | 0 .../layouts/settings/vehicle/brands/psa.py | 0 .../layouts/settings/vehicle/brands/rivian.py | 0 .../layouts/settings/vehicle/brands/subaru.py | 0 .../layouts/settings/vehicle/brands/tesla.py | 0 .../layouts/settings/vehicle/brands/toyota.py | 0 .../settings/vehicle/brands/volkswagen.py | 0 .../settings/vehicle/platform_selector.py | 2 +- .../ui/sunnypilot/layouts/settings/visuals.py | 0 .../ui/sunnypilot/layouts/sidebar.py | 0 .../selfdrive}/ui/sunnypilot/mici/__init__.py | 0 .../ui/sunnypilot/mici/layouts/__init__.py | 0 .../ui/sunnypilot/mici/layouts/models.py | 2 +- .../ui/sunnypilot/mici/layouts/onboarding.py | 0 .../ui/sunnypilot/mici/layouts/settings.py | 0 .../ui/sunnypilot/mici/layouts/sunnylink.py | 4 +- .../ui/sunnypilot/mici/onroad/__init__.py | 0 .../sunnypilot/mici/onroad/confidence_ball.py | 0 .../ui/sunnypilot/mici/onroad/hud_renderer.py | 0 .../sunnypilot/mici/onroad/model_renderer.py | 0 .../ui/sunnypilot/mici/widgets/__init__.py | 0 .../mici/widgets/sunnylink_pairing_dialog.py | 0 .../ui/sunnypilot/onroad/__init__.py | 0 .../ui/sunnypilot/onroad/alert_renderer.py | 0 .../sunnypilot/onroad/augmented_road_view.py | 0 .../onroad/blind_spot_indicators.py | 0 .../ui/sunnypilot/onroad/chevron_metrics.py | 4 +- .../ui/sunnypilot/onroad/circular_alerts.py | 2 +- .../onroad/developer_ui/__init__.py | 0 .../onroad/developer_ui/elements.py | 2 +- .../ui/sunnypilot/onroad/driver_state.py | 0 .../ui/sunnypilot/onroad/hud_renderer.py | 0 .../ui/sunnypilot/onroad/model_renderer.py | 0 .../ui/sunnypilot/onroad/rainbow_path.py | 0 .../ui/sunnypilot/onroad/road_name.py | 0 .../ui/sunnypilot/onroad/rocket_fuel.py | 0 .../sunnypilot/onroad/smart_cruise_control.py | 0 .../ui/sunnypilot/onroad/speed_limit.py | 2 +- .../ui/sunnypilot/onroad/speed_renderer.py | 0 .../ui/sunnypilot/onroad/turn_signal.py | 0 .../selfdrive}/ui/sunnypilot/ui_state.py | 3 +- openpilot/sunnypilot | 1 - .../sunnypilot}/SConscript | 0 .../sunnypilot}/__init__.py | 0 .../common/transformations/SConscript | 0 .../common/transformations/coordinates.cc | 0 .../common/transformations/coordinates.hpp | 0 .../common/transformations/orientation.cc | 0 .../common/transformations/orientation.hpp | 0 .../sunnypilot}/common/version.h | 0 .../sunnypilot}/livedelay/__init__.py | 0 .../sunnypilot}/livedelay/helpers.py | 0 .../sunnypilot}/livedelay/lagd_toggle.py | 2 +- .../sunnypilot}/mads/helpers.py | 0 .../sunnypilot}/mads/mads.py | 2 +- .../sunnypilot}/mads/state.py | 2 +- .../mads/tests/test_mads_state_machine.py | 2 +- .../mads/tests/test_mads_steering_mode.py | 2 +- .../sunnypilot}/mapd/__init__.py | 2 +- .../mapd/live_map_data/__init__.py | 0 .../mapd/live_map_data/base_map_data.py | 2 +- .../sunnypilot}/mapd/live_map_data/debug.py | 2 +- .../mapd/live_map_data/osm_map_data.py | 2 +- .../mapd/live_map_data/standalone.py | 0 .../sunnypilot}/mapd/mapd_installer.py | 4 +- .../sunnypilot}/mapd/mapd_manager.py | 0 .../sunnypilot}/mapd/tests/__init__.py | 0 .../sunnypilot}/mapd/tests/mapd_hash | 0 .../mapd/tests/test_mapd_version.py | 0 .../sunnypilot}/mapd/update_version.py | 4 +- .../sunnypilot}/mapd/version.py | 0 .../sunnypilot}/modeld_v2/.gitignore | 0 .../sunnypilot}/modeld_v2/SConscript | 6 +- .../sunnypilot}/modeld_v2/__init__.py | 0 .../modeld_v2/camera_offset_helper.py | 0 .../sunnypilot}/modeld_v2/compile_modeld.py | 0 .../sunnypilot}/modeld_v2/constants.py | 0 .../sunnypilot}/modeld_v2/fill_model_msg.py | 2 +- .../modeld_v2/get_model_metadata.py | 0 .../modeld_v2/install_models_pc.py | 0 .../sunnypilot}/modeld_v2/meta_20hz.py | 0 .../sunnypilot}/modeld_v2/meta_helper.py | 2 +- .../sunnypilot}/modeld_v2/modeld | 0 .../sunnypilot}/modeld_v2/modeld.py | 11 +- .../sunnypilot}/modeld_v2/modeld_base.py | 0 .../modeld_v2/parse_model_outputs.py | 0 .../modeld_v2/parse_model_outputs_split.py | 0 .../sunnypilot}/modeld_v2/tests/__init__.py | 0 .../sunnypilot}/modeld_v2/tests/conftest.py | 0 .../tests/test_camera_offset_helper.py | 0 .../tests/test_combined_pkl_loader.py | 0 .../modeld_v2/tests/test_compile_modeld.py | 0 .../modeld_v2/tests/test_recovery_power.py | 2 +- .../sunnypilot}/modeld_v2/tests/test_warp.py | 0 .../sunnypilot}/modeld_v2/warp.py | 0 .../sunnypilot}/models/README.md | 0 .../sunnypilot}/models/__init__.py | 0 .../sunnypilot}/models/constants.py | 0 .../sunnypilot}/models/default_model.py | 6 +- .../sunnypilot}/models/fetcher.py | 2 +- .../sunnypilot}/models/helpers.py | 2 +- .../sunnypilot}/models/manager.py | 2 +- .../sunnypilot}/models/model_name.py | 0 .../sunnypilot}/models/runners/constants.py | 2 +- .../sunnypilot}/models/runners/helpers.py | 0 .../models/runners/model_runner.py | 0 .../models/runners/tinygrad/model_types.py | 0 .../runners/tinygrad/tinygrad_runner.py | 0 .../models/split_model_constants.py | 0 .../sunnypilot}/models/tests/__init__.py | 0 .../sunnypilot}/models/tests/model_hash | 0 .../models/tests/model_manager_audit.py | 2 +- .../models/tests/test_default_model.py | 0 .../models/tests/test_tinygrad_ref.py | 0 .../sunnypilot}/models/tinygrad_ref.py | 0 .../sunnypilot}/navd/helpers.py | 0 .../sunnypilot}/neural_network_data | 0 .../sunnypilot}/selfdrive/__init__.py | 0 .../selfdrive/assets/icons/clock.png | 0 .../selfdrive/assets/icons/star-empty.png | 0 .../selfdrive/assets/icons/star-filled.png | 0 .../assets/icons_mici/always_offroad.png | 0 .../assets/icons_mici/disable_offroad.png | 0 .../selfdrive/assets/images/green_light.png | 0 .../selfdrive/assets/images/lead_depart.png | 0 .../assets/images/spinner_sunnypilot.png | 0 .../selfdrive/assets/img_minus_arrow_down.png | 0 .../selfdrive/assets/img_plus_arrow_up.png | 0 .../sunnypilot}/selfdrive/assets/logo.png | 0 .../selfdrive/assets/offroad/icon_display.png | 0 .../assets/offroad/icon_exit_offroad.png | 0 .../assets/offroad/icon_firehose.png | 0 .../assets/offroad/icon_firehose.svg | 0 .../selfdrive/assets/offroad/icon_home.png | 0 .../selfdrive/assets/offroad/icon_home.svg | 0 .../selfdrive/assets/offroad/icon_lateral.png | 0 .../selfdrive/assets/offroad/icon_map.png | 0 .../selfdrive/assets/offroad/icon_models.png | 0 .../assets/offroad/icon_software.png | 0 .../selfdrive/assets/offroad/icon_toggle.png | 0 .../selfdrive/assets/offroad/icon_trips.png | 0 .../selfdrive/assets/offroad/icon_vehicle.png | 0 .../selfdrive/assets/offroad/icon_visuals.png | 0 .../sunnypilot}/selfdrive/car/__init__.py | 0 .../sunnypilot/selfdrive/car/car_list.json | 1 + .../sunnypilot}/selfdrive/car/car_specific.py | 2 +- .../sunnypilot}/selfdrive/car/cruise_ext.py | 3 +- .../selfdrive/car/cruise_helpers.py | 3 +- .../__init__.py | 0 .../controller.py | 3 +- .../helpers.py | 0 .../sunnypilot}/selfdrive/car/interfaces.py | 0 .../selfdrive/car/sync_sunnylink_params.py | 2 +- .../selfdrive/car/tests/__init__.py | 0 .../selfdrive/car/tests/test_cruise_mode.py | 2 +- .../selfdrive/car/tests/test_custom_cruise.py | 2 +- .../selfdrive/controls/__init__.py | 0 .../selfdrive/controls/controlsd_ext.py | 14 +- .../selfdrive/controls/lib/__init__.py | 0 .../controls/lib/auto_lane_change.py | 2 +- .../controls/lib/blinker_pause_lateral.py | 2 +- .../selfdrive/controls/lib/dec/__init__.py | 0 .../selfdrive/controls/lib/dec/constants.py | 0 .../selfdrive/controls/lib/dec/dec.py | 4 +- .../controls/lib/dec/tests/__init__.py | 0 .../dec/tests/pytest_dynamic_controller.py | 0 .../controls/lib/e2e_alerts_helper.py | 4 +- .../controls/lib/lane_turn_desire.py | 2 +- .../controls/lib/latcontrol_torque_ext.py | 0 .../lib/latcontrol_torque_ext_base.py | 0 .../lib/latcontrol_torque_ext_override.py | 0 .../controls/lib/latcontrol_torque_v0.py | 2 +- .../lib/latcontrol_torque_versions.json | 0 .../controls/lib/longitudinal_planner.py | 2 +- .../selfdrive/controls/lib/nnlc/__init__.py | 0 .../selfdrive/controls/lib/nnlc/helpers.py | 4 +- .../selfdrive/controls/lib/nnlc/model.py | 0 .../selfdrive/controls/lib/nnlc/nnlc.py | 0 .../controls/lib/nnlc/tests/__init__.py | 0 .../lib/nnlc/tests/test_fingerprint.py | 0 .../lib/nnlc/tests/test_load_model.py | 0 .../controls/lib/nnlc/tests/test_nnlc.py | 3 +- .../lib/smart_cruise_control/__init__.py | 0 .../smart_cruise_control/map_controller.py | 2 +- .../smart_cruise_control.py | 2 +- .../tests/test_map_controller.py | 2 +- .../tests/test_vision_controller.py | 4 +- .../smart_cruise_control/vision_controller.py | 4 +- .../controls/lib/speed_limit/__init__.py | 0 .../controls/lib/speed_limit/common.py | 0 .../controls/lib/speed_limit/helpers.py | 3 +- .../lib/speed_limit/speed_limit_assist.py | 3 +- .../lib/speed_limit/speed_limit_resolver.py | 4 +- .../lib/speed_limit/tests/__init__.py | 0 .../tests/test_speed_limit_assist.py | 2 +- .../tests/test_speed_limit_resolver.py | 2 +- .../lib/tests/test_auto_lane_change.py | 0 .../lib/tests/test_blinker_pause_lateral.py | 2 +- .../lib/tests/test_lane_turn_desire.py | 2 +- .../selfdrive/locationd/.gitignore | 0 .../selfdrive/locationd/SConscript | 0 .../selfdrive/locationd/__init__.py | 0 .../selfdrive/locationd/locationd.cc | 0 .../selfdrive/locationd/locationd.h | 0 .../selfdrive/locationd/models/.gitignore | 0 .../selfdrive/locationd/models/__init__.py | 0 .../selfdrive/locationd/models/car_kf.py | 0 .../selfdrive/locationd/models/constants.py | 0 .../selfdrive/locationd/models/live_kf.cc | 0 .../selfdrive/locationd/models/live_kf.h | 0 .../selfdrive/locationd/models/live_kf.py | 0 .../selfdrive/locationd/tests/.gitignore | 0 .../selfdrive/locationd/tests/__init__.py | 0 .../locationd/tests/test_locationd.py | 4 +- .../selfdrive/locationd/torqued_ext.py | 2 +- .../sunnypilot}/selfdrive/pandad/__init__.py | 0 .../selfdrive/pandad/rivian_long_flasher.py | 3 +- .../pandad/rivian_long_fw.bin.signed | Bin .../selfdrive/selfdrived/__init__.py | 0 .../selfdrive/selfdrived/events.py | 5 +- .../selfdrive/selfdrived/events_base.py | 18 +- .../sunnypilot}/selfdrive/ui/quiet_mode.py | 2 +- .../sunnypilot}/sunnylink/__init__.py | 0 .../sunnypilot}/sunnylink/api.py | 0 .../sunnypilot}/sunnylink/athena/__init__.py | 0 .../sunnylink/athena/manage_sunnylinkd.py | 0 .../sunnylink/athena/sunnylinkd.py | 2 +- .../sunnylink/athena/tests/test_sunnylinkd.py | 0 .../sunnylink/backups/AESCipher.py | 0 .../sunnypilot}/sunnylink/backups/__init__.py | 0 .../sunnypilot}/sunnylink/backups/manager.py | 4 +- .../sunnypilot}/sunnylink/backups/utils.py | 0 .../sunnypilot}/sunnylink/capabilities.py | 3 +- .../sunnypilot}/sunnylink/docs/README.md | 0 .../sunnylink/registration_manager.py | 2 +- .../sunnypilot}/sunnylink/settings_ui.json | 0 .../sunnylink/settings_ui.schema.json | 0 .../sunnylink/settings_ui_src/_macros.yaml | 0 .../_schemas/macros.schema.json | 0 .../settings_ui_src/_schemas/page.schema.json | 0 .../settings_ui_src/_schemas/rule.schema.json | 0 .../settings_ui_src/pages/cruise.yaml | 0 .../settings_ui_src/pages/developer.yaml | 0 .../settings_ui_src/pages/device.yaml | 0 .../settings_ui_src/pages/display.yaml | 0 .../settings_ui_src/pages/models.yaml | 0 .../settings_ui_src/pages/software.yaml | 0 .../settings_ui_src/pages/steering.yaml | 0 .../settings_ui_src/pages/toggles.yaml | 0 .../settings_ui_src/pages/vehicle.yaml | 0 .../settings_ui_src/pages/visuals.yaml | 0 .../sunnypilot}/sunnylink/statsd.py | 6 +- .../sunnypilot}/sunnylink/sunnylink_state.py | 2 +- .../sunnylink/tests/test_capabilities.py | 0 .../tests/test_compile_settings_ui.py | 0 .../sunnylink/tests/test_settings_changes.py | 0 .../sunnylink/tests/test_settings_schema.py | 0 .../sunnylink/tools/apply_macros.py | 0 .../sunnylink/tools/compile_settings_ui.py | 0 .../sunnylink/tools/extract_settings_ui.py | 0 .../tools/generate_settings_schema.py | 0 .../sunnylink/tools/validate_settings_ui.py | 0 .../sunnypilot}/sunnylink/uploader.py | 4 +- .../sunnypilot}/sunnylink/utils.py | 2 +- .../sunnypilot}/system/__init__.py | 0 .../sunnypilot}/system/hardware/c3/README.md | 0 .../sunnypilot}/system/hardware/c3/agnos.json | 0 .../system/hardware/c3/launch_chffrplus.sh | 0 .../system/hardware/c3/launch_env.sh | 0 .../sunnypilot}/system/params_migration.py | 0 .../sunnypilot}/system/sensord/.gitignore | 0 .../sunnypilot}/system/sensord/SConscript | 0 .../system/sensord/sensors/bmx055_accel.cc | 0 .../system/sensord/sensors/bmx055_accel.h | 0 .../system/sensord/sensors/bmx055_gyro.cc | 0 .../system/sensord/sensors/bmx055_gyro.h | 0 .../system/sensord/sensors/bmx055_magn.cc | 0 .../system/sensord/sensors/bmx055_magn.h | 0 .../system/sensord/sensors/bmx055_temp.cc | 0 .../system/sensord/sensors/bmx055_temp.h | 0 .../system/sensord/sensors/constants.h | 0 .../system/sensord/sensors/i2c_sensor.cc | 0 .../system/sensord/sensors/i2c_sensor.h | 0 .../system/sensord/sensors/lsm6ds3_accel.cc | 0 .../system/sensord/sensors/lsm6ds3_accel.h | 0 .../system/sensord/sensors/lsm6ds3_gyro.cc | 0 .../system/sensord/sensors/lsm6ds3_gyro.h | 0 .../system/sensord/sensors/lsm6ds3_temp.cc | 0 .../system/sensord/sensors/lsm6ds3_temp.h | 0 .../system/sensord/sensors/mmc5603nj_magn.cc | 0 .../system/sensord/sensors/mmc5603nj_magn.h | 0 .../system/sensord/sensors/sensor.h | 0 .../system/sensord/sensors_qcom2.cc | 0 .../system/sensord/tests/test_sensord.py | 6 +- .../system/sensord/tests/ttff_test.py | 2 +- .../sunnypilot/system}/statsd.py | 4 +- .../tests/test_sp_branch_migrations.py | 0 .../sunnypilot}/tools/__init__.py | 0 .../tools/memory_profiler/__init__.py | 0 .../tools/memory_profiler/mem_usage.py | 0 .../sunnypilot}/tools/pull_footage.py | 0 openpilot/system/hardware/hardwared.py | 20 ++ openpilot/system/hardware/power_monitoring.py | 2 + openpilot/system/manager/process_config.py | 87 +++++++- .../system}/ui/sunnypilot/lib/application.py | 0 .../system}/ui/sunnypilot/lib/styles.py | 0 .../system}/ui/sunnypilot/lib/utils.py | 0 .../system}/ui/sunnypilot/widgets/__init__.py | 0 .../ui/sunnypilot/widgets/helpers/__init__.py | 0 .../widgets/helpers/fuzzy_search.py | 0 .../sunnypilot/widgets/helpers/star_icon.py | 0 .../ui/sunnypilot/widgets/html_render.py | 0 .../ui/sunnypilot/widgets/input_dialog.py | 0 .../ui/sunnypilot/widgets/list_view.py | 0 .../ui/sunnypilot/widgets/option_control.py | 0 .../ui/sunnypilot/widgets/progress_bar.py | 0 .../widgets/sunnylink_pairing_dialog.py | 0 .../system}/ui/sunnypilot/widgets/toggle.py | 0 .../ui/sunnypilot/widgets/tree_dialog.py | 0 .../third_party}/copyparty/copyparty-sfx.py | 0 .../third_party}/mapd_pfeiferj/README.md | 0 .../third_party}/mapd_pfeiferj/mapd | Bin panda | 2 +- sunnypilot/selfdrive/car/car_list.json | 1 - system/manager/process_config.py | 209 ------------------ uv.lock | 9 +- 368 files changed, 255 insertions(+), 549 deletions(-) rename {common => openpilot/common}/api/__init__.py (100%) rename {common => openpilot/common}/api/base.py (98%) rename {common => openpilot/common}/api/comma_connect.py (100%) delete mode 100755 openpilot/selfdrive/modeld/compile_warp.py rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/onboarding.py (98%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/cruise.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_policy.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_settings.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/developer.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/device.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/display.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/models.py (99%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/navigation.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/network.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/osm.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/settings.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/software.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/steering.py (99%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/steering_sub_layouts/lane_change_settings.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/steering_sub_layouts/mads_settings.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/steering_sub_layouts/torque_settings.py (98%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/sunnylink.py (99%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/trips.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/base.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/body.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/chrysler.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/factory.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/ford.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/gm.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/honda.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/hyundai.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/mazda.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/nissan.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/psa.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/rivian.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/subaru.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/tesla.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/toyota.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/brands/volkswagen.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/vehicle/platform_selector.py (98%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/settings/visuals.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/layouts/sidebar.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/layouts/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/layouts/models.py (99%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/layouts/onboarding.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/layouts/settings.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/layouts/sunnylink.py (99%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/onroad/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/onroad/confidence_ball.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/onroad/hud_renderer.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/onroad/model_renderer.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/widgets/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/mici/widgets/sunnylink_pairing_dialog.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/alert_renderer.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/augmented_road_view.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/blind_spot_indicators.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/chevron_metrics.py (97%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/circular_alerts.py (99%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/developer_ui/__init__.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/developer_ui/elements.py (99%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/driver_state.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/hud_renderer.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/model_renderer.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/rainbow_path.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/road_name.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/rocket_fuel.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/smart_cruise_control.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/speed_limit.py (99%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/speed_renderer.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/onroad/turn_signal.py (100%) rename {selfdrive => openpilot/selfdrive}/ui/sunnypilot/ui_state.py (99%) delete mode 120000 openpilot/sunnypilot rename {sunnypilot => openpilot/sunnypilot}/SConscript (100%) rename {sunnypilot => openpilot/sunnypilot}/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/common/transformations/SConscript (100%) rename {sunnypilot => openpilot/sunnypilot}/common/transformations/coordinates.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/common/transformations/coordinates.hpp (100%) rename {sunnypilot => openpilot/sunnypilot}/common/transformations/orientation.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/common/transformations/orientation.hpp (100%) rename {sunnypilot => openpilot/sunnypilot}/common/version.h (100%) rename {sunnypilot => openpilot/sunnypilot}/livedelay/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/livedelay/helpers.py (100%) rename {sunnypilot => openpilot/sunnypilot}/livedelay/lagd_toggle.py (97%) rename {sunnypilot => openpilot/sunnypilot}/mads/helpers.py (100%) rename {sunnypilot => openpilot/sunnypilot}/mads/mads.py (99%) rename {sunnypilot => openpilot/sunnypilot}/mads/state.py (99%) rename {sunnypilot => openpilot/sunnypilot}/mads/tests/test_mads_state_machine.py (99%) rename {sunnypilot => openpilot/sunnypilot}/mads/tests/test_mads_steering_mode.py (99%) rename {sunnypilot => openpilot/sunnypilot}/mapd/__init__.py (56%) rename {sunnypilot => openpilot/sunnypilot}/mapd/live_map_data/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/mapd/live_map_data/base_map_data.py (97%) rename {sunnypilot => openpilot/sunnypilot}/mapd/live_map_data/debug.py (98%) rename {sunnypilot => openpilot/sunnypilot}/mapd/live_map_data/osm_map_data.py (98%) rename {sunnypilot => openpilot/sunnypilot}/mapd/live_map_data/standalone.py (100%) rename {sunnypilot => openpilot/sunnypilot}/mapd/mapd_installer.py (98%) rename {sunnypilot => openpilot/sunnypilot}/mapd/mapd_manager.py (100%) rename {sunnypilot => openpilot/sunnypilot}/mapd/tests/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/mapd/tests/mapd_hash (100%) rename {sunnypilot => openpilot/sunnypilot}/mapd/tests/test_mapd_version.py (100%) rename {sunnypilot => openpilot/sunnypilot}/mapd/update_version.py (93%) rename {sunnypilot => openpilot/sunnypilot}/mapd/version.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/.gitignore (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/SConscript (93%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/camera_offset_helper.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/compile_modeld.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/constants.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/fill_model_msg.py (99%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/get_model_metadata.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/install_models_pc.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/meta_20hz.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/meta_helper.py (96%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/modeld (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/modeld.py (98%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/modeld_base.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/parse_model_outputs.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/parse_model_outputs_split.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/tests/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/tests/conftest.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/tests/test_camera_offset_helper.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/tests/test_combined_pkl_loader.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/tests/test_compile_modeld.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/tests/test_recovery_power.py (98%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/tests/test_warp.py (100%) rename {sunnypilot => openpilot/sunnypilot}/modeld_v2/warp.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/README.md (100%) rename {sunnypilot => openpilot/sunnypilot}/models/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/constants.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/default_model.py (84%) rename {sunnypilot => openpilot/sunnypilot}/models/fetcher.py (99%) rename {sunnypilot => openpilot/sunnypilot}/models/helpers.py (99%) rename {sunnypilot => openpilot/sunnypilot}/models/manager.py (99%) rename {sunnypilot => openpilot/sunnypilot}/models/model_name.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/runners/constants.py (91%) rename {sunnypilot => openpilot/sunnypilot}/models/runners/helpers.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/runners/model_runner.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/runners/tinygrad/model_types.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/runners/tinygrad/tinygrad_runner.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/split_model_constants.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/tests/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/tests/model_hash (100%) rename {sunnypilot => openpilot/sunnypilot}/models/tests/model_manager_audit.py (93%) rename {sunnypilot => openpilot/sunnypilot}/models/tests/test_default_model.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/tests/test_tinygrad_ref.py (100%) rename {sunnypilot => openpilot/sunnypilot}/models/tinygrad_ref.py (100%) rename {sunnypilot => openpilot/sunnypilot}/navd/helpers.py (100%) rename {sunnypilot => openpilot/sunnypilot}/neural_network_data (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/icons/clock.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/icons/star-empty.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/icons/star-filled.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/icons_mici/always_offroad.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/icons_mici/disable_offroad.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/images/green_light.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/images/lead_depart.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/images/spinner_sunnypilot.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/img_minus_arrow_down.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/img_plus_arrow_up.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/logo.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_display.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_exit_offroad.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_firehose.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_firehose.svg (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_home.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_home.svg (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_lateral.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_map.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_models.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_software.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_toggle.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_trips.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_vehicle.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/assets/offroad/icon_visuals.png (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/__init__.py (100%) create mode 120000 openpilot/sunnypilot/selfdrive/car/car_list.json rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/car_specific.py (97%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/cruise_ext.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/cruise_helpers.py (96%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/intelligent_cruise_button_management/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/intelligent_cruise_button_management/controller.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/intelligent_cruise_button_management/helpers.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/interfaces.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/sync_sunnylink_params.py (88%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/tests/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/tests/test_cruise_mode.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/car/tests/test_custom_cruise.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/controlsd_ext.py (94%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/auto_lane_change.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/blinker_pause_lateral.py (97%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/dec/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/dec/constants.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/dec/dec.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/dec/tests/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/dec/tests/pytest_dynamic_controller.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/e2e_alerts_helper.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/lane_turn_desire.py (97%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/latcontrol_torque_ext.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/latcontrol_torque_ext_base.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/latcontrol_torque_ext_override.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/latcontrol_torque_v0.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/latcontrol_torque_versions.json (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/longitudinal_planner.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/nnlc/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/nnlc/helpers.py (92%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/nnlc/model.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/nnlc/nnlc.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/nnlc/tests/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/nnlc/tests/test_fingerprint.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/nnlc/tests/test_load_model.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/nnlc/tests/test_nnlc.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/smart_cruise_control/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/smart_cruise_control/map_controller.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/smart_cruise_control/smart_cruise_control.py (94%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/smart_cruise_control/tests/test_map_controller.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/smart_cruise_control/tests/test_vision_controller.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/smart_cruise_control/vision_controller.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/speed_limit/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/speed_limit/common.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/speed_limit/helpers.py (95%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/speed_limit/speed_limit_assist.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/speed_limit/speed_limit_resolver.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/speed_limit/tests/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_assist.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_resolver.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/tests/test_auto_lane_change.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/tests/test_blinker_pause_lateral.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/controls/lib/tests/test_lane_turn_desire.py (99%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/.gitignore (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/SConscript (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/locationd.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/locationd.h (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/models/.gitignore (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/models/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/models/car_kf.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/models/constants.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/models/live_kf.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/models/live_kf.h (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/models/live_kf.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/tests/.gitignore (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/tests/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/tests/test_locationd.py (97%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/locationd/torqued_ext.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/pandad/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/pandad/rivian_long_flasher.py (97%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/pandad/rivian_long_fw.bin.signed (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/selfdrived/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/selfdrived/events.py (98%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/selfdrived/events_base.py (94%) rename {sunnypilot => openpilot/sunnypilot}/selfdrive/ui/quiet_mode.py (96%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/api.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/athena/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/athena/manage_sunnylinkd.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/athena/sunnylinkd.py (99%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/athena/tests/test_sunnylinkd.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/backups/AESCipher.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/backups/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/backups/manager.py (99%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/backups/utils.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/capabilities.py (98%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/docs/README.md (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/registration_manager.py (95%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui.json (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui.schema.json (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/_macros.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/_schemas/macros.schema.json (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/_schemas/page.schema.json (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/_schemas/rule.schema.json (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/cruise.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/developer.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/device.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/display.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/models.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/software.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/steering.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/toggles.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/vehicle.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/settings_ui_src/pages/visuals.yaml (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/statsd.py (97%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/sunnylink_state.py (99%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/tests/test_capabilities.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/tests/test_compile_settings_ui.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/tests/test_settings_changes.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/tests/test_settings_schema.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/tools/apply_macros.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/tools/compile_settings_ui.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/tools/extract_settings_ui.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/tools/generate_settings_schema.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/tools/validate_settings_ui.py (100%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/uploader.py (99%) rename {sunnypilot => openpilot/sunnypilot}/sunnylink/utils.py (98%) rename {sunnypilot => openpilot/sunnypilot}/system/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/system/hardware/c3/README.md (100%) rename {sunnypilot => openpilot/sunnypilot}/system/hardware/c3/agnos.json (100%) rename {sunnypilot => openpilot/sunnypilot}/system/hardware/c3/launch_chffrplus.sh (100%) rename {sunnypilot => openpilot/sunnypilot}/system/hardware/c3/launch_env.sh (100%) rename {sunnypilot => openpilot/sunnypilot}/system/params_migration.py (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/.gitignore (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/SConscript (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/bmx055_accel.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/bmx055_accel.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/bmx055_gyro.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/bmx055_gyro.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/bmx055_magn.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/bmx055_magn.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/bmx055_temp.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/bmx055_temp.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/constants.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/i2c_sensor.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/i2c_sensor.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/lsm6ds3_accel.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/lsm6ds3_accel.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/lsm6ds3_gyro.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/lsm6ds3_gyro.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/lsm6ds3_temp.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/lsm6ds3_temp.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/mmc5603nj_magn.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/mmc5603nj_magn.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors/sensor.h (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/sensors_qcom2.cc (100%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/tests/test_sensord.py (98%) rename {sunnypilot => openpilot/sunnypilot}/system/sensord/tests/ttff_test.py (96%) rename {system => openpilot/sunnypilot/system}/statsd.py (98%) rename {sunnypilot => openpilot/sunnypilot}/system/updated/tests/test_sp_branch_migrations.py (100%) rename {sunnypilot => openpilot/sunnypilot}/tools/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/tools/memory_profiler/__init__.py (100%) rename {sunnypilot => openpilot/sunnypilot}/tools/memory_profiler/mem_usage.py (100%) rename {sunnypilot => openpilot/sunnypilot}/tools/pull_footage.py (100%) rename {system => openpilot/system}/ui/sunnypilot/lib/application.py (100%) rename {system => openpilot/system}/ui/sunnypilot/lib/styles.py (100%) rename {system => openpilot/system}/ui/sunnypilot/lib/utils.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/__init__.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/helpers/__init__.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/helpers/fuzzy_search.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/helpers/star_icon.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/html_render.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/input_dialog.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/list_view.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/option_control.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/progress_bar.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/sunnylink_pairing_dialog.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/toggle.py (100%) rename {system => openpilot/system}/ui/sunnypilot/widgets/tree_dialog.py (100%) rename {third_party => openpilot/third_party}/copyparty/copyparty-sfx.py (100%) rename {third_party => openpilot/third_party}/mapd_pfeiferj/README.md (100%) rename {third_party => openpilot/third_party}/mapd_pfeiferj/mapd (100%) delete mode 120000 sunnypilot/selfdrive/car/car_list.json delete mode 100644 system/manager/process_config.py diff --git a/.gitmodules b/.gitmodules index e2088276e2..a2d892d07f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -17,5 +17,5 @@ path = tinygrad_repo url = https://github.com/sunnypilot/tinygrad.git [submodule "sunnypilot/neural_network_data"] - path = sunnypilot/neural_network_data + path = openpilot/sunnypilot/neural_network_data url = https://github.com/sunnypilot/neural-network-data.git diff --git a/SConstruct b/SConstruct index 474f7f2090..9de9b72fea 100644 --- a/SConstruct +++ b/SConstruct @@ -287,7 +287,7 @@ SConscript([ 'openpilot/selfdrive/ui/SConscript', ]) -SConscript(['sunnypilot/SConscript']) +SConscript(['openpilot/sunnypilot/SConscript']) # Build desktop-only tools if GetOption('extras') and arch != "larch64": diff --git a/opendbc_repo b/opendbc_repo index 94858c07a9..aa1457226b 160000 --- a/opendbc_repo +++ b/opendbc_repo @@ -1 +1 @@ -Subproject commit 94858c07a96924857f17823dd984feef292062e0 +Subproject commit aa1457226b8cadbceaf81bc6fe4c575200ec6397 diff --git a/common/api/__init__.py b/openpilot/common/api/__init__.py similarity index 100% rename from common/api/__init__.py rename to openpilot/common/api/__init__.py diff --git a/common/api/base.py b/openpilot/common/api/base.py similarity index 98% rename from common/api/base.py rename to openpilot/common/api/base.py index ddda6e6ae2..b58dd6bbd0 100644 --- a/common/api/base.py +++ b/openpilot/common/api/base.py @@ -4,7 +4,7 @@ import requests import unicodedata from datetime import datetime, timedelta, UTC from openpilot.common.hardware.hw import Paths -from openpilot.system.version import get_version +from openpilot.common.version import get_version # name: jwt signature algorithm KEYS = {"id_rsa": "RS256", diff --git a/common/api/comma_connect.py b/openpilot/common/api/comma_connect.py similarity index 100% rename from common/api/comma_connect.py rename to openpilot/common/api/comma_connect.py diff --git a/openpilot/selfdrive/car/helpers.py b/openpilot/selfdrive/car/helpers.py index 384152c71b..ec9e3efeeb 100644 --- a/openpilot/selfdrive/car/helpers.py +++ b/openpilot/selfdrive/car/helpers.py @@ -1,7 +1,7 @@ import capnp from typing import Any -from cereal import custom +from openpilot.cereal import custom from opendbc.car import structs _FIELDS = '__dataclass_fields__' # copy of dataclasses._FIELDS diff --git a/openpilot/selfdrive/modeld/compile_warp.py b/openpilot/selfdrive/modeld/compile_warp.py deleted file mode 100755 index 1144fc69c3..0000000000 --- a/openpilot/selfdrive/modeld/compile_warp.py +++ /dev/null @@ -1,201 +0,0 @@ -#!/usr/bin/env python3 -import time -import pickle -import numpy as np -from pathlib import Path -from tinygrad.tensor import Tensor -from tinygrad.helpers import Context -from tinygrad.device import Device -from tinygrad.engine.jit import TinyJit - -from openpilot.system.camerad.cameras.nv12_info import get_nv12_info -from openpilot.common.transformations.model import MEDMODEL_INPUT_SIZE, DM_INPUT_SIZE -from openpilot.common.transformations.camera import _ar_ox_fisheye, _os_fisheye - -MODELS_DIR = Path(__file__).parent / 'models' - -CAMERA_CONFIGS = [ - (_ar_ox_fisheye.width, _ar_ox_fisheye.height), # tici: 1928x1208 - (_os_fisheye.width, _os_fisheye.height), # mici: 1344x760 -] - -UV_SCALE_MATRIX = np.array([[0.5, 0, 0], [0, 0.5, 0], [0, 0, 1]], dtype=np.float32) -UV_SCALE_MATRIX_INV = np.linalg.inv(UV_SCALE_MATRIX) - -IMG_BUFFER_SHAPE = (30, MEDMODEL_INPUT_SIZE[1] // 2, MEDMODEL_INPUT_SIZE[0] // 2) - - -def warp_pkl_path(w, h): - return MODELS_DIR / f'warp_{w}x{h}_tinygrad.pkl' - - -def dm_warp_pkl_path(w, h): - return MODELS_DIR / f'dm_warp_{w}x{h}_tinygrad.pkl' - - -def warp_perspective_tinygrad(src_flat, M_inv, dst_shape, src_shape, stride_pad): - w_dst, h_dst = dst_shape - h_src, w_src = src_shape - - x = Tensor.arange(w_dst).reshape(1, w_dst).expand(h_dst, w_dst).reshape(-1) - y = Tensor.arange(h_dst).reshape(h_dst, 1).expand(h_dst, w_dst).reshape(-1) - - # inline 3x3 matmul as elementwise to avoid reduce op (enables fusion with gather) - src_x = M_inv[0, 0] * x + M_inv[0, 1] * y + M_inv[0, 2] - src_y = M_inv[1, 0] * x + M_inv[1, 1] * y + M_inv[1, 2] - src_w = M_inv[2, 0] * x + M_inv[2, 1] * y + M_inv[2, 2] - - src_x = src_x / src_w - src_y = src_y / src_w - - x_nn_clipped = Tensor.round(src_x).clip(0, w_src - 1).cast('int') - y_nn_clipped = Tensor.round(src_y).clip(0, h_src - 1).cast('int') - idx = y_nn_clipped * (w_src + stride_pad) + x_nn_clipped - - return src_flat[idx] - - -def frames_to_tensor(frames, model_w, model_h): - H = (frames.shape[0] * 2) // 3 - W = frames.shape[1] - in_img1 = Tensor.cat(frames[0:H:2, 0::2], - frames[1:H:2, 0::2], - frames[0:H:2, 1::2], - frames[1:H:2, 1::2], - frames[H:H+H//4].reshape((H//2, W//2)), - frames[H+H//4:H+H//2].reshape((H//2, W//2)), dim=0).reshape((6, H//2, W//2)) - return in_img1 - - -def make_frame_prepare(cam_w, cam_h, model_w, model_h): - stride, y_height, uv_height, _ = get_nv12_info(cam_w, cam_h) - uv_offset = stride * y_height - stride_pad = stride - cam_w - - def frame_prepare_tinygrad(input_frame, M_inv): - # UV_SCALE @ M_inv @ UV_SCALE_INV simplifies to elementwise scaling - M_inv_uv = M_inv * Tensor([[1.0, 1.0, 0.5], [1.0, 1.0, 0.5], [2.0, 2.0, 1.0]]) - # deinterleave NV12 UV plane (UVUV... -> separate U, V) - uv = input_frame[uv_offset:uv_offset + uv_height * stride].reshape(uv_height, stride) - with Context(SPLIT_REDUCEOP=0): - y = warp_perspective_tinygrad(input_frame[:cam_h*stride], - M_inv, (model_w, model_h), - (cam_h, cam_w), stride_pad).realize() - u = warp_perspective_tinygrad(uv[:cam_h//2, :cam_w:2].flatten(), - M_inv_uv, (model_w//2, model_h//2), - (cam_h//2, cam_w//2), 0).realize() - v = warp_perspective_tinygrad(uv[:cam_h//2, 1:cam_w:2].flatten(), - M_inv_uv, (model_w//2, model_h//2), - (cam_h//2, cam_w//2), 0).realize() - yuv = y.cat(u).cat(v).reshape((model_h * 3 // 2, model_w)) - tensor = frames_to_tensor(yuv, model_w, model_h) - return tensor - return frame_prepare_tinygrad - - -def make_update_img_input(frame_prepare, model_w, model_h): - def update_img_input_tinygrad(tensor, frame, M_inv): - M_inv = M_inv.to(Device.DEFAULT) - new_img = frame_prepare(frame, M_inv) - tensor.assign(tensor[6:].cat(new_img, dim=0).contiguous()) - return Tensor.cat(tensor[:6], tensor[-6:], dim=0).contiguous().reshape(1, 12, model_h//2, model_w//2) - return update_img_input_tinygrad - - -def make_update_both_imgs(frame_prepare, model_w, model_h): - update_img = make_update_img_input(frame_prepare, model_w, model_h) - - def update_both_imgs_tinygrad(calib_img_buffer, new_img, M_inv, - calib_big_img_buffer, new_big_img, M_inv_big): - calib_img_pair = update_img(calib_img_buffer, new_img, M_inv) - calib_big_img_pair = update_img(calib_big_img_buffer, new_big_img, M_inv_big) - return calib_img_pair, calib_big_img_pair - return update_both_imgs_tinygrad - - -def make_warp_dm(cam_w, cam_h, dm_w, dm_h): - stride, y_height, _, _ = get_nv12_info(cam_w, cam_h) - stride_pad = stride - cam_w - - def warp_dm(input_frame, M_inv): - M_inv = M_inv.to(Device.DEFAULT) - result = warp_perspective_tinygrad(input_frame[:cam_h*stride], M_inv, (dm_w, dm_h), (cam_h, cam_w), stride_pad).reshape(-1, dm_h * dm_w) - return result - return warp_dm - - -def compile_modeld_warp(cam_w, cam_h): - model_w, model_h = MEDMODEL_INPUT_SIZE - _, _, _, yuv_size = get_nv12_info(cam_w, cam_h) - - print(f"Compiling modeld warp for {cam_w}x{cam_h}...") - - frame_prepare = make_frame_prepare(cam_w, cam_h, model_w, model_h) - update_both_imgs = make_update_both_imgs(frame_prepare, model_w, model_h) - update_img_jit = TinyJit(update_both_imgs, prune=True) - - full_buffer = Tensor.zeros(IMG_BUFFER_SHAPE, dtype='uint8').contiguous().realize() - big_full_buffer = Tensor.zeros(IMG_BUFFER_SHAPE, dtype='uint8').contiguous().realize() - new_frame_np = np.random.randint(0, 256, yuv_size, dtype=np.uint8) - new_big_frame_np = np.random.randint(0, 256, yuv_size, dtype=np.uint8) - for i in range(10): - img_inputs = [full_buffer, - Tensor.from_blob(new_frame_np.ctypes.data, (yuv_size,), dtype='uint8').realize(), - Tensor(Tensor.randn(3, 3).mul(8).realize().numpy(), device='NPY')] - big_img_inputs = [big_full_buffer, - Tensor.from_blob(new_big_frame_np.ctypes.data, (yuv_size,), dtype='uint8').realize(), - Tensor(Tensor.randn(3, 3).mul(8).realize().numpy(), device='NPY')] - inputs = img_inputs + big_img_inputs - Device.default.synchronize() - - st = time.perf_counter() - _ = update_img_jit(*inputs) - mt = time.perf_counter() - Device.default.synchronize() - et = time.perf_counter() - print(f" [{i+1}/10] enqueue {(mt-st)*1e3:6.2f} ms -- total {(et-st)*1e3:6.2f} ms") - - pkl_path = warp_pkl_path(cam_w, cam_h) - with open(pkl_path, "wb") as f: - pickle.dump(update_img_jit, f) - print(f" Saved to {pkl_path}") - - jit = pickle.load(open(pkl_path, "rb")) - jit(*inputs) - - -def compile_dm_warp(cam_w, cam_h): - dm_w, dm_h = DM_INPUT_SIZE - _, _, _, yuv_size = get_nv12_info(cam_w, cam_h) - - print(f"Compiling DM warp for {cam_w}x{cam_h}...") - - warp_dm = make_warp_dm(cam_w, cam_h, dm_w, dm_h) - warp_dm_jit = TinyJit(warp_dm, prune=True) - - new_frame_np = np.random.randint(0, 256, yuv_size, dtype=np.uint8) - for i in range(10): - inputs = [Tensor.from_blob(new_frame_np.ctypes.data, (yuv_size,), dtype='uint8').realize(), - Tensor(Tensor.randn(3, 3).mul(8).realize().numpy(), device='NPY')] - Device.default.synchronize() - st = time.perf_counter() - warp_dm_jit(*inputs) - mt = time.perf_counter() - Device.default.synchronize() - et = time.perf_counter() - print(f" [{i+1}/10] enqueue {(mt-st)*1e3:6.2f} ms -- total {(et-st)*1e3:6.2f} ms") - - pkl_path = dm_warp_pkl_path(cam_w, cam_h) - with open(pkl_path, "wb") as f: - pickle.dump(warp_dm_jit, f) - print(f" Saved to {pkl_path}") - - -def run_and_save_pickle(): - for cam_w, cam_h in CAMERA_CONFIGS: - compile_modeld_warp(cam_w, cam_h) - compile_dm_warp(cam_w, cam_h) - - -if __name__ == "__main__": - run_and_save_pickle() diff --git a/openpilot/selfdrive/monitoring/test_monitoring.py b/openpilot/selfdrive/monitoring/test_monitoring.py index 2312afb2f5..c5659ab309 100644 --- a/openpilot/selfdrive/monitoring/test_monitoring.py +++ b/openpilot/selfdrive/monitoring/test_monitoring.py @@ -271,10 +271,10 @@ def test_run_step_engagement(selfdrive_enabled, lat_active, steering, gas, captured = {} orig = dm._update_events - def spy(driver_engaged, op_engaged, standstill, wrong_gear): + def spy(driver_engaged, op_engaged, lowspeed, wrong_gear): captured['driver_engaged'] = driver_engaged captured['op_engaged'] = op_engaged - return orig(driver_engaged, op_engaged, standstill, wrong_gear) + return orig(driver_engaged, op_engaged, lowspeed, wrong_gear) dm._update_events = spy dm.run_step(sm, demo=False) diff --git a/selfdrive/ui/sunnypilot/__init__.py b/openpilot/selfdrive/ui/sunnypilot/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/__init__.py diff --git a/selfdrive/ui/sunnypilot/layouts/__init__.py b/openpilot/selfdrive/ui/sunnypilot/layouts/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/__init__.py diff --git a/selfdrive/ui/sunnypilot/layouts/onboarding.py b/openpilot/selfdrive/ui/sunnypilot/layouts/onboarding.py similarity index 98% rename from selfdrive/ui/sunnypilot/layouts/onboarding.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/onboarding.py index 7e532678b0..a86677a7b1 100644 --- a/selfdrive/ui/sunnypilot/layouts/onboarding.py +++ b/openpilot/selfdrive/ui/sunnypilot/layouts/onboarding.py @@ -11,7 +11,7 @@ from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.button import Button, ButtonStyle from openpilot.system.ui.widgets.label import Label -from openpilot.system.version import sunnylink_consent_version, sunnylink_consent_declined +from openpilot.common.version import sunnylink_consent_version, sunnylink_consent_declined class SunnylinkConsentPage(Widget): diff --git a/selfdrive/ui/sunnypilot/layouts/settings/__init__.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/__init__.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/cruise.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/cruise.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/cruise.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/cruise.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_policy.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_policy.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_policy.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_policy.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_settings.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_settings.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_settings.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/cruise_sub_layouts/speed_limit_settings.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/developer.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/developer.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/developer.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/developer.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/device.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/device.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/device.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/device.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/display.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/display.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/display.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/display.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/models.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/models.py similarity index 99% rename from selfdrive/ui/sunnypilot/layouts/settings/models.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/models.py index 587c3560c9..7a175b4037 100644 --- a/selfdrive/ui/sunnypilot/layouts/settings/models.py +++ b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/models.py @@ -9,7 +9,7 @@ import re import time import pyray as rl -from cereal import custom +from openpilot.cereal import custom from openpilot.sunnypilot.models.default_model import DEFAULT_MODEL from openpilot.common.constants import CV from openpilot.selfdrive.ui.ui_state import device, ui_state diff --git a/selfdrive/ui/sunnypilot/layouts/settings/navigation.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/navigation.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/navigation.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/navigation.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/network.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/network.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/network.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/network.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/osm.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/osm.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/osm.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/osm.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/settings.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/settings.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/settings.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/settings.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/software.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/software.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/software.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/software.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/steering.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering.py similarity index 99% rename from selfdrive/ui/sunnypilot/layouts/settings/steering.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering.py index a5cd626483..15cb6a15e0 100644 --- a/selfdrive/ui/sunnypilot/layouts/settings/steering.py +++ b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering.py @@ -4,7 +4,7 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import car +from opendbc.car.structs import car from enum import IntEnum from openpilot.selfdrive.ui.ui_state import ui_state diff --git a/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/lane_change_settings.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/lane_change_settings.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/lane_change_settings.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/lane_change_settings.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/mads_settings.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/mads_settings.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/mads_settings.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/mads_settings.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/torque_settings.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/torque_settings.py similarity index 98% rename from selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/torque_settings.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/torque_settings.py index d4976b1295..f3c4419e45 100644 --- a/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/torque_settings.py +++ b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/steering_sub_layouts/torque_settings.py @@ -21,7 +21,7 @@ from openpilot.system.ui.widgets import Widget, DialogResult from openpilot.system.ui.widgets.network import NavButton from openpilot.system.ui.widgets.scroller_tici import Scroller -TORQUE_VERSIONS_PATH = os.path.join(BASEDIR, "sunnypilot", "selfdrive", "controls", "lib", "latcontrol_torque_versions.json") +TORQUE_VERSIONS_PATH = os.path.join(BASEDIR, "openpilot", "sunnypilot", "selfdrive", "controls", "lib", "latcontrol_torque_versions.json") class TorqueSettingsLayout(Widget): diff --git a/selfdrive/ui/sunnypilot/layouts/settings/sunnylink.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/sunnylink.py similarity index 99% rename from selfdrive/ui/sunnypilot/layouts/settings/sunnylink.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/sunnylink.py index 1d9b99d5fd..5e75e797cb 100644 --- a/selfdrive/ui/sunnypilot/layouts/settings/sunnylink.py +++ b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/sunnylink.py @@ -5,7 +5,7 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ import pyray as rl -from cereal import custom +from openpilot.cereal import custom from openpilot.selfdrive.ui.sunnypilot.layouts.onboarding import SunnylinkConsentPage from openpilot.selfdrive.ui.ui_state import ui_state from openpilot.sunnypilot.sunnylink.api import UNREGISTERED_SUNNYLINK_DONGLE_ID @@ -20,7 +20,7 @@ from openpilot.system.ui.widgets.confirm_dialog import alert_dialog, ConfirmDial from openpilot.system.ui.widgets.label import UnifiedLabel from openpilot.system.ui.widgets.list_view import dual_button_item from openpilot.system.ui.widgets.scroller_tici import Scroller, LineSeparator -from openpilot.system.version import sunnylink_consent_version +from openpilot.common.version import sunnylink_consent_version class SunnylinkHeader(Widget): diff --git a/selfdrive/ui/sunnypilot/layouts/settings/trips.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/trips.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/trips.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/trips.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/__init__.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/__init__.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/__init__.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/__init__.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/base.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/base.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/base.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/base.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/body.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/body.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/body.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/body.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/chrysler.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/chrysler.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/chrysler.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/chrysler.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/factory.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/factory.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/factory.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/factory.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/ford.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/ford.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/ford.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/ford.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/gm.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/gm.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/gm.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/gm.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/honda.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/honda.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/honda.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/honda.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/hyundai.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/hyundai.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/hyundai.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/hyundai.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/mazda.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/mazda.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/mazda.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/mazda.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/nissan.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/nissan.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/nissan.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/nissan.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/psa.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/psa.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/psa.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/psa.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/rivian.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/rivian.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/rivian.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/rivian.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/subaru.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/subaru.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/subaru.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/subaru.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/tesla.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/tesla.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/tesla.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/tesla.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/toyota.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/toyota.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/toyota.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/toyota.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/volkswagen.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/volkswagen.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/volkswagen.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/brands/volkswagen.py diff --git a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/platform_selector.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/platform_selector.py similarity index 98% rename from selfdrive/ui/sunnypilot/layouts/settings/vehicle/platform_selector.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/platform_selector.py index 6102e8e9b7..aab935d4b8 100644 --- a/selfdrive/ui/sunnypilot/layouts/settings/vehicle/platform_selector.py +++ b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/vehicle/platform_selector.py @@ -21,7 +21,7 @@ from openpilot.system.ui.sunnypilot.lib.styles import style from openpilot.system.ui.sunnypilot.widgets.tree_dialog import TreeOptionDialog, TreeNode, TreeFolder from openpilot.selfdrive.ui.ui_state import ui_state -CAR_LIST_JSON_OUT = os.path.join(BASEDIR, "sunnypilot", "selfdrive", "car", "car_list.json") +CAR_LIST_JSON_OUT = os.path.join(BASEDIR, "openpilot", "sunnypilot", "selfdrive", "car", "car_list.json") class LegendWidget(Widget): diff --git a/selfdrive/ui/sunnypilot/layouts/settings/visuals.py b/openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/settings/visuals.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/settings/visuals.py diff --git a/selfdrive/ui/sunnypilot/layouts/sidebar.py b/openpilot/selfdrive/ui/sunnypilot/layouts/sidebar.py similarity index 100% rename from selfdrive/ui/sunnypilot/layouts/sidebar.py rename to openpilot/selfdrive/ui/sunnypilot/layouts/sidebar.py diff --git a/selfdrive/ui/sunnypilot/mici/__init__.py b/openpilot/selfdrive/ui/sunnypilot/mici/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/mici/__init__.py diff --git a/selfdrive/ui/sunnypilot/mici/layouts/__init__.py b/openpilot/selfdrive/ui/sunnypilot/mici/layouts/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/layouts/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/mici/layouts/__init__.py diff --git a/selfdrive/ui/sunnypilot/mici/layouts/models.py b/openpilot/selfdrive/ui/sunnypilot/mici/layouts/models.py similarity index 99% rename from selfdrive/ui/sunnypilot/mici/layouts/models.py rename to openpilot/selfdrive/ui/sunnypilot/mici/layouts/models.py index 138ff87b75..5f3f77d62c 100644 --- a/selfdrive/ui/sunnypilot/mici/layouts/models.py +++ b/openpilot/selfdrive/ui/sunnypilot/mici/layouts/models.py @@ -7,7 +7,7 @@ See the LICENSE.md file in the root directory for more details. from collections.abc import Callable import pyray as rl -from cereal import custom +from openpilot.cereal import custom from openpilot.sunnypilot.models.default_model import DEFAULT_MODEL from openpilot.selfdrive.ui.mici.widgets.button import BigButton from openpilot.selfdrive.ui.sunnypilot.layouts.settings.models import ModelsLayout diff --git a/selfdrive/ui/sunnypilot/mici/layouts/onboarding.py b/openpilot/selfdrive/ui/sunnypilot/mici/layouts/onboarding.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/layouts/onboarding.py rename to openpilot/selfdrive/ui/sunnypilot/mici/layouts/onboarding.py diff --git a/selfdrive/ui/sunnypilot/mici/layouts/settings.py b/openpilot/selfdrive/ui/sunnypilot/mici/layouts/settings.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/layouts/settings.py rename to openpilot/selfdrive/ui/sunnypilot/mici/layouts/settings.py diff --git a/selfdrive/ui/sunnypilot/mici/layouts/sunnylink.py b/openpilot/selfdrive/ui/sunnypilot/mici/layouts/sunnylink.py similarity index 99% rename from selfdrive/ui/sunnypilot/mici/layouts/sunnylink.py rename to openpilot/selfdrive/ui/sunnypilot/mici/layouts/sunnylink.py index 85ebf55f46..e804c78035 100644 --- a/selfdrive/ui/sunnypilot/mici/layouts/sunnylink.py +++ b/openpilot/selfdrive/ui/sunnypilot/mici/layouts/sunnylink.py @@ -8,7 +8,7 @@ import pyray as rl from collections.abc import Callable -from cereal import custom +from openpilot.cereal import custom from openpilot.selfdrive.ui.mici.widgets.button import BigButton, BigToggle from openpilot.selfdrive.ui.mici.widgets.dialog import BigDialog, BigConfirmationDialog from openpilot.selfdrive.ui.sunnypilot.mici.layouts.onboarding import SunnylinkConsentPage @@ -20,7 +20,7 @@ from openpilot.system.ui.lib.multilang import tr from openpilot.system.ui.widgets import Widget from openpilot.system.ui.widgets.label import UnifiedLabel from openpilot.system.ui.widgets.scroller import NavScroller -from openpilot.system.version import sunnylink_consent_version, sunnylink_consent_declined +from openpilot.common.version import sunnylink_consent_version, sunnylink_consent_declined class SunnylinkInfo(Widget): def __init__(self): diff --git a/selfdrive/ui/sunnypilot/mici/onroad/__init__.py b/openpilot/selfdrive/ui/sunnypilot/mici/onroad/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/onroad/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/mici/onroad/__init__.py diff --git a/selfdrive/ui/sunnypilot/mici/onroad/confidence_ball.py b/openpilot/selfdrive/ui/sunnypilot/mici/onroad/confidence_ball.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/onroad/confidence_ball.py rename to openpilot/selfdrive/ui/sunnypilot/mici/onroad/confidence_ball.py diff --git a/selfdrive/ui/sunnypilot/mici/onroad/hud_renderer.py b/openpilot/selfdrive/ui/sunnypilot/mici/onroad/hud_renderer.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/onroad/hud_renderer.py rename to openpilot/selfdrive/ui/sunnypilot/mici/onroad/hud_renderer.py diff --git a/selfdrive/ui/sunnypilot/mici/onroad/model_renderer.py b/openpilot/selfdrive/ui/sunnypilot/mici/onroad/model_renderer.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/onroad/model_renderer.py rename to openpilot/selfdrive/ui/sunnypilot/mici/onroad/model_renderer.py diff --git a/selfdrive/ui/sunnypilot/mici/widgets/__init__.py b/openpilot/selfdrive/ui/sunnypilot/mici/widgets/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/widgets/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/mici/widgets/__init__.py diff --git a/selfdrive/ui/sunnypilot/mici/widgets/sunnylink_pairing_dialog.py b/openpilot/selfdrive/ui/sunnypilot/mici/widgets/sunnylink_pairing_dialog.py similarity index 100% rename from selfdrive/ui/sunnypilot/mici/widgets/sunnylink_pairing_dialog.py rename to openpilot/selfdrive/ui/sunnypilot/mici/widgets/sunnylink_pairing_dialog.py diff --git a/selfdrive/ui/sunnypilot/onroad/__init__.py b/openpilot/selfdrive/ui/sunnypilot/onroad/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/__init__.py diff --git a/selfdrive/ui/sunnypilot/onroad/alert_renderer.py b/openpilot/selfdrive/ui/sunnypilot/onroad/alert_renderer.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/alert_renderer.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/alert_renderer.py diff --git a/selfdrive/ui/sunnypilot/onroad/augmented_road_view.py b/openpilot/selfdrive/ui/sunnypilot/onroad/augmented_road_view.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/augmented_road_view.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/augmented_road_view.py diff --git a/selfdrive/ui/sunnypilot/onroad/blind_spot_indicators.py b/openpilot/selfdrive/ui/sunnypilot/onroad/blind_spot_indicators.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/blind_spot_indicators.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/blind_spot_indicators.py diff --git a/selfdrive/ui/sunnypilot/onroad/chevron_metrics.py b/openpilot/selfdrive/ui/sunnypilot/onroad/chevron_metrics.py similarity index 97% rename from selfdrive/ui/sunnypilot/onroad/chevron_metrics.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/chevron_metrics.py index a8a342c129..1dded3fc62 100644 --- a/selfdrive/ui/sunnypilot/onroad/chevron_metrics.py +++ b/openpilot/selfdrive/ui/sunnypilot/onroad/chevron_metrics.py @@ -128,8 +128,8 @@ class ChevronMetrics: lead_one = radar_state.leadOne lead_two = radar_state.leadTwo - has_lead_one = lead_one.status if lead_one else False - has_lead_two = lead_two.status if lead_two else False + has_lead_one = lead_one.present if lead_one else False + has_lead_two = lead_two.present if lead_two else False self.update_alpha(has_lead_one or has_lead_two) diff --git a/selfdrive/ui/sunnypilot/onroad/circular_alerts.py b/openpilot/selfdrive/ui/sunnypilot/onroad/circular_alerts.py similarity index 99% rename from selfdrive/ui/sunnypilot/onroad/circular_alerts.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/circular_alerts.py index f90fc81914..c44e4455eb 100644 --- a/selfdrive/ui/sunnypilot/onroad/circular_alerts.py +++ b/openpilot/selfdrive/ui/sunnypilot/onroad/circular_alerts.py @@ -6,7 +6,7 @@ See the LICENSE.md file in the root directory for more details. """ import pyray as rl -from cereal import log +from openpilot.cereal import log from openpilot.selfdrive.ui import UI_BORDER_SIZE from openpilot.selfdrive.ui.ui_state import ui_state from openpilot.selfdrive.ui.sunnypilot.onroad.developer_ui import DeveloperUiState diff --git a/selfdrive/ui/sunnypilot/onroad/developer_ui/__init__.py b/openpilot/selfdrive/ui/sunnypilot/onroad/developer_ui/__init__.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/developer_ui/__init__.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/developer_ui/__init__.py diff --git a/selfdrive/ui/sunnypilot/onroad/developer_ui/elements.py b/openpilot/selfdrive/ui/sunnypilot/onroad/developer_ui/elements.py similarity index 99% rename from selfdrive/ui/sunnypilot/onroad/developer_ui/elements.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/developer_ui/elements.py index 389692d30b..4119990f22 100644 --- a/selfdrive/ui/sunnypilot/onroad/developer_ui/elements.py +++ b/openpilot/selfdrive/ui/sunnypilot/onroad/developer_ui/elements.py @@ -42,7 +42,7 @@ class LeadInfoElement: @staticmethod def get_lead_status(sm): lead_one = sm['radarState'].leadOne - return lead_one.status, lead_one.dRel, lead_one.vRel + return lead_one.present, lead_one.dRel, lead_one.vRel @staticmethod def get_lead_color(lead_d_rel: float, lead_v_rel: float = 0.0, use_v_rel: bool = False) -> rl.Color: diff --git a/selfdrive/ui/sunnypilot/onroad/driver_state.py b/openpilot/selfdrive/ui/sunnypilot/onroad/driver_state.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/driver_state.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/driver_state.py diff --git a/selfdrive/ui/sunnypilot/onroad/hud_renderer.py b/openpilot/selfdrive/ui/sunnypilot/onroad/hud_renderer.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/hud_renderer.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/hud_renderer.py diff --git a/selfdrive/ui/sunnypilot/onroad/model_renderer.py b/openpilot/selfdrive/ui/sunnypilot/onroad/model_renderer.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/model_renderer.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/model_renderer.py diff --git a/selfdrive/ui/sunnypilot/onroad/rainbow_path.py b/openpilot/selfdrive/ui/sunnypilot/onroad/rainbow_path.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/rainbow_path.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/rainbow_path.py diff --git a/selfdrive/ui/sunnypilot/onroad/road_name.py b/openpilot/selfdrive/ui/sunnypilot/onroad/road_name.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/road_name.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/road_name.py diff --git a/selfdrive/ui/sunnypilot/onroad/rocket_fuel.py b/openpilot/selfdrive/ui/sunnypilot/onroad/rocket_fuel.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/rocket_fuel.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/rocket_fuel.py diff --git a/selfdrive/ui/sunnypilot/onroad/smart_cruise_control.py b/openpilot/selfdrive/ui/sunnypilot/onroad/smart_cruise_control.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/smart_cruise_control.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/smart_cruise_control.py diff --git a/selfdrive/ui/sunnypilot/onroad/speed_limit.py b/openpilot/selfdrive/ui/sunnypilot/onroad/speed_limit.py similarity index 99% rename from selfdrive/ui/sunnypilot/onroad/speed_limit.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/speed_limit.py index bfa311c357..7851698683 100644 --- a/selfdrive/ui/sunnypilot/onroad/speed_limit.py +++ b/openpilot/selfdrive/ui/sunnypilot/onroad/speed_limit.py @@ -9,7 +9,7 @@ from dataclasses import dataclass from enum import StrEnum import pyray as rl -from cereal import custom +from openpilot.cereal import custom from openpilot.common.constants import CV from openpilot.selfdrive.ui.onroad.hud_renderer import UI_CONFIG from openpilot.selfdrive.ui.ui_state import ui_state diff --git a/selfdrive/ui/sunnypilot/onroad/speed_renderer.py b/openpilot/selfdrive/ui/sunnypilot/onroad/speed_renderer.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/speed_renderer.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/speed_renderer.py diff --git a/selfdrive/ui/sunnypilot/onroad/turn_signal.py b/openpilot/selfdrive/ui/sunnypilot/onroad/turn_signal.py similarity index 100% rename from selfdrive/ui/sunnypilot/onroad/turn_signal.py rename to openpilot/selfdrive/ui/sunnypilot/onroad/turn_signal.py diff --git a/selfdrive/ui/sunnypilot/ui_state.py b/openpilot/selfdrive/ui/sunnypilot/ui_state.py similarity index 99% rename from selfdrive/ui/sunnypilot/ui_state.py rename to openpilot/selfdrive/ui/sunnypilot/ui_state.py index 1c21c35c6f..4b91bd4021 100644 --- a/selfdrive/ui/sunnypilot/ui_state.py +++ b/openpilot/selfdrive/ui/sunnypilot/ui_state.py @@ -6,7 +6,8 @@ See the LICENSE.md file in the root directory for more details. """ from enum import Enum -from cereal import messaging, log, car, custom +from openpilot.cereal import messaging, log, custom +from opendbc.car.structs import car from openpilot.common.params import Params from openpilot.selfdrive.ui.sunnypilot.layouts.settings.display import OnroadBrightness from openpilot.sunnypilot.sunnylink.sunnylink_state import SunnylinkState diff --git a/openpilot/sunnypilot b/openpilot/sunnypilot deleted file mode 120000 index c4ca692907..0000000000 --- a/openpilot/sunnypilot +++ /dev/null @@ -1 +0,0 @@ -../sunnypilot \ No newline at end of file diff --git a/sunnypilot/SConscript b/openpilot/sunnypilot/SConscript similarity index 100% rename from sunnypilot/SConscript rename to openpilot/sunnypilot/SConscript diff --git a/sunnypilot/__init__.py b/openpilot/sunnypilot/__init__.py similarity index 100% rename from sunnypilot/__init__.py rename to openpilot/sunnypilot/__init__.py diff --git a/sunnypilot/common/transformations/SConscript b/openpilot/sunnypilot/common/transformations/SConscript similarity index 100% rename from sunnypilot/common/transformations/SConscript rename to openpilot/sunnypilot/common/transformations/SConscript diff --git a/sunnypilot/common/transformations/coordinates.cc b/openpilot/sunnypilot/common/transformations/coordinates.cc similarity index 100% rename from sunnypilot/common/transformations/coordinates.cc rename to openpilot/sunnypilot/common/transformations/coordinates.cc diff --git a/sunnypilot/common/transformations/coordinates.hpp b/openpilot/sunnypilot/common/transformations/coordinates.hpp similarity index 100% rename from sunnypilot/common/transformations/coordinates.hpp rename to openpilot/sunnypilot/common/transformations/coordinates.hpp diff --git a/sunnypilot/common/transformations/orientation.cc b/openpilot/sunnypilot/common/transformations/orientation.cc similarity index 100% rename from sunnypilot/common/transformations/orientation.cc rename to openpilot/sunnypilot/common/transformations/orientation.cc diff --git a/sunnypilot/common/transformations/orientation.hpp b/openpilot/sunnypilot/common/transformations/orientation.hpp similarity index 100% rename from sunnypilot/common/transformations/orientation.hpp rename to openpilot/sunnypilot/common/transformations/orientation.hpp diff --git a/sunnypilot/common/version.h b/openpilot/sunnypilot/common/version.h similarity index 100% rename from sunnypilot/common/version.h rename to openpilot/sunnypilot/common/version.h diff --git a/sunnypilot/livedelay/__init__.py b/openpilot/sunnypilot/livedelay/__init__.py similarity index 100% rename from sunnypilot/livedelay/__init__.py rename to openpilot/sunnypilot/livedelay/__init__.py diff --git a/sunnypilot/livedelay/helpers.py b/openpilot/sunnypilot/livedelay/helpers.py similarity index 100% rename from sunnypilot/livedelay/helpers.py rename to openpilot/sunnypilot/livedelay/helpers.py diff --git a/sunnypilot/livedelay/lagd_toggle.py b/openpilot/sunnypilot/livedelay/lagd_toggle.py similarity index 97% rename from sunnypilot/livedelay/lagd_toggle.py rename to openpilot/sunnypilot/livedelay/lagd_toggle.py index 279aa353a3..3926cbebf6 100644 --- a/sunnypilot/livedelay/lagd_toggle.py +++ b/openpilot/sunnypilot/livedelay/lagd_toggle.py @@ -4,7 +4,7 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import log +from openpilot.cereal import log from opendbc.car import structs from openpilot.common.params import Params diff --git a/sunnypilot/mads/helpers.py b/openpilot/sunnypilot/mads/helpers.py similarity index 100% rename from sunnypilot/mads/helpers.py rename to openpilot/sunnypilot/mads/helpers.py diff --git a/sunnypilot/mads/mads.py b/openpilot/sunnypilot/mads/mads.py similarity index 99% rename from sunnypilot/mads/mads.py rename to openpilot/sunnypilot/mads/mads.py index b0a90f82b5..4ae3534b57 100644 --- a/sunnypilot/mads/mads.py +++ b/openpilot/sunnypilot/mads/mads.py @@ -5,7 +5,7 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import log, custom +from openpilot.cereal import log, custom from opendbc.car import structs from opendbc.car.hyundai.values import HyundaiFlags diff --git a/sunnypilot/mads/state.py b/openpilot/sunnypilot/mads/state.py similarity index 99% rename from sunnypilot/mads/state.py rename to openpilot/sunnypilot/mads/state.py index 73240c790c..a8e5e1892f 100644 --- a/sunnypilot/mads/state.py +++ b/openpilot/sunnypilot/mads/state.py @@ -5,7 +5,7 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import log, custom +from openpilot.cereal import log, custom from openpilot.selfdrive.selfdrived.events import ET from openpilot.selfdrive.selfdrived.state import SOFT_DISABLE_TIME from openpilot.common.realtime import DT_CTRL diff --git a/sunnypilot/mads/tests/test_mads_state_machine.py b/openpilot/sunnypilot/mads/tests/test_mads_state_machine.py similarity index 99% rename from sunnypilot/mads/tests/test_mads_state_machine.py rename to openpilot/sunnypilot/mads/tests/test_mads_state_machine.py index 7bc556a0fc..1782d04975 100644 --- a/sunnypilot/mads/tests/test_mads_state_machine.py +++ b/openpilot/sunnypilot/mads/tests/test_mads_state_machine.py @@ -8,7 +8,7 @@ See the LICENSE.md file in the root directory for more details. import pytest from pytest_mock import MockerFixture -from cereal import custom +from openpilot.cereal import custom from openpilot.common.realtime import DT_CTRL from openpilot.sunnypilot.mads.state import StateMachine, SOFT_DISABLE_TIME from openpilot.selfdrive.selfdrived.events import ET, NormalPermanentAlert, Events diff --git a/sunnypilot/mads/tests/test_mads_steering_mode.py b/openpilot/sunnypilot/mads/tests/test_mads_steering_mode.py similarity index 99% rename from sunnypilot/mads/tests/test_mads_steering_mode.py rename to openpilot/sunnypilot/mads/tests/test_mads_steering_mode.py index 8765324cfd..3b7e27a86f 100644 --- a/sunnypilot/mads/tests/test_mads_steering_mode.py +++ b/openpilot/sunnypilot/mads/tests/test_mads_steering_mode.py @@ -7,7 +7,7 @@ See the LICENSE.md file in the root directory for more details. import pytest -from cereal import log, custom +from openpilot.cereal import log, custom from opendbc.car import structs from openpilot.selfdrive.selfdrived.events import Events from openpilot.sunnypilot.selfdrive.selfdrived.events import EventsSP diff --git a/sunnypilot/mapd/__init__.py b/openpilot/sunnypilot/mapd/__init__.py similarity index 56% rename from sunnypilot/mapd/__init__.py rename to openpilot/sunnypilot/mapd/__init__.py index 7ad6f74149..57525254ce 100644 --- a/sunnypilot/mapd/__init__.py +++ b/openpilot/sunnypilot/mapd/__init__.py @@ -1,5 +1,5 @@ import os from openpilot.common.basedir import BASEDIR -MAPD_BIN_DIR = os.path.join(BASEDIR, 'third_party/mapd_pfeiferj') +MAPD_BIN_DIR = os.path.join(BASEDIR, 'openpilot', 'third_party/mapd_pfeiferj') MAPD_PATH = os.path.join(MAPD_BIN_DIR, 'mapd') diff --git a/sunnypilot/mapd/live_map_data/__init__.py b/openpilot/sunnypilot/mapd/live_map_data/__init__.py similarity index 100% rename from sunnypilot/mapd/live_map_data/__init__.py rename to openpilot/sunnypilot/mapd/live_map_data/__init__.py diff --git a/sunnypilot/mapd/live_map_data/base_map_data.py b/openpilot/sunnypilot/mapd/live_map_data/base_map_data.py similarity index 97% rename from sunnypilot/mapd/live_map_data/base_map_data.py rename to openpilot/sunnypilot/mapd/live_map_data/base_map_data.py index 723864dd2a..ca79ce1c6b 100644 --- a/sunnypilot/mapd/live_map_data/base_map_data.py +++ b/openpilot/sunnypilot/mapd/live_map_data/base_map_data.py @@ -6,7 +6,7 @@ See the LICENSE.md file in the root directory for more details. """ from abc import abstractmethod, ABC -import cereal.messaging as messaging +import openpilot.cereal.messaging as messaging from openpilot.common.params import Params from openpilot.common.constants import CV from openpilot.selfdrive.car.cruise import V_CRUISE_UNSET diff --git a/sunnypilot/mapd/live_map_data/debug.py b/openpilot/sunnypilot/mapd/live_map_data/debug.py similarity index 98% rename from sunnypilot/mapd/live_map_data/debug.py rename to openpilot/sunnypilot/mapd/live_map_data/debug.py index 794f2ef8ff..523dc5f2f0 100644 --- a/sunnypilot/mapd/live_map_data/debug.py +++ b/openpilot/sunnypilot/mapd/live_map_data/debug.py @@ -12,7 +12,7 @@ See the LICENSE.md file in the root directory for more details. import threading import traceback -from cereal import messaging +from openpilot.cereal import messaging from openpilot.common.gps import get_gps_location_service from openpilot.common.params import Params from openpilot.common.realtime import config_realtime_process diff --git a/sunnypilot/mapd/live_map_data/osm_map_data.py b/openpilot/sunnypilot/mapd/live_map_data/osm_map_data.py similarity index 98% rename from sunnypilot/mapd/live_map_data/osm_map_data.py rename to openpilot/sunnypilot/mapd/live_map_data/osm_map_data.py index e2a4ec667f..e6cbce0674 100644 --- a/sunnypilot/mapd/live_map_data/osm_map_data.py +++ b/openpilot/sunnypilot/mapd/live_map_data/osm_map_data.py @@ -8,7 +8,7 @@ import json import math import platform -from cereal import log +from openpilot.cereal import log from openpilot.common.params import Params from openpilot.sunnypilot.mapd.live_map_data.base_map_data import BaseMapData from openpilot.sunnypilot.navd.helpers import Coordinate diff --git a/sunnypilot/mapd/live_map_data/standalone.py b/openpilot/sunnypilot/mapd/live_map_data/standalone.py similarity index 100% rename from sunnypilot/mapd/live_map_data/standalone.py rename to openpilot/sunnypilot/mapd/live_map_data/standalone.py diff --git a/sunnypilot/mapd/mapd_installer.py b/openpilot/sunnypilot/mapd/mapd_installer.py similarity index 98% rename from sunnypilot/mapd/mapd_installer.py rename to openpilot/sunnypilot/mapd/mapd_installer.py index 1e36732dda..9f2e72720a 100755 --- a/sunnypilot/mapd/mapd_installer.py +++ b/openpilot/sunnypilot/mapd/mapd_installer.py @@ -14,11 +14,11 @@ import requests from pathlib import Path from urllib.request import urlopen -from cereal import messaging +from openpilot.cereal import messaging from openpilot.common.params import Params from openpilot.common.hardware.hw import Paths from openpilot.common.spinner import Spinner -from openpilot.system.version import is_prebuilt +from openpilot.common.version import is_prebuilt from openpilot.sunnypilot.mapd import MAPD_PATH, MAPD_BIN_DIR import openpilot.system.sentry as sentry diff --git a/sunnypilot/mapd/mapd_manager.py b/openpilot/sunnypilot/mapd/mapd_manager.py similarity index 100% rename from sunnypilot/mapd/mapd_manager.py rename to openpilot/sunnypilot/mapd/mapd_manager.py diff --git a/sunnypilot/mapd/tests/__init__.py b/openpilot/sunnypilot/mapd/tests/__init__.py similarity index 100% rename from sunnypilot/mapd/tests/__init__.py rename to openpilot/sunnypilot/mapd/tests/__init__.py diff --git a/sunnypilot/mapd/tests/mapd_hash b/openpilot/sunnypilot/mapd/tests/mapd_hash similarity index 100% rename from sunnypilot/mapd/tests/mapd_hash rename to openpilot/sunnypilot/mapd/tests/mapd_hash diff --git a/sunnypilot/mapd/tests/test_mapd_version.py b/openpilot/sunnypilot/mapd/tests/test_mapd_version.py similarity index 100% rename from sunnypilot/mapd/tests/test_mapd_version.py rename to openpilot/sunnypilot/mapd/tests/test_mapd_version.py diff --git a/sunnypilot/mapd/update_version.py b/openpilot/sunnypilot/mapd/update_version.py similarity index 93% rename from sunnypilot/mapd/update_version.py rename to openpilot/sunnypilot/mapd/update_version.py index c5e08b3f8f..b6ca2a757f 100755 --- a/sunnypilot/mapd/update_version.py +++ b/openpilot/sunnypilot/mapd/update_version.py @@ -13,8 +13,8 @@ from openpilot.sunnypilot import get_file_hash from openpilot.common.basedir import BASEDIR from openpilot.sunnypilot.mapd import MAPD_PATH -MAPD_HASH_PATH = os.path.join(BASEDIR, "sunnypilot", "mapd", "tests", "mapd_hash") -MAPD_VERSION_PATH = os.path.join(BASEDIR, "sunnypilot", "mapd", "mapd_installer.py") +MAPD_HASH_PATH = os.path.join(BASEDIR, "openpilot", "sunnypilot", "mapd", "tests", "mapd_hash") +MAPD_VERSION_PATH = os.path.join(BASEDIR, "openpilot", "sunnypilot", "mapd", "mapd_installer.py") def update_mapd_hash(): diff --git a/sunnypilot/mapd/version.py b/openpilot/sunnypilot/mapd/version.py similarity index 100% rename from sunnypilot/mapd/version.py rename to openpilot/sunnypilot/mapd/version.py diff --git a/sunnypilot/modeld_v2/.gitignore b/openpilot/sunnypilot/modeld_v2/.gitignore similarity index 100% rename from sunnypilot/modeld_v2/.gitignore rename to openpilot/sunnypilot/modeld_v2/.gitignore diff --git a/sunnypilot/modeld_v2/SConscript b/openpilot/sunnypilot/modeld_v2/SConscript similarity index 93% rename from sunnypilot/modeld_v2/SConscript rename to openpilot/sunnypilot/modeld_v2/SConscript index 723a1b3408..81affc625a 100644 --- a/sunnypilot/modeld_v2/SConscript +++ b/openpilot/sunnypilot/modeld_v2/SConscript @@ -38,7 +38,7 @@ camera_res_args = ' '.join(f'{cw}x{ch}' for cw, ch in CAMERA_CONFIGS) pythonpath_string = 'PYTHONPATH="${PYTHONPATH}:' + env.Dir("#tinygrad_repo").abspath + ':' + env.Dir("#").abspath + '"' compile_modeld_script = File("compile_modeld.py").abspath -upstream_compile_script = File(Dir("#selfdrive/modeld").File("compile_modeld.py").abspath) +upstream_compile_script = File(Dir("#openpilot/selfdrive/modeld").File("compile_modeld.py").abspath) script_deps = [File("compile_modeld.py"), upstream_compile_script] def compile_combined(model_type, onnx_args, output_name): @@ -84,10 +84,10 @@ if os.path.isfile(supercombo_onnx): 'driving_combined_supercombo_tinygrad.pkl') if PC: - inputs = tinygrad_files + [File(Dir("#sunnypilot/modeld_v2").File("install_models_pc.py").abspath)] + inputs = tinygrad_files + [File(Dir("#openpilot/sunnypilot/modeld_v2").File("install_models_pc.py").abspath)] outputs = [] model_dir = Dir("models").abspath - cmd = f'python3 {Dir("#sunnypilot/modeld_v2").abspath}/install_models_pc.py {model_dir}' + cmd = f'python3 {Dir("#openpilot/sunnypilot/modeld_v2").abspath}/install_models_pc.py {model_dir}' for model_name in ['supercombo', 'driving_vision', 'driving_off_policy', 'driving_on_policy', 'driving_policy']: if File(f"models/{model_name}.onnx").exists(): diff --git a/sunnypilot/modeld_v2/__init__.py b/openpilot/sunnypilot/modeld_v2/__init__.py similarity index 100% rename from sunnypilot/modeld_v2/__init__.py rename to openpilot/sunnypilot/modeld_v2/__init__.py diff --git a/sunnypilot/modeld_v2/camera_offset_helper.py b/openpilot/sunnypilot/modeld_v2/camera_offset_helper.py similarity index 100% rename from sunnypilot/modeld_v2/camera_offset_helper.py rename to openpilot/sunnypilot/modeld_v2/camera_offset_helper.py diff --git a/sunnypilot/modeld_v2/compile_modeld.py b/openpilot/sunnypilot/modeld_v2/compile_modeld.py similarity index 100% rename from sunnypilot/modeld_v2/compile_modeld.py rename to openpilot/sunnypilot/modeld_v2/compile_modeld.py diff --git a/sunnypilot/modeld_v2/constants.py b/openpilot/sunnypilot/modeld_v2/constants.py similarity index 100% rename from sunnypilot/modeld_v2/constants.py rename to openpilot/sunnypilot/modeld_v2/constants.py diff --git a/sunnypilot/modeld_v2/fill_model_msg.py b/openpilot/sunnypilot/modeld_v2/fill_model_msg.py similarity index 99% rename from sunnypilot/modeld_v2/fill_model_msg.py rename to openpilot/sunnypilot/modeld_v2/fill_model_msg.py index 1f281258ba..7d7854be11 100644 --- a/sunnypilot/modeld_v2/fill_model_msg.py +++ b/openpilot/sunnypilot/modeld_v2/fill_model_msg.py @@ -1,7 +1,7 @@ import os import capnp import numpy as np -from cereal import log +from openpilot.cereal import log from openpilot.sunnypilot.modeld_v2.constants import ModelConstants, Plan from openpilot.sunnypilot.models.helpers import plan_x_idxs_helper from openpilot.selfdrive.controls.lib.drive_helpers import get_curvature_from_plan diff --git a/sunnypilot/modeld_v2/get_model_metadata.py b/openpilot/sunnypilot/modeld_v2/get_model_metadata.py similarity index 100% rename from sunnypilot/modeld_v2/get_model_metadata.py rename to openpilot/sunnypilot/modeld_v2/get_model_metadata.py diff --git a/sunnypilot/modeld_v2/install_models_pc.py b/openpilot/sunnypilot/modeld_v2/install_models_pc.py similarity index 100% rename from sunnypilot/modeld_v2/install_models_pc.py rename to openpilot/sunnypilot/modeld_v2/install_models_pc.py diff --git a/sunnypilot/modeld_v2/meta_20hz.py b/openpilot/sunnypilot/modeld_v2/meta_20hz.py similarity index 100% rename from sunnypilot/modeld_v2/meta_20hz.py rename to openpilot/sunnypilot/modeld_v2/meta_20hz.py diff --git a/sunnypilot/modeld_v2/meta_helper.py b/openpilot/sunnypilot/modeld_v2/meta_helper.py similarity index 96% rename from sunnypilot/modeld_v2/meta_helper.py rename to openpilot/sunnypilot/modeld_v2/meta_helper.py index 3fa10b2415..bcf73adc6f 100644 --- a/sunnypilot/modeld_v2/meta_helper.py +++ b/openpilot/sunnypilot/modeld_v2/meta_helper.py @@ -1,5 +1,5 @@ from openpilot.sunnypilot.modeld_v2.constants import Meta -from cereal import custom +from openpilot.cereal import custom from openpilot.sunnypilot.modeld_v2.meta_20hz import Meta20hz from openpilot.sunnypilot.models.helpers import get_active_bundle diff --git a/sunnypilot/modeld_v2/modeld b/openpilot/sunnypilot/modeld_v2/modeld similarity index 100% rename from sunnypilot/modeld_v2/modeld rename to openpilot/sunnypilot/modeld_v2/modeld diff --git a/sunnypilot/modeld_v2/modeld.py b/openpilot/sunnypilot/modeld_v2/modeld.py similarity index 98% rename from sunnypilot/modeld_v2/modeld.py rename to openpilot/sunnypilot/modeld_v2/modeld.py index 08d3e9d476..ad18071b3b 100755 --- a/sunnypilot/modeld_v2/modeld.py +++ b/openpilot/sunnypilot/modeld_v2/modeld.py @@ -16,10 +16,11 @@ if USBGPU: import pickle import time import numpy as np -import cereal.messaging as messaging -from cereal import car, log +import openpilot.cereal.messaging as messaging +from openpilot.cereal import log +from opendbc.car.structs import car from setproctitle import setproctitle -from cereal.messaging import PubMaster, SubMaster +from openpilot.cereal.messaging import PubMaster, SubMaster from msgq.visionipc import VisionIpcClient, VisionStreamType, VisionBuf from opendbc.car.car_helpers import get_demo_car_params from openpilot.common.swaglog import cloudlog @@ -103,10 +104,10 @@ class ModelState(ModelStateBase): from openpilot.sunnypilot.modeld_v2.compile_modeld import derive_frame_skip, make_split_input_queues from tinygrad.device import Device - from openpilot.common.file_chunker import read_file_chunked + from openpilot.common.file_chunker import open_file_chunked cloudlog.warning(f"loading combined pkl: {pkl_path}") - jits = pickle.loads(read_file_chunked(pkl_path)) + jits = pickle.load(open_file_chunked(pkl_path)) self.DEV = Device.DEFAULT diff --git a/sunnypilot/modeld_v2/modeld_base.py b/openpilot/sunnypilot/modeld_v2/modeld_base.py similarity index 100% rename from sunnypilot/modeld_v2/modeld_base.py rename to openpilot/sunnypilot/modeld_v2/modeld_base.py diff --git a/sunnypilot/modeld_v2/parse_model_outputs.py b/openpilot/sunnypilot/modeld_v2/parse_model_outputs.py similarity index 100% rename from sunnypilot/modeld_v2/parse_model_outputs.py rename to openpilot/sunnypilot/modeld_v2/parse_model_outputs.py diff --git a/sunnypilot/modeld_v2/parse_model_outputs_split.py b/openpilot/sunnypilot/modeld_v2/parse_model_outputs_split.py similarity index 100% rename from sunnypilot/modeld_v2/parse_model_outputs_split.py rename to openpilot/sunnypilot/modeld_v2/parse_model_outputs_split.py diff --git a/sunnypilot/modeld_v2/tests/__init__.py b/openpilot/sunnypilot/modeld_v2/tests/__init__.py similarity index 100% rename from sunnypilot/modeld_v2/tests/__init__.py rename to openpilot/sunnypilot/modeld_v2/tests/__init__.py diff --git a/sunnypilot/modeld_v2/tests/conftest.py b/openpilot/sunnypilot/modeld_v2/tests/conftest.py similarity index 100% rename from sunnypilot/modeld_v2/tests/conftest.py rename to openpilot/sunnypilot/modeld_v2/tests/conftest.py diff --git a/sunnypilot/modeld_v2/tests/test_camera_offset_helper.py b/openpilot/sunnypilot/modeld_v2/tests/test_camera_offset_helper.py similarity index 100% rename from sunnypilot/modeld_v2/tests/test_camera_offset_helper.py rename to openpilot/sunnypilot/modeld_v2/tests/test_camera_offset_helper.py diff --git a/sunnypilot/modeld_v2/tests/test_combined_pkl_loader.py b/openpilot/sunnypilot/modeld_v2/tests/test_combined_pkl_loader.py similarity index 100% rename from sunnypilot/modeld_v2/tests/test_combined_pkl_loader.py rename to openpilot/sunnypilot/modeld_v2/tests/test_combined_pkl_loader.py diff --git a/sunnypilot/modeld_v2/tests/test_compile_modeld.py b/openpilot/sunnypilot/modeld_v2/tests/test_compile_modeld.py similarity index 100% rename from sunnypilot/modeld_v2/tests/test_compile_modeld.py rename to openpilot/sunnypilot/modeld_v2/tests/test_compile_modeld.py diff --git a/sunnypilot/modeld_v2/tests/test_recovery_power.py b/openpilot/sunnypilot/modeld_v2/tests/test_recovery_power.py similarity index 98% rename from sunnypilot/modeld_v2/tests/test_recovery_power.py rename to openpilot/sunnypilot/modeld_v2/tests/test_recovery_power.py index cfa2272386..ac716a5981 100644 --- a/sunnypilot/modeld_v2/tests/test_recovery_power.py +++ b/openpilot/sunnypilot/modeld_v2/tests/test_recovery_power.py @@ -1,6 +1,6 @@ import numpy as np -from cereal import log +from openpilot.cereal import log from openpilot.sunnypilot.modeld_v2.constants import Plan from openpilot.sunnypilot.modeld_v2.modeld import ModelState diff --git a/sunnypilot/modeld_v2/tests/test_warp.py b/openpilot/sunnypilot/modeld_v2/tests/test_warp.py similarity index 100% rename from sunnypilot/modeld_v2/tests/test_warp.py rename to openpilot/sunnypilot/modeld_v2/tests/test_warp.py diff --git a/sunnypilot/modeld_v2/warp.py b/openpilot/sunnypilot/modeld_v2/warp.py similarity index 100% rename from sunnypilot/modeld_v2/warp.py rename to openpilot/sunnypilot/modeld_v2/warp.py diff --git a/sunnypilot/models/README.md b/openpilot/sunnypilot/models/README.md similarity index 100% rename from sunnypilot/models/README.md rename to openpilot/sunnypilot/models/README.md diff --git a/sunnypilot/models/__init__.py b/openpilot/sunnypilot/models/__init__.py similarity index 100% rename from sunnypilot/models/__init__.py rename to openpilot/sunnypilot/models/__init__.py diff --git a/sunnypilot/models/constants.py b/openpilot/sunnypilot/models/constants.py similarity index 100% rename from sunnypilot/models/constants.py rename to openpilot/sunnypilot/models/constants.py diff --git a/sunnypilot/models/default_model.py b/openpilot/sunnypilot/models/default_model.py similarity index 84% rename from sunnypilot/models/default_model.py rename to openpilot/sunnypilot/models/default_model.py index 552f3a5769..62b6831402 100755 --- a/sunnypilot/models/default_model.py +++ b/openpilot/sunnypilot/models/default_model.py @@ -6,9 +6,9 @@ from openpilot.common.basedir import BASEDIR from openpilot.sunnypilot import get_file_hash from openpilot.sunnypilot.models.model_name import DEFAULT_MODEL -DEFAULT_MODEL_NAME_PATH = os.path.join(BASEDIR, "sunnypilot", "models", "model_name.py") -MODEL_HASH_PATH = os.path.join(BASEDIR, "sunnypilot", "models", "tests", "model_hash") -SUPERCOMBO_ONNX_PATH = os.path.join(BASEDIR, "selfdrive", "modeld", "models", "driving_supercombo.onnx") +DEFAULT_MODEL_NAME_PATH = os.path.join(BASEDIR, "openpilot", "sunnypilot", "models", "model_name.py") +MODEL_HASH_PATH = os.path.join(BASEDIR, "openpilot", "sunnypilot", "models", "tests", "model_hash") +SUPERCOMBO_ONNX_PATH = os.path.join(BASEDIR, "openpilot", "selfdrive", "modeld", "models", "driving_supercombo.onnx") def update_model_hash(): diff --git a/sunnypilot/models/fetcher.py b/openpilot/sunnypilot/models/fetcher.py similarity index 99% rename from sunnypilot/models/fetcher.py rename to openpilot/sunnypilot/models/fetcher.py index 6484f2b444..b5197988bb 100644 --- a/sunnypilot/models/fetcher.py +++ b/openpilot/sunnypilot/models/fetcher.py @@ -13,7 +13,7 @@ from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog from openpilot.sunnypilot.models.helpers import is_bundle_version_compatible -from cereal import custom +from openpilot.cereal import custom class ModelParser: diff --git a/sunnypilot/models/helpers.py b/openpilot/sunnypilot/models/helpers.py similarity index 99% rename from sunnypilot/models/helpers.py rename to openpilot/sunnypilot/models/helpers.py index e81c3a5365..28517ab2f3 100644 --- a/sunnypilot/models/helpers.py +++ b/openpilot/sunnypilot/models/helpers.py @@ -11,7 +11,7 @@ import pickle from pathlib import Path import numpy as np -from cereal import custom +from openpilot.cereal import custom from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog from openpilot.sunnypilot.models.constants import Meta, MetaSimPose, MetaTombRaider diff --git a/sunnypilot/models/manager.py b/openpilot/sunnypilot/models/manager.py similarity index 99% rename from sunnypilot/models/manager.py rename to openpilot/sunnypilot/models/manager.py index 02730dd270..405220d2e4 100644 --- a/sunnypilot/models/manager.py +++ b/openpilot/sunnypilot/models/manager.py @@ -15,7 +15,7 @@ from openpilot.common.realtime import Ratekeeper from openpilot.common.swaglog import cloudlog from openpilot.common.hardware.hw import Paths -from cereal import messaging, custom +from openpilot.cereal import messaging, custom from openpilot.sunnypilot.models.fetcher import ModelFetcher from openpilot.sunnypilot.models.helpers import get_active_bundle, validate_active_bundle, verify_file diff --git a/sunnypilot/models/model_name.py b/openpilot/sunnypilot/models/model_name.py similarity index 100% rename from sunnypilot/models/model_name.py rename to openpilot/sunnypilot/models/model_name.py diff --git a/sunnypilot/models/runners/constants.py b/openpilot/sunnypilot/models/runners/constants.py similarity index 91% rename from sunnypilot/models/runners/constants.py rename to openpilot/sunnypilot/models/runners/constants.py index 797a1d04b5..344f8f98cc 100644 --- a/sunnypilot/models/runners/constants.py +++ b/openpilot/sunnypilot/models/runners/constants.py @@ -1,7 +1,7 @@ import os import numpy as np from openpilot.common.hardware.hw import Paths -from cereal import custom +from openpilot.cereal import custom # Type definitions for clarity NumpyDict = dict[str, np.ndarray] diff --git a/sunnypilot/models/runners/helpers.py b/openpilot/sunnypilot/models/runners/helpers.py similarity index 100% rename from sunnypilot/models/runners/helpers.py rename to openpilot/sunnypilot/models/runners/helpers.py diff --git a/sunnypilot/models/runners/model_runner.py b/openpilot/sunnypilot/models/runners/model_runner.py similarity index 100% rename from sunnypilot/models/runners/model_runner.py rename to openpilot/sunnypilot/models/runners/model_runner.py diff --git a/sunnypilot/models/runners/tinygrad/model_types.py b/openpilot/sunnypilot/models/runners/tinygrad/model_types.py similarity index 100% rename from sunnypilot/models/runners/tinygrad/model_types.py rename to openpilot/sunnypilot/models/runners/tinygrad/model_types.py diff --git a/sunnypilot/models/runners/tinygrad/tinygrad_runner.py b/openpilot/sunnypilot/models/runners/tinygrad/tinygrad_runner.py similarity index 100% rename from sunnypilot/models/runners/tinygrad/tinygrad_runner.py rename to openpilot/sunnypilot/models/runners/tinygrad/tinygrad_runner.py diff --git a/sunnypilot/models/split_model_constants.py b/openpilot/sunnypilot/models/split_model_constants.py similarity index 100% rename from sunnypilot/models/split_model_constants.py rename to openpilot/sunnypilot/models/split_model_constants.py diff --git a/sunnypilot/models/tests/__init__.py b/openpilot/sunnypilot/models/tests/__init__.py similarity index 100% rename from sunnypilot/models/tests/__init__.py rename to openpilot/sunnypilot/models/tests/__init__.py diff --git a/sunnypilot/models/tests/model_hash b/openpilot/sunnypilot/models/tests/model_hash similarity index 100% rename from sunnypilot/models/tests/model_hash rename to openpilot/sunnypilot/models/tests/model_hash diff --git a/sunnypilot/models/tests/model_manager_audit.py b/openpilot/sunnypilot/models/tests/model_manager_audit.py similarity index 93% rename from sunnypilot/models/tests/model_manager_audit.py rename to openpilot/sunnypilot/models/tests/model_manager_audit.py index 4cd2b7d78e..2fc8bf5f21 100644 --- a/sunnypilot/models/tests/model_manager_audit.py +++ b/openpilot/sunnypilot/models/tests/model_manager_audit.py @@ -5,7 +5,7 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import messaging, custom +from openpilot.cereal import messaging, custom if __name__ == "__main__": sm = messaging.SubMaster(["modelManagerSP"]) diff --git a/sunnypilot/models/tests/test_default_model.py b/openpilot/sunnypilot/models/tests/test_default_model.py similarity index 100% rename from sunnypilot/models/tests/test_default_model.py rename to openpilot/sunnypilot/models/tests/test_default_model.py diff --git a/sunnypilot/models/tests/test_tinygrad_ref.py b/openpilot/sunnypilot/models/tests/test_tinygrad_ref.py similarity index 100% rename from sunnypilot/models/tests/test_tinygrad_ref.py rename to openpilot/sunnypilot/models/tests/test_tinygrad_ref.py diff --git a/sunnypilot/models/tinygrad_ref.py b/openpilot/sunnypilot/models/tinygrad_ref.py similarity index 100% rename from sunnypilot/models/tinygrad_ref.py rename to openpilot/sunnypilot/models/tinygrad_ref.py diff --git a/sunnypilot/navd/helpers.py b/openpilot/sunnypilot/navd/helpers.py similarity index 100% rename from sunnypilot/navd/helpers.py rename to openpilot/sunnypilot/navd/helpers.py diff --git a/sunnypilot/neural_network_data b/openpilot/sunnypilot/neural_network_data similarity index 100% rename from sunnypilot/neural_network_data rename to openpilot/sunnypilot/neural_network_data diff --git a/sunnypilot/selfdrive/__init__.py b/openpilot/sunnypilot/selfdrive/__init__.py similarity index 100% rename from sunnypilot/selfdrive/__init__.py rename to openpilot/sunnypilot/selfdrive/__init__.py diff --git a/sunnypilot/selfdrive/assets/icons/clock.png b/openpilot/sunnypilot/selfdrive/assets/icons/clock.png similarity index 100% rename from sunnypilot/selfdrive/assets/icons/clock.png rename to openpilot/sunnypilot/selfdrive/assets/icons/clock.png diff --git a/sunnypilot/selfdrive/assets/icons/star-empty.png b/openpilot/sunnypilot/selfdrive/assets/icons/star-empty.png similarity index 100% rename from sunnypilot/selfdrive/assets/icons/star-empty.png rename to openpilot/sunnypilot/selfdrive/assets/icons/star-empty.png diff --git a/sunnypilot/selfdrive/assets/icons/star-filled.png b/openpilot/sunnypilot/selfdrive/assets/icons/star-filled.png similarity index 100% rename from sunnypilot/selfdrive/assets/icons/star-filled.png rename to openpilot/sunnypilot/selfdrive/assets/icons/star-filled.png diff --git a/sunnypilot/selfdrive/assets/icons_mici/always_offroad.png b/openpilot/sunnypilot/selfdrive/assets/icons_mici/always_offroad.png similarity index 100% rename from sunnypilot/selfdrive/assets/icons_mici/always_offroad.png rename to openpilot/sunnypilot/selfdrive/assets/icons_mici/always_offroad.png diff --git a/sunnypilot/selfdrive/assets/icons_mici/disable_offroad.png b/openpilot/sunnypilot/selfdrive/assets/icons_mici/disable_offroad.png similarity index 100% rename from sunnypilot/selfdrive/assets/icons_mici/disable_offroad.png rename to openpilot/sunnypilot/selfdrive/assets/icons_mici/disable_offroad.png diff --git a/sunnypilot/selfdrive/assets/images/green_light.png b/openpilot/sunnypilot/selfdrive/assets/images/green_light.png similarity index 100% rename from sunnypilot/selfdrive/assets/images/green_light.png rename to openpilot/sunnypilot/selfdrive/assets/images/green_light.png diff --git a/sunnypilot/selfdrive/assets/images/lead_depart.png b/openpilot/sunnypilot/selfdrive/assets/images/lead_depart.png similarity index 100% rename from sunnypilot/selfdrive/assets/images/lead_depart.png rename to openpilot/sunnypilot/selfdrive/assets/images/lead_depart.png diff --git a/sunnypilot/selfdrive/assets/images/spinner_sunnypilot.png b/openpilot/sunnypilot/selfdrive/assets/images/spinner_sunnypilot.png similarity index 100% rename from sunnypilot/selfdrive/assets/images/spinner_sunnypilot.png rename to openpilot/sunnypilot/selfdrive/assets/images/spinner_sunnypilot.png diff --git a/sunnypilot/selfdrive/assets/img_minus_arrow_down.png b/openpilot/sunnypilot/selfdrive/assets/img_minus_arrow_down.png similarity index 100% rename from sunnypilot/selfdrive/assets/img_minus_arrow_down.png rename to openpilot/sunnypilot/selfdrive/assets/img_minus_arrow_down.png diff --git a/sunnypilot/selfdrive/assets/img_plus_arrow_up.png b/openpilot/sunnypilot/selfdrive/assets/img_plus_arrow_up.png similarity index 100% rename from sunnypilot/selfdrive/assets/img_plus_arrow_up.png rename to openpilot/sunnypilot/selfdrive/assets/img_plus_arrow_up.png diff --git a/sunnypilot/selfdrive/assets/logo.png b/openpilot/sunnypilot/selfdrive/assets/logo.png similarity index 100% rename from sunnypilot/selfdrive/assets/logo.png rename to openpilot/sunnypilot/selfdrive/assets/logo.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_display.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_display.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_display.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_display.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_exit_offroad.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_exit_offroad.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_exit_offroad.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_exit_offroad.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_firehose.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_firehose.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_firehose.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_firehose.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_firehose.svg b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_firehose.svg similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_firehose.svg rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_firehose.svg diff --git a/sunnypilot/selfdrive/assets/offroad/icon_home.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_home.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_home.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_home.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_home.svg b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_home.svg similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_home.svg rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_home.svg diff --git a/sunnypilot/selfdrive/assets/offroad/icon_lateral.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_lateral.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_lateral.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_lateral.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_map.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_map.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_map.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_map.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_models.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_models.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_models.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_models.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_software.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_software.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_software.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_software.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_toggle.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_toggle.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_toggle.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_toggle.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_trips.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_trips.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_trips.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_trips.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_vehicle.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_vehicle.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_vehicle.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_vehicle.png diff --git a/sunnypilot/selfdrive/assets/offroad/icon_visuals.png b/openpilot/sunnypilot/selfdrive/assets/offroad/icon_visuals.png similarity index 100% rename from sunnypilot/selfdrive/assets/offroad/icon_visuals.png rename to openpilot/sunnypilot/selfdrive/assets/offroad/icon_visuals.png diff --git a/sunnypilot/selfdrive/car/__init__.py b/openpilot/sunnypilot/selfdrive/car/__init__.py similarity index 100% rename from sunnypilot/selfdrive/car/__init__.py rename to openpilot/sunnypilot/selfdrive/car/__init__.py diff --git a/openpilot/sunnypilot/selfdrive/car/car_list.json b/openpilot/sunnypilot/selfdrive/car/car_list.json new file mode 120000 index 0000000000..9bef560d9c --- /dev/null +++ b/openpilot/sunnypilot/selfdrive/car/car_list.json @@ -0,0 +1 @@ +../../../../opendbc_repo/opendbc/sunnypilot/car/car_list.json \ No newline at end of file diff --git a/sunnypilot/selfdrive/car/car_specific.py b/openpilot/sunnypilot/selfdrive/car/car_specific.py similarity index 97% rename from sunnypilot/selfdrive/car/car_specific.py rename to openpilot/sunnypilot/selfdrive/car/car_specific.py index bce496ed28..54fcd34976 100644 --- a/sunnypilot/selfdrive/car/car_specific.py +++ b/openpilot/sunnypilot/selfdrive/car/car_specific.py @@ -5,7 +5,7 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import log, custom +from openpilot.cereal import log, custom from opendbc.car import structs from opendbc.car.chrysler.values import RAM_DT diff --git a/sunnypilot/selfdrive/car/cruise_ext.py b/openpilot/sunnypilot/selfdrive/car/cruise_ext.py similarity index 98% rename from sunnypilot/selfdrive/car/cruise_ext.py rename to openpilot/sunnypilot/selfdrive/car/cruise_ext.py index 3691c35972..61bec477f2 100644 --- a/sunnypilot/selfdrive/car/cruise_ext.py +++ b/openpilot/sunnypilot/selfdrive/car/cruise_ext.py @@ -6,7 +6,8 @@ See the LICENSE.md file in the root directory for more details. """ import numpy as np -from cereal import car, custom +from openpilot.cereal import custom +from opendbc.car.structs import car from opendbc.car import structs from openpilot.common.constants import CV from openpilot.common.params import Params diff --git a/sunnypilot/selfdrive/car/cruise_helpers.py b/openpilot/sunnypilot/selfdrive/car/cruise_helpers.py similarity index 96% rename from sunnypilot/selfdrive/car/cruise_helpers.py rename to openpilot/sunnypilot/selfdrive/car/cruise_helpers.py index 263d6f58cd..aa689ec904 100644 --- a/sunnypilot/selfdrive/car/cruise_helpers.py +++ b/openpilot/sunnypilot/selfdrive/car/cruise_helpers.py @@ -5,7 +5,8 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import car, custom +from openpilot.cereal import custom +from opendbc.car.structs import car from opendbc.car import structs from openpilot.common.params import Params diff --git a/sunnypilot/selfdrive/car/intelligent_cruise_button_management/__init__.py b/openpilot/sunnypilot/selfdrive/car/intelligent_cruise_button_management/__init__.py similarity index 100% rename from sunnypilot/selfdrive/car/intelligent_cruise_button_management/__init__.py rename to openpilot/sunnypilot/selfdrive/car/intelligent_cruise_button_management/__init__.py diff --git a/sunnypilot/selfdrive/car/intelligent_cruise_button_management/controller.py b/openpilot/sunnypilot/selfdrive/car/intelligent_cruise_button_management/controller.py similarity index 98% rename from sunnypilot/selfdrive/car/intelligent_cruise_button_management/controller.py rename to openpilot/sunnypilot/selfdrive/car/intelligent_cruise_button_management/controller.py index 1f491e0f58..ded2c0ab19 100644 --- a/sunnypilot/selfdrive/car/intelligent_cruise_button_management/controller.py +++ b/openpilot/sunnypilot/selfdrive/car/intelligent_cruise_button_management/controller.py @@ -4,7 +4,8 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import car, custom +from openpilot.cereal import custom +from opendbc.car.structs import car from opendbc.car import structs, apply_hysteresis from openpilot.common.constants import CV from openpilot.common.realtime import DT_CTRL diff --git a/sunnypilot/selfdrive/car/intelligent_cruise_button_management/helpers.py b/openpilot/sunnypilot/selfdrive/car/intelligent_cruise_button_management/helpers.py similarity index 100% rename from sunnypilot/selfdrive/car/intelligent_cruise_button_management/helpers.py rename to openpilot/sunnypilot/selfdrive/car/intelligent_cruise_button_management/helpers.py diff --git a/sunnypilot/selfdrive/car/interfaces.py b/openpilot/sunnypilot/selfdrive/car/interfaces.py similarity index 100% rename from sunnypilot/selfdrive/car/interfaces.py rename to openpilot/sunnypilot/selfdrive/car/interfaces.py diff --git a/sunnypilot/selfdrive/car/sync_sunnylink_params.py b/openpilot/sunnypilot/selfdrive/car/sync_sunnylink_params.py similarity index 88% rename from sunnypilot/selfdrive/car/sync_sunnylink_params.py rename to openpilot/sunnypilot/selfdrive/car/sync_sunnylink_params.py index 7539e741c6..6c964710b0 100755 --- a/sunnypilot/selfdrive/car/sync_sunnylink_params.py +++ b/openpilot/sunnypilot/selfdrive/car/sync_sunnylink_params.py @@ -12,7 +12,7 @@ from openpilot.common.basedir import BASEDIR from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog -CAR_LIST_JSON_OUT = os.path.join(BASEDIR, "sunnypilot", "selfdrive", "car", "car_list.json") +CAR_LIST_JSON_OUT = os.path.join(BASEDIR, "openpilot", "sunnypilot", "selfdrive", "car", "car_list.json") def update_car_list_param(): diff --git a/sunnypilot/selfdrive/car/tests/__init__.py b/openpilot/sunnypilot/selfdrive/car/tests/__init__.py similarity index 100% rename from sunnypilot/selfdrive/car/tests/__init__.py rename to openpilot/sunnypilot/selfdrive/car/tests/__init__.py diff --git a/sunnypilot/selfdrive/car/tests/test_cruise_mode.py b/openpilot/sunnypilot/selfdrive/car/tests/test_cruise_mode.py similarity index 98% rename from sunnypilot/selfdrive/car/tests/test_cruise_mode.py rename to openpilot/sunnypilot/selfdrive/car/tests/test_cruise_mode.py index 2fad14a703..3f3701b3ae 100644 --- a/sunnypilot/selfdrive/car/tests/test_cruise_mode.py +++ b/openpilot/sunnypilot/selfdrive/car/tests/test_cruise_mode.py @@ -1,4 +1,4 @@ -from cereal import car +from opendbc.car.structs import car from openpilot.common.parameterized import parameterized_class from openpilot.selfdrive.selfdrived.events import Events from openpilot.sunnypilot.selfdrive.car.cruise_helpers import CruiseHelper, DISTANCE_LONG_PRESS diff --git a/sunnypilot/selfdrive/car/tests/test_custom_cruise.py b/openpilot/sunnypilot/selfdrive/car/tests/test_custom_cruise.py similarity index 99% rename from sunnypilot/selfdrive/car/tests/test_custom_cruise.py rename to openpilot/sunnypilot/selfdrive/car/tests/test_custom_cruise.py index 878bc78b03..ce5d7dc124 100644 --- a/sunnypilot/selfdrive/car/tests/test_custom_cruise.py +++ b/openpilot/sunnypilot/selfdrive/car/tests/test_custom_cruise.py @@ -1,6 +1,6 @@ import pytest -from cereal import car +from opendbc.car.structs import car from openpilot.common.constants import CV from openpilot.common.parameterized import parameterized_class from openpilot.common.params import Params diff --git a/sunnypilot/selfdrive/controls/__init__.py b/openpilot/sunnypilot/selfdrive/controls/__init__.py similarity index 100% rename from sunnypilot/selfdrive/controls/__init__.py rename to openpilot/sunnypilot/selfdrive/controls/__init__.py diff --git a/sunnypilot/selfdrive/controls/controlsd_ext.py b/openpilot/sunnypilot/selfdrive/controls/controlsd_ext.py similarity index 94% rename from sunnypilot/selfdrive/controls/controlsd_ext.py rename to openpilot/sunnypilot/selfdrive/controls/controlsd_ext.py index c8d054243f..33cc9e3ad8 100644 --- a/sunnypilot/selfdrive/controls/controlsd_ext.py +++ b/openpilot/sunnypilot/selfdrive/controls/controlsd_ext.py @@ -6,8 +6,8 @@ See the LICENSE.md file in the root directory for more details. """ import time -import cereal.messaging as messaging -from cereal import log, custom +import openpilot.cereal.messaging as messaging +from openpilot.cereal import log, custom from opendbc.car import structs from openpilot.common.params import Params @@ -72,14 +72,14 @@ class ControlsExt(ModelStateBase): _lead.dRel = src.dRel _lead.yRel = src.yRel _lead.vRel = src.vRel - _lead.aRel = src.aRel + _lead.aRel = src.deprecated.aRel _lead.vLead = src.vLead - _lead.dPath = src.dPath - _lead.vLat = src.vLat + _lead.dPath = src.deprecated.dPath + _lead.vLat = src.deprecated.vLat _lead.vLeadK = src.vLeadK _lead.aLeadK = src.aLeadK - _lead.fcw = src.fcw - _lead.status = src.status + _lead.fcw = src.deprecated.fcw + _lead.status = src.present _lead.aLeadTau = src.aLeadTau _lead.modelProb = src.modelProb _lead.radar = src.radar diff --git a/sunnypilot/selfdrive/controls/lib/__init__.py b/openpilot/sunnypilot/selfdrive/controls/lib/__init__.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/__init__.py rename to openpilot/sunnypilot/selfdrive/controls/lib/__init__.py diff --git a/sunnypilot/selfdrive/controls/lib/auto_lane_change.py b/openpilot/sunnypilot/selfdrive/controls/lib/auto_lane_change.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/auto_lane_change.py rename to openpilot/sunnypilot/selfdrive/controls/lib/auto_lane_change.py index cf8de2a1b2..39909ac7b1 100644 --- a/sunnypilot/selfdrive/controls/lib/auto_lane_change.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/auto_lane_change.py @@ -4,7 +4,7 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import log +from openpilot.cereal import log from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL diff --git a/sunnypilot/selfdrive/controls/lib/blinker_pause_lateral.py b/openpilot/sunnypilot/selfdrive/controls/lib/blinker_pause_lateral.py similarity index 97% rename from sunnypilot/selfdrive/controls/lib/blinker_pause_lateral.py rename to openpilot/sunnypilot/selfdrive/controls/lib/blinker_pause_lateral.py index 98757cd532..e9a6be595e 100644 --- a/sunnypilot/selfdrive/controls/lib/blinker_pause_lateral.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/blinker_pause_lateral.py @@ -4,7 +4,7 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import car +from opendbc.car.structs import car from openpilot.common.constants import CV from openpilot.common.params import Params diff --git a/sunnypilot/selfdrive/controls/lib/dec/__init__.py b/openpilot/sunnypilot/selfdrive/controls/lib/dec/__init__.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/dec/__init__.py rename to openpilot/sunnypilot/selfdrive/controls/lib/dec/__init__.py diff --git a/sunnypilot/selfdrive/controls/lib/dec/constants.py b/openpilot/sunnypilot/selfdrive/controls/lib/dec/constants.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/dec/constants.py rename to openpilot/sunnypilot/selfdrive/controls/lib/dec/constants.py diff --git a/sunnypilot/selfdrive/controls/lib/dec/dec.py b/openpilot/sunnypilot/selfdrive/controls/lib/dec/dec.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/dec/dec.py rename to openpilot/sunnypilot/selfdrive/controls/lib/dec/dec.py index 46cad1b048..1ba5ab0618 100644 --- a/sunnypilot/selfdrive/controls/lib/dec/dec.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/dec/dec.py @@ -6,7 +6,7 @@ See the LICENSE.md file in the root directory for more details. """ # Version = 2025-6-30 -from cereal import messaging +from openpilot.cereal import messaging from opendbc.car import structs from numpy import interp from openpilot.common.params import Params @@ -217,7 +217,7 @@ class DynamicExperimentalController: self._standstill_count = max(0, self._standstill_count - 1) # Lead detection - self._lead_filter.add_data(float(lead_one.status)) + self._lead_filter.add_data(float(lead_one.present)) lead_value = self._lead_filter.get_value() or 0.0 self._has_lead_filtered = lead_value > WMACConstants.LEAD_PROB diff --git a/sunnypilot/selfdrive/controls/lib/dec/tests/__init__.py b/openpilot/sunnypilot/selfdrive/controls/lib/dec/tests/__init__.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/dec/tests/__init__.py rename to openpilot/sunnypilot/selfdrive/controls/lib/dec/tests/__init__.py diff --git a/sunnypilot/selfdrive/controls/lib/dec/tests/pytest_dynamic_controller.py b/openpilot/sunnypilot/selfdrive/controls/lib/dec/tests/pytest_dynamic_controller.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/dec/tests/pytest_dynamic_controller.py rename to openpilot/sunnypilot/selfdrive/controls/lib/dec/tests/pytest_dynamic_controller.py diff --git a/sunnypilot/selfdrive/controls/lib/e2e_alerts_helper.py b/openpilot/sunnypilot/selfdrive/controls/lib/e2e_alerts_helper.py similarity index 98% rename from sunnypilot/selfdrive/controls/lib/e2e_alerts_helper.py rename to openpilot/sunnypilot/selfdrive/controls/lib/e2e_alerts_helper.py index 944bf617e9..b75bae2461 100644 --- a/sunnypilot/selfdrive/controls/lib/e2e_alerts_helper.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/e2e_alerts_helper.py @@ -5,7 +5,7 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import messaging, custom +from openpilot.cereal import messaging, custom from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL @@ -61,7 +61,7 @@ class E2EAlertsHelper: model_x = sm['modelV2'].position.x max_idx = len(model_x) - 1 - self.has_lead = sm['radarState'].leadOne.status + self.has_lead = sm['radarState'].leadOne.present lead_dRel = sm['radarState'].leadOne.dRel standstill = CS.standstill diff --git a/sunnypilot/selfdrive/controls/lib/lane_turn_desire.py b/openpilot/sunnypilot/selfdrive/controls/lib/lane_turn_desire.py similarity index 97% rename from sunnypilot/selfdrive/controls/lib/lane_turn_desire.py rename to openpilot/sunnypilot/selfdrive/controls/lib/lane_turn_desire.py index fa35ebb125..ad7e80eda0 100644 --- a/sunnypilot/selfdrive/controls/lib/lane_turn_desire.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/lane_turn_desire.py @@ -4,7 +4,7 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import custom +from openpilot.cereal import custom from openpilot.common.constants import CV from openpilot.common.params import Params diff --git a/sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext.py b/openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext.py rename to openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext.py diff --git a/sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext_base.py b/openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext_base.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext_base.py rename to openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext_base.py diff --git a/sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext_override.py b/openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext_override.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext_override.py rename to openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_ext_override.py diff --git a/sunnypilot/selfdrive/controls/lib/latcontrol_torque_v0.py b/openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_v0.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/latcontrol_torque_v0.py rename to openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_v0.py index f7874cc539..4d9e4492f9 100644 --- a/sunnypilot/selfdrive/controls/lib/latcontrol_torque_v0.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_v0.py @@ -2,7 +2,7 @@ import math import numpy as np from collections import deque -from cereal import log +from openpilot.cereal import log from opendbc.car.lateral import get_friction from openpilot.common.constants import ACCELERATION_DUE_TO_GRAVITY from openpilot.common.filter_simple import FirstOrderFilter diff --git a/sunnypilot/selfdrive/controls/lib/latcontrol_torque_versions.json b/openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_versions.json similarity index 100% rename from sunnypilot/selfdrive/controls/lib/latcontrol_torque_versions.json rename to openpilot/sunnypilot/selfdrive/controls/lib/latcontrol_torque_versions.json diff --git a/sunnypilot/selfdrive/controls/lib/longitudinal_planner.py b/openpilot/sunnypilot/selfdrive/controls/lib/longitudinal_planner.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/longitudinal_planner.py rename to openpilot/sunnypilot/selfdrive/controls/lib/longitudinal_planner.py index 6efda4585f..f1e0c36416 100644 --- a/sunnypilot/selfdrive/controls/lib/longitudinal_planner.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/longitudinal_planner.py @@ -5,7 +5,7 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import messaging, custom +from openpilot.cereal import messaging, custom from opendbc.car import structs from openpilot.common.constants import CV from openpilot.selfdrive.car.cruise import V_CRUISE_MAX diff --git a/sunnypilot/selfdrive/controls/lib/nnlc/__init__.py b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/__init__.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/nnlc/__init__.py rename to openpilot/sunnypilot/selfdrive/controls/lib/nnlc/__init__.py diff --git a/sunnypilot/selfdrive/controls/lib/nnlc/helpers.py b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/helpers.py similarity index 92% rename from sunnypilot/selfdrive/controls/lib/nnlc/helpers.py rename to openpilot/sunnypilot/selfdrive/controls/lib/nnlc/helpers.py index c34fa435c2..a5d56b1ff0 100644 --- a/sunnypilot/selfdrive/controls/lib/nnlc/helpers.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/helpers.py @@ -11,8 +11,8 @@ from difflib import SequenceMatcher from opendbc.car import structs from openpilot.common.basedir import BASEDIR -TORQUE_NN_MODEL_PATH = os.path.join(BASEDIR, "sunnypilot", "neural_network_data", "neural_network_lateral_control") -TORQUE_NN_MODEL_SUBSTITUTE_PATH = os.path.join(BASEDIR, "opendbc", "car", "torque_data/substitute.toml") +TORQUE_NN_MODEL_PATH = os.path.join(BASEDIR, "openpilot", "sunnypilot", "neural_network_data", "neural_network_lateral_control") +TORQUE_NN_MODEL_SUBSTITUTE_PATH = os.path.join(BASEDIR, "opendbc_repo", "opendbc", "car", "torque_data/substitute.toml") MOCK_MODEL_PATH = os.path.join(TORQUE_NN_MODEL_PATH, "MOCK.json") diff --git a/sunnypilot/selfdrive/controls/lib/nnlc/model.py b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/model.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/nnlc/model.py rename to openpilot/sunnypilot/selfdrive/controls/lib/nnlc/model.py diff --git a/sunnypilot/selfdrive/controls/lib/nnlc/nnlc.py b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/nnlc.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/nnlc/nnlc.py rename to openpilot/sunnypilot/selfdrive/controls/lib/nnlc/nnlc.py diff --git a/sunnypilot/selfdrive/controls/lib/nnlc/tests/__init__.py b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/tests/__init__.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/nnlc/tests/__init__.py rename to openpilot/sunnypilot/selfdrive/controls/lib/nnlc/tests/__init__.py diff --git a/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_fingerprint.py b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_fingerprint.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/nnlc/tests/test_fingerprint.py rename to openpilot/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_fingerprint.py diff --git a/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_load_model.py b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_load_model.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/nnlc/tests/test_load_model.py rename to openpilot/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_load_model.py diff --git a/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_nnlc.py b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_nnlc.py similarity index 98% rename from sunnypilot/selfdrive/controls/lib/nnlc/tests/test_nnlc.py rename to openpilot/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_nnlc.py index f2009926cf..56fd2f9ce7 100644 --- a/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_nnlc.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/nnlc/tests/test_nnlc.py @@ -1,6 +1,7 @@ import numpy as np -from cereal import car, log, messaging +from openpilot.cereal import log, messaging +from opendbc.car.structs import car from opendbc.car.car_helpers import interfaces from opendbc.car.gm.values import CAR as GM from opendbc.car.honda.values import CAR as HONDA diff --git a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/__init__.py b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/__init__.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/smart_cruise_control/__init__.py rename to openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/__init__.py diff --git a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/map_controller.py b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/map_controller.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/smart_cruise_control/map_controller.py rename to openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/map_controller.py index c7f11a1bb2..65e157bdbc 100644 --- a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/map_controller.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/map_controller.py @@ -2,7 +2,7 @@ import json import math import platform -from cereal import custom +from openpilot.cereal import custom from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.car.cruise import V_CRUISE_UNSET diff --git a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/smart_cruise_control.py b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/smart_cruise_control.py similarity index 94% rename from sunnypilot/selfdrive/controls/lib/smart_cruise_control/smart_cruise_control.py rename to openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/smart_cruise_control.py index 4ca45202fc..ff6c706634 100644 --- a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/smart_cruise_control.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/smart_cruise_control.py @@ -4,7 +4,7 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -import cereal.messaging as messaging +import openpilot.cereal.messaging as messaging from openpilot.sunnypilot.selfdrive.controls.lib.smart_cruise_control.vision_controller import SmartCruiseControlVision from openpilot.sunnypilot.selfdrive.controls.lib.smart_cruise_control.map_controller import SmartCruiseControlMap diff --git a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_map_controller.py b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_map_controller.py similarity index 98% rename from sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_map_controller.py rename to openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_map_controller.py index 254e85f573..3b16c59bb5 100644 --- a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_map_controller.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_map_controller.py @@ -6,7 +6,7 @@ See the LICENSE.md file in the root directory for more details. """ import platform -from cereal import custom +from openpilot.cereal import custom from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.car.cruise import V_CRUISE_UNSET diff --git a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_vision_controller.py b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_vision_controller.py similarity index 98% rename from sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_vision_controller.py rename to openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_vision_controller.py index 2a2c6a6be1..de54a0fdca 100644 --- a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_vision_controller.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/tests/test_vision_controller.py @@ -7,8 +7,8 @@ See the LICENSE.md file in the root directory for more details. import numpy as np import pytest -import cereal.messaging as messaging -from cereal import custom, log +import openpilot.cereal.messaging as messaging +from openpilot.cereal import custom, log from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.car.cruise import V_CRUISE_UNSET diff --git a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/vision_controller.py b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/vision_controller.py similarity index 98% rename from sunnypilot/selfdrive/controls/lib/smart_cruise_control/vision_controller.py rename to openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/vision_controller.py index a9d2a66227..fb76f5b546 100644 --- a/sunnypilot/selfdrive/controls/lib/smart_cruise_control/vision_controller.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/smart_cruise_control/vision_controller.py @@ -6,8 +6,8 @@ See the LICENSE.md file in the root directory for more details. """ import numpy as np -import cereal.messaging as messaging -from cereal import custom +import openpilot.cereal.messaging as messaging +from openpilot.cereal import custom from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL from openpilot.selfdrive.car.cruise import V_CRUISE_UNSET diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit/__init__.py b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/__init__.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/speed_limit/__init__.py rename to openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/__init__.py diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit/common.py b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/common.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/speed_limit/common.py rename to openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/common.py diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit/helpers.py b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/helpers.py similarity index 95% rename from sunnypilot/selfdrive/controls/lib/speed_limit/helpers.py rename to openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/helpers.py index 9eddceb820..77d89251e2 100644 --- a/sunnypilot/selfdrive/controls/lib/speed_limit/helpers.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/helpers.py @@ -5,7 +5,8 @@ This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import custom, car +from openpilot.cereal import custom +from opendbc.car.structs import car from openpilot.common.constants import CV from openpilot.common.params import Params from openpilot.sunnypilot.selfdrive.controls.lib.speed_limit.common import Mode as SpeedLimitMode diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py rename to openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py index ff7be8a8be..1ff541167f 100644 --- a/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_assist.py @@ -6,7 +6,8 @@ See the LICENSE.md file in the root directory for more details. """ import time -from cereal import custom, car +from openpilot.cereal import custom +from opendbc.car.structs import car from openpilot.common.params import Params from openpilot.common.constants import CV from openpilot.common.realtime import DT_MDL diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_resolver.py b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_resolver.py similarity index 98% rename from sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_resolver.py rename to openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_resolver.py index 35965c0e18..e46196654c 100644 --- a/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_resolver.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/speed_limit_resolver.py @@ -6,8 +6,8 @@ See the LICENSE.md file in the root directory for more details. """ import time -import cereal.messaging as messaging -from cereal import custom +import openpilot.cereal.messaging as messaging +from openpilot.cereal import custom from openpilot.common.constants import CV from openpilot.common.gps import get_gps_location_service from openpilot.common.params import Params diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit/tests/__init__.py b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/tests/__init__.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/speed_limit/tests/__init__.py rename to openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/tests/__init__.py diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_assist.py b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_assist.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_assist.py rename to openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_assist.py index 6dbe32eaf4..7cd6fef524 100644 --- a/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_assist.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_assist.py @@ -7,7 +7,7 @@ See the LICENSE.md file in the root directory for more details. import pytest -from cereal import custom +from openpilot.cereal import custom from opendbc.car.car_helpers import interfaces from opendbc.car.rivian.values import CAR as RIVIAN from opendbc.car.tesla.values import CAR as TESLA diff --git a/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_resolver.py b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_resolver.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_resolver.py rename to openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_resolver.py index c02831d71a..a18880c620 100644 --- a/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_resolver.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/speed_limit/tests/test_speed_limit_resolver.py @@ -10,7 +10,7 @@ import time import pytest from pytest_mock import MockerFixture -from cereal import custom +from openpilot.cereal import custom from openpilot.sunnypilot.selfdrive.controls.lib.speed_limit import LIMIT_MAX_MAP_DATA_AGE from openpilot.sunnypilot.selfdrive.controls.lib.speed_limit.speed_limit_resolver import SpeedLimitResolver, ALL_SOURCES diff --git a/sunnypilot/selfdrive/controls/lib/tests/test_auto_lane_change.py b/openpilot/sunnypilot/selfdrive/controls/lib/tests/test_auto_lane_change.py similarity index 100% rename from sunnypilot/selfdrive/controls/lib/tests/test_auto_lane_change.py rename to openpilot/sunnypilot/selfdrive/controls/lib/tests/test_auto_lane_change.py diff --git a/sunnypilot/selfdrive/controls/lib/tests/test_blinker_pause_lateral.py b/openpilot/sunnypilot/selfdrive/controls/lib/tests/test_blinker_pause_lateral.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/tests/test_blinker_pause_lateral.py rename to openpilot/sunnypilot/selfdrive/controls/lib/tests/test_blinker_pause_lateral.py index b547ea96b6..7a72cfa1f2 100644 --- a/sunnypilot/selfdrive/controls/lib/tests/test_blinker_pause_lateral.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/tests/test_blinker_pause_lateral.py @@ -4,7 +4,7 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import car +from opendbc.car.structs import car from openpilot.common.constants import CV from openpilot.sunnypilot.selfdrive.controls.lib.blinker_pause_lateral import BlinkerPauseLateral diff --git a/sunnypilot/selfdrive/controls/lib/tests/test_lane_turn_desire.py b/openpilot/sunnypilot/selfdrive/controls/lib/tests/test_lane_turn_desire.py similarity index 99% rename from sunnypilot/selfdrive/controls/lib/tests/test_lane_turn_desire.py rename to openpilot/sunnypilot/selfdrive/controls/lib/tests/test_lane_turn_desire.py index 57fe7b684f..c3e96fd778 100644 --- a/sunnypilot/selfdrive/controls/lib/tests/test_lane_turn_desire.py +++ b/openpilot/sunnypilot/selfdrive/controls/lib/tests/test_lane_turn_desire.py @@ -1,5 +1,5 @@ import pytest -from cereal import log, custom +from openpilot.cereal import log, custom from openpilot.common.params import Params from openpilot.selfdrive.controls.lib.desire_helper import DesireHelper diff --git a/sunnypilot/selfdrive/locationd/.gitignore b/openpilot/sunnypilot/selfdrive/locationd/.gitignore similarity index 100% rename from sunnypilot/selfdrive/locationd/.gitignore rename to openpilot/sunnypilot/selfdrive/locationd/.gitignore diff --git a/sunnypilot/selfdrive/locationd/SConscript b/openpilot/sunnypilot/selfdrive/locationd/SConscript similarity index 100% rename from sunnypilot/selfdrive/locationd/SConscript rename to openpilot/sunnypilot/selfdrive/locationd/SConscript diff --git a/sunnypilot/selfdrive/locationd/__init__.py b/openpilot/sunnypilot/selfdrive/locationd/__init__.py similarity index 100% rename from sunnypilot/selfdrive/locationd/__init__.py rename to openpilot/sunnypilot/selfdrive/locationd/__init__.py diff --git a/sunnypilot/selfdrive/locationd/locationd.cc b/openpilot/sunnypilot/selfdrive/locationd/locationd.cc similarity index 100% rename from sunnypilot/selfdrive/locationd/locationd.cc rename to openpilot/sunnypilot/selfdrive/locationd/locationd.cc diff --git a/sunnypilot/selfdrive/locationd/locationd.h b/openpilot/sunnypilot/selfdrive/locationd/locationd.h similarity index 100% rename from sunnypilot/selfdrive/locationd/locationd.h rename to openpilot/sunnypilot/selfdrive/locationd/locationd.h diff --git a/sunnypilot/selfdrive/locationd/models/.gitignore b/openpilot/sunnypilot/selfdrive/locationd/models/.gitignore similarity index 100% rename from sunnypilot/selfdrive/locationd/models/.gitignore rename to openpilot/sunnypilot/selfdrive/locationd/models/.gitignore diff --git a/sunnypilot/selfdrive/locationd/models/__init__.py b/openpilot/sunnypilot/selfdrive/locationd/models/__init__.py similarity index 100% rename from sunnypilot/selfdrive/locationd/models/__init__.py rename to openpilot/sunnypilot/selfdrive/locationd/models/__init__.py diff --git a/sunnypilot/selfdrive/locationd/models/car_kf.py b/openpilot/sunnypilot/selfdrive/locationd/models/car_kf.py similarity index 100% rename from sunnypilot/selfdrive/locationd/models/car_kf.py rename to openpilot/sunnypilot/selfdrive/locationd/models/car_kf.py diff --git a/sunnypilot/selfdrive/locationd/models/constants.py b/openpilot/sunnypilot/selfdrive/locationd/models/constants.py similarity index 100% rename from sunnypilot/selfdrive/locationd/models/constants.py rename to openpilot/sunnypilot/selfdrive/locationd/models/constants.py diff --git a/sunnypilot/selfdrive/locationd/models/live_kf.cc b/openpilot/sunnypilot/selfdrive/locationd/models/live_kf.cc similarity index 100% rename from sunnypilot/selfdrive/locationd/models/live_kf.cc rename to openpilot/sunnypilot/selfdrive/locationd/models/live_kf.cc diff --git a/sunnypilot/selfdrive/locationd/models/live_kf.h b/openpilot/sunnypilot/selfdrive/locationd/models/live_kf.h similarity index 100% rename from sunnypilot/selfdrive/locationd/models/live_kf.h rename to openpilot/sunnypilot/selfdrive/locationd/models/live_kf.h diff --git a/sunnypilot/selfdrive/locationd/models/live_kf.py b/openpilot/sunnypilot/selfdrive/locationd/models/live_kf.py similarity index 100% rename from sunnypilot/selfdrive/locationd/models/live_kf.py rename to openpilot/sunnypilot/selfdrive/locationd/models/live_kf.py diff --git a/sunnypilot/selfdrive/locationd/tests/.gitignore b/openpilot/sunnypilot/selfdrive/locationd/tests/.gitignore similarity index 100% rename from sunnypilot/selfdrive/locationd/tests/.gitignore rename to openpilot/sunnypilot/selfdrive/locationd/tests/.gitignore diff --git a/sunnypilot/selfdrive/locationd/tests/__init__.py b/openpilot/sunnypilot/selfdrive/locationd/tests/__init__.py similarity index 100% rename from sunnypilot/selfdrive/locationd/tests/__init__.py rename to openpilot/sunnypilot/selfdrive/locationd/tests/__init__.py diff --git a/sunnypilot/selfdrive/locationd/tests/test_locationd.py b/openpilot/sunnypilot/selfdrive/locationd/tests/test_locationd.py similarity index 97% rename from sunnypilot/selfdrive/locationd/tests/test_locationd.py rename to openpilot/sunnypilot/selfdrive/locationd/tests/test_locationd.py index 1f5bfd3b25..551259fa01 100644 --- a/sunnypilot/selfdrive/locationd/tests/test_locationd.py +++ b/openpilot/sunnypilot/selfdrive/locationd/tests/test_locationd.py @@ -5,8 +5,8 @@ import random import time import capnp -import cereal.messaging as messaging -from cereal.services import SERVICE_LIST +import openpilot.cereal.messaging as messaging +from openpilot.cereal.services import SERVICE_LIST from openpilot.common.params import Params from openpilot.common.transformations.coordinates import ecef2geodetic diff --git a/sunnypilot/selfdrive/locationd/torqued_ext.py b/openpilot/sunnypilot/selfdrive/locationd/torqued_ext.py similarity index 98% rename from sunnypilot/selfdrive/locationd/torqued_ext.py rename to openpilot/sunnypilot/selfdrive/locationd/torqued_ext.py index 1e62b7666a..f1f16f58ee 100644 --- a/sunnypilot/selfdrive/locationd/torqued_ext.py +++ b/openpilot/sunnypilot/selfdrive/locationd/torqued_ext.py @@ -6,7 +6,7 @@ See the LICENSE.md file in the root directory for more details. """ import numpy as np -from cereal import car +from opendbc.car.structs import car from openpilot.common.params import Params from openpilot.common.realtime import DT_MDL diff --git a/sunnypilot/selfdrive/pandad/__init__.py b/openpilot/sunnypilot/selfdrive/pandad/__init__.py similarity index 100% rename from sunnypilot/selfdrive/pandad/__init__.py rename to openpilot/sunnypilot/selfdrive/pandad/__init__.py diff --git a/sunnypilot/selfdrive/pandad/rivian_long_flasher.py b/openpilot/sunnypilot/selfdrive/pandad/rivian_long_flasher.py similarity index 97% rename from sunnypilot/selfdrive/pandad/rivian_long_flasher.py rename to openpilot/sunnypilot/selfdrive/pandad/rivian_long_flasher.py index 305b994c78..3be9fb0e4d 100755 --- a/sunnypilot/selfdrive/pandad/rivian_long_flasher.py +++ b/openpilot/sunnypilot/selfdrive/pandad/rivian_long_flasher.py @@ -8,7 +8,8 @@ See the LICENSE.md file in the root directory for more details. import os from itertools import accumulate -from cereal import car, messaging +from openpilot.cereal import messaging +from opendbc.car.structs import car from panda import Panda from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog diff --git a/sunnypilot/selfdrive/pandad/rivian_long_fw.bin.signed b/openpilot/sunnypilot/selfdrive/pandad/rivian_long_fw.bin.signed similarity index 100% rename from sunnypilot/selfdrive/pandad/rivian_long_fw.bin.signed rename to openpilot/sunnypilot/selfdrive/pandad/rivian_long_fw.bin.signed diff --git a/sunnypilot/selfdrive/selfdrived/__init__.py b/openpilot/sunnypilot/selfdrive/selfdrived/__init__.py similarity index 100% rename from sunnypilot/selfdrive/selfdrived/__init__.py rename to openpilot/sunnypilot/selfdrive/selfdrived/__init__.py diff --git a/sunnypilot/selfdrive/selfdrived/events.py b/openpilot/sunnypilot/selfdrive/selfdrived/events.py similarity index 98% rename from sunnypilot/selfdrive/selfdrived/events.py rename to openpilot/sunnypilot/selfdrive/selfdrived/events.py index e9b0e99153..2001d0dbee 100644 --- a/sunnypilot/selfdrive/selfdrived/events.py +++ b/openpilot/sunnypilot/selfdrive/selfdrived/events.py @@ -4,8 +4,9 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -import cereal.messaging as messaging -from cereal import log, car, custom +import openpilot.cereal.messaging as messaging +from openpilot.cereal import log, custom +from opendbc.car.structs import car from openpilot.common.constants import CV from openpilot.sunnypilot.selfdrive.selfdrived.events_base import EventsBase, Priority, ET, Alert, \ NoEntryAlert, ImmediateDisableAlert, EngagementAlert, NormalPermanentAlert, AlertCallbackType, wrong_car_mode_alert diff --git a/sunnypilot/selfdrive/selfdrived/events_base.py b/openpilot/sunnypilot/selfdrive/selfdrived/events_base.py similarity index 94% rename from sunnypilot/selfdrive/selfdrived/events_base.py rename to openpilot/sunnypilot/selfdrive/selfdrived/events_base.py index 402121f2fe..a392978144 100644 --- a/sunnypilot/selfdrive/selfdrived/events_base.py +++ b/openpilot/sunnypilot/selfdrive/selfdrived/events_base.py @@ -3,15 +3,16 @@ from enum import IntEnum from abc import abstractmethod from collections.abc import Callable -from cereal import log, car -import cereal.messaging as messaging +from openpilot.cereal import log +from opendbc.car.structs import car +import openpilot.cereal.messaging as messaging from openpilot.common.realtime import DT_CTRL from openpilot.common.hardware import HARDWARE AlertSize = log.SelfdriveState.AlertSize AlertStatus = log.SelfdriveState.AlertStatus VisualAlert = car.CarControl.HUDControl.VisualAlert -AudibleAlert = car.CarControl.HUDControl.AudibleAlert +AudibleAlert = log.SelfdriveState.AudibleAlert # Alert priorities @@ -46,7 +47,7 @@ class Alert: alert_size: log.SelfdriveState.AlertSize, priority: Priority, visual_alert: car.CarControl.HUDControl.VisualAlert, - audible_alert: car.CarControl.HUDControl.AudibleAlert, + audible_alert: log.SelfdriveState.AudibleAlert, duration: float, creation_delay: float = 0.): @@ -77,7 +78,7 @@ class AlertBase(Alert): def __init__(self, alert_text_1: str, alert_text_2: str, alert_status: log.SelfdriveState.AlertStatus, alert_size: log.SelfdriveState.AlertSize, priority: Priority, visual_alert: car.CarControl.HUDControl.VisualAlert, - audible_alert: car.CarControl.HUDControl.AudibleAlert, duration: float): + audible_alert: log.SelfdriveState.AudibleAlert, duration: float): super().__init__(alert_text_1, alert_text_2, alert_status, alert_size, priority, visual_alert, audible_alert, duration) @@ -185,11 +186,12 @@ EmptyAlert = Alert("" , "", AlertStatus.normal, AlertSize.none, Priority.LOWEST, class NoEntryAlert(Alert): def __init__(self, alert_text_2: str, alert_text_1: str = "openpilot Unavailable", - visual_alert: car.CarControl.HUDControl.VisualAlert=VisualAlert.none): + visual_alert: car.CarControl.HUDControl.VisualAlert=VisualAlert.none, + priority: Priority = Priority.LOW): if HARDWARE.get_device_type() == 'mici': alert_text_1, alert_text_2 = alert_text_2, alert_text_1 super().__init__(alert_text_1, alert_text_2, AlertStatus.normal, - AlertSize.mid, Priority.LOW, visual_alert, + AlertSize.mid, priority, visual_alert, AudibleAlert.refuse, 3.) @@ -217,7 +219,7 @@ class ImmediateDisableAlert(Alert): class EngagementAlert(Alert): - def __init__(self, audible_alert: car.CarControl.HUDControl.AudibleAlert): + def __init__(self, audible_alert: log.SelfdriveState.AudibleAlert): super().__init__("", "", AlertStatus.normal, AlertSize.none, Priority.MID, VisualAlert.none, diff --git a/sunnypilot/selfdrive/ui/quiet_mode.py b/openpilot/sunnypilot/selfdrive/ui/quiet_mode.py similarity index 96% rename from sunnypilot/selfdrive/ui/quiet_mode.py rename to openpilot/sunnypilot/selfdrive/ui/quiet_mode.py index 739ea1392c..d4dba74d95 100644 --- a/sunnypilot/selfdrive/ui/quiet_mode.py +++ b/openpilot/sunnypilot/selfdrive/ui/quiet_mode.py @@ -4,7 +4,7 @@ Copyright (c) 2021-, Haibin Wen, sunnypilot, and a number of other contributors. This file is part of sunnypilot and is licensed under the MIT License. See the LICENSE.md file in the root directory for more details. """ -from cereal import car +from opendbc.car.structs import car from openpilot.common.params import Params diff --git a/sunnypilot/sunnylink/__init__.py b/openpilot/sunnypilot/sunnylink/__init__.py similarity index 100% rename from sunnypilot/sunnylink/__init__.py rename to openpilot/sunnypilot/sunnylink/__init__.py diff --git a/sunnypilot/sunnylink/api.py b/openpilot/sunnypilot/sunnylink/api.py similarity index 100% rename from sunnypilot/sunnylink/api.py rename to openpilot/sunnypilot/sunnylink/api.py diff --git a/sunnypilot/sunnylink/athena/__init__.py b/openpilot/sunnypilot/sunnylink/athena/__init__.py similarity index 100% rename from sunnypilot/sunnylink/athena/__init__.py rename to openpilot/sunnypilot/sunnylink/athena/__init__.py diff --git a/sunnypilot/sunnylink/athena/manage_sunnylinkd.py b/openpilot/sunnypilot/sunnylink/athena/manage_sunnylinkd.py similarity index 100% rename from sunnypilot/sunnylink/athena/manage_sunnylinkd.py rename to openpilot/sunnypilot/sunnylink/athena/manage_sunnylinkd.py diff --git a/sunnypilot/sunnylink/athena/sunnylinkd.py b/openpilot/sunnypilot/sunnylink/athena/sunnylinkd.py similarity index 99% rename from sunnypilot/sunnylink/athena/sunnylinkd.py rename to openpilot/sunnypilot/sunnylink/athena/sunnylinkd.py index 1a7e69f31c..3bc4ca54c2 100755 --- a/sunnypilot/sunnylink/athena/sunnylinkd.py +++ b/openpilot/sunnypilot/sunnylink/athena/sunnylinkd.py @@ -27,7 +27,7 @@ from openpilot.system.athena.athenad import ws_send, jsonrpc_handler, \ from websocket import (ABNF, WebSocket, WebSocketException, WebSocketTimeoutException, create_connection, WebSocketConnectionClosedException) -import cereal.messaging as messaging +import openpilot.cereal.messaging as messaging from openpilot.sunnypilot.models.default_model import DEFAULT_MODEL from openpilot.sunnypilot.selfdrive.car.sync_sunnylink_params import update_car_list_param from openpilot.sunnypilot.sunnylink.api import SunnylinkApi diff --git a/sunnypilot/sunnylink/athena/tests/test_sunnylinkd.py b/openpilot/sunnypilot/sunnylink/athena/tests/test_sunnylinkd.py similarity index 100% rename from sunnypilot/sunnylink/athena/tests/test_sunnylinkd.py rename to openpilot/sunnypilot/sunnylink/athena/tests/test_sunnylinkd.py diff --git a/sunnypilot/sunnylink/backups/AESCipher.py b/openpilot/sunnypilot/sunnylink/backups/AESCipher.py similarity index 100% rename from sunnypilot/sunnylink/backups/AESCipher.py rename to openpilot/sunnypilot/sunnylink/backups/AESCipher.py diff --git a/sunnypilot/sunnylink/backups/__init__.py b/openpilot/sunnypilot/sunnylink/backups/__init__.py similarity index 100% rename from sunnypilot/sunnylink/backups/__init__.py rename to openpilot/sunnypilot/sunnylink/backups/__init__.py diff --git a/sunnypilot/sunnylink/backups/manager.py b/openpilot/sunnypilot/sunnylink/backups/manager.py similarity index 99% rename from sunnypilot/sunnylink/backups/manager.py rename to openpilot/sunnypilot/sunnylink/backups/manager.py index 44cdb3bff2..5ac6b8cabc 100644 --- a/sunnypilot/sunnylink/backups/manager.py +++ b/openpilot/sunnypilot/sunnylink/backups/manager.py @@ -16,9 +16,9 @@ from openpilot.common.git import get_branch from openpilot.common.params import Params, ParamKeyFlag from openpilot.common.realtime import Ratekeeper from openpilot.common.swaglog import cloudlog -from openpilot.system.version import get_version +from openpilot.common.version import get_version -from cereal import messaging, custom +from openpilot.cereal import messaging, custom from openpilot.sunnypilot.sunnylink.api import SunnylinkApi from openpilot.sunnypilot.sunnylink.backups.utils import decrypt_compressed_data, encrypt_compressed_data, SnakeCaseEncoder from openpilot.sunnypilot.sunnylink.utils import get_param_as_byte, save_param_from_base64_encoded_string diff --git a/sunnypilot/sunnylink/backups/utils.py b/openpilot/sunnypilot/sunnylink/backups/utils.py similarity index 100% rename from sunnypilot/sunnylink/backups/utils.py rename to openpilot/sunnypilot/sunnylink/backups/utils.py diff --git a/sunnypilot/sunnylink/capabilities.py b/openpilot/sunnypilot/sunnylink/capabilities.py similarity index 98% rename from sunnypilot/sunnylink/capabilities.py rename to openpilot/sunnypilot/sunnylink/capabilities.py index 197e404314..1f12b5b001 100644 --- a/sunnypilot/sunnylink/capabilities.py +++ b/openpilot/sunnypilot/sunnylink/capabilities.py @@ -6,7 +6,8 @@ See the LICENSE.md file in the root directory for more details. """ import json -from cereal import car, custom, messaging +from openpilot.cereal import custom, messaging +from opendbc.car.structs import car from opendbc.car.hyundai.values import CAR as HYUNDAI_CAR, UNSUPPORTED_LONGITUDINAL_CAR from opendbc.car.subaru.values import CAR as SUBARU_CAR, SubaruFlags from opendbc.sunnypilot.car.tesla.values import TeslaFlagsSP diff --git a/sunnypilot/sunnylink/docs/README.md b/openpilot/sunnypilot/sunnylink/docs/README.md similarity index 100% rename from sunnypilot/sunnylink/docs/README.md rename to openpilot/sunnypilot/sunnylink/docs/README.md diff --git a/sunnypilot/sunnylink/registration_manager.py b/openpilot/sunnypilot/sunnylink/registration_manager.py similarity index 95% rename from sunnypilot/sunnylink/registration_manager.py rename to openpilot/sunnypilot/sunnylink/registration_manager.py index 3e00c5c013..cc43dcae87 100755 --- a/sunnypilot/sunnylink/registration_manager.py +++ b/openpilot/sunnypilot/sunnylink/registration_manager.py @@ -5,7 +5,7 @@ from openpilot.common.params import Params from openpilot.common.realtime import Ratekeeper from openpilot.common.swaglog import cloudlog -from cereal import log, messaging +from openpilot.cereal import log, messaging from openpilot.sunnypilot.sunnylink.utils import register_sunnylink NetworkType = log.DeviceState.NetworkType diff --git a/sunnypilot/sunnylink/settings_ui.json b/openpilot/sunnypilot/sunnylink/settings_ui.json similarity index 100% rename from sunnypilot/sunnylink/settings_ui.json rename to openpilot/sunnypilot/sunnylink/settings_ui.json diff --git a/sunnypilot/sunnylink/settings_ui.schema.json b/openpilot/sunnypilot/sunnylink/settings_ui.schema.json similarity index 100% rename from sunnypilot/sunnylink/settings_ui.schema.json rename to openpilot/sunnypilot/sunnylink/settings_ui.schema.json diff --git a/sunnypilot/sunnylink/settings_ui_src/_macros.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/_macros.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/_macros.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/_macros.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/_schemas/macros.schema.json b/openpilot/sunnypilot/sunnylink/settings_ui_src/_schemas/macros.schema.json similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/_schemas/macros.schema.json rename to openpilot/sunnypilot/sunnylink/settings_ui_src/_schemas/macros.schema.json diff --git a/sunnypilot/sunnylink/settings_ui_src/_schemas/page.schema.json b/openpilot/sunnypilot/sunnylink/settings_ui_src/_schemas/page.schema.json similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/_schemas/page.schema.json rename to openpilot/sunnypilot/sunnylink/settings_ui_src/_schemas/page.schema.json diff --git a/sunnypilot/sunnylink/settings_ui_src/_schemas/rule.schema.json b/openpilot/sunnypilot/sunnylink/settings_ui_src/_schemas/rule.schema.json similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/_schemas/rule.schema.json rename to openpilot/sunnypilot/sunnylink/settings_ui_src/_schemas/rule.schema.json diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/cruise.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/cruise.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/cruise.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/cruise.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/developer.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/developer.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/developer.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/developer.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/device.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/device.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/device.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/device.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/display.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/display.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/display.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/display.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/models.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/models.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/models.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/models.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/software.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/software.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/software.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/software.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/steering.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/steering.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/steering.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/steering.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/toggles.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/toggles.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/toggles.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/toggles.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/vehicle.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/vehicle.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/vehicle.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/vehicle.yaml diff --git a/sunnypilot/sunnylink/settings_ui_src/pages/visuals.yaml b/openpilot/sunnypilot/sunnylink/settings_ui_src/pages/visuals.yaml similarity index 100% rename from sunnypilot/sunnylink/settings_ui_src/pages/visuals.yaml rename to openpilot/sunnypilot/sunnylink/settings_ui_src/pages/visuals.yaml diff --git a/sunnypilot/sunnylink/statsd.py b/openpilot/sunnypilot/sunnylink/statsd.py similarity index 97% rename from sunnypilot/sunnylink/statsd.py rename to openpilot/sunnypilot/sunnylink/statsd.py index f1ee18decd..7e8faf6327 100755 --- a/sunnypilot/sunnylink/statsd.py +++ b/openpilot/sunnypilot/sunnylink/statsd.py @@ -13,14 +13,14 @@ from collections import defaultdict from datetime import datetime, UTC from openpilot.common.params import Params -from cereal.messaging import SubMaster +from openpilot.cereal.messaging import SubMaster from openpilot.common.hardware.hw import Paths from openpilot.common.swaglog import cloudlog from openpilot.common.hardware import HARDWARE from openpilot.common.utils import atomic_write -from openpilot.system.version import get_build_metadata +from openpilot.common.version import get_build_metadata from openpilot.system.loggerd.config import STATS_DIR_FILE_LIMIT, STATS_SOCKET, STATS_FLUSH_TIME_S -from openpilot.system.statsd import METRIC_TYPE, StatLogSP +from openpilot.sunnypilot.system.statsd import METRIC_TYPE, StatLogSP from openpilot.common.realtime import Ratekeeper STATSLOGSP = StatLogSP(intercept=False) diff --git a/sunnypilot/sunnylink/sunnylink_state.py b/openpilot/sunnypilot/sunnylink/sunnylink_state.py similarity index 99% rename from sunnypilot/sunnylink/sunnylink_state.py rename to openpilot/sunnypilot/sunnylink/sunnylink_state.py index a4a3df3a2b..7dc553951e 100644 --- a/sunnypilot/sunnylink/sunnylink_state.py +++ b/openpilot/sunnypilot/sunnylink/sunnylink_state.py @@ -11,7 +11,7 @@ import time import json import pyray as rl -from cereal import messaging +from openpilot.cereal import messaging from openpilot.common.params import Params from openpilot.common.swaglog import cloudlog from openpilot.sunnypilot.sunnylink.api import UNREGISTERED_SUNNYLINK_DONGLE_ID, SunnylinkApi diff --git a/sunnypilot/sunnylink/tests/test_capabilities.py b/openpilot/sunnypilot/sunnylink/tests/test_capabilities.py similarity index 100% rename from sunnypilot/sunnylink/tests/test_capabilities.py rename to openpilot/sunnypilot/sunnylink/tests/test_capabilities.py diff --git a/sunnypilot/sunnylink/tests/test_compile_settings_ui.py b/openpilot/sunnypilot/sunnylink/tests/test_compile_settings_ui.py similarity index 100% rename from sunnypilot/sunnylink/tests/test_compile_settings_ui.py rename to openpilot/sunnypilot/sunnylink/tests/test_compile_settings_ui.py diff --git a/sunnypilot/sunnylink/tests/test_settings_changes.py b/openpilot/sunnypilot/sunnylink/tests/test_settings_changes.py similarity index 100% rename from sunnypilot/sunnylink/tests/test_settings_changes.py rename to openpilot/sunnypilot/sunnylink/tests/test_settings_changes.py diff --git a/sunnypilot/sunnylink/tests/test_settings_schema.py b/openpilot/sunnypilot/sunnylink/tests/test_settings_schema.py similarity index 100% rename from sunnypilot/sunnylink/tests/test_settings_schema.py rename to openpilot/sunnypilot/sunnylink/tests/test_settings_schema.py diff --git a/sunnypilot/sunnylink/tools/apply_macros.py b/openpilot/sunnypilot/sunnylink/tools/apply_macros.py similarity index 100% rename from sunnypilot/sunnylink/tools/apply_macros.py rename to openpilot/sunnypilot/sunnylink/tools/apply_macros.py diff --git a/sunnypilot/sunnylink/tools/compile_settings_ui.py b/openpilot/sunnypilot/sunnylink/tools/compile_settings_ui.py similarity index 100% rename from sunnypilot/sunnylink/tools/compile_settings_ui.py rename to openpilot/sunnypilot/sunnylink/tools/compile_settings_ui.py diff --git a/sunnypilot/sunnylink/tools/extract_settings_ui.py b/openpilot/sunnypilot/sunnylink/tools/extract_settings_ui.py similarity index 100% rename from sunnypilot/sunnylink/tools/extract_settings_ui.py rename to openpilot/sunnypilot/sunnylink/tools/extract_settings_ui.py diff --git a/sunnypilot/sunnylink/tools/generate_settings_schema.py b/openpilot/sunnypilot/sunnylink/tools/generate_settings_schema.py similarity index 100% rename from sunnypilot/sunnylink/tools/generate_settings_schema.py rename to openpilot/sunnypilot/sunnylink/tools/generate_settings_schema.py diff --git a/sunnypilot/sunnylink/tools/validate_settings_ui.py b/openpilot/sunnypilot/sunnylink/tools/validate_settings_ui.py similarity index 100% rename from sunnypilot/sunnylink/tools/validate_settings_ui.py rename to openpilot/sunnypilot/sunnylink/tools/validate_settings_ui.py diff --git a/sunnypilot/sunnylink/uploader.py b/openpilot/sunnypilot/sunnylink/uploader.py similarity index 99% rename from sunnypilot/sunnylink/uploader.py rename to openpilot/sunnypilot/sunnylink/uploader.py index c1da47fa0c..358e3a88e7 100755 --- a/sunnypilot/sunnylink/uploader.py +++ b/openpilot/sunnypilot/sunnylink/uploader.py @@ -9,8 +9,8 @@ import traceback import datetime from collections.abc import Iterator -from cereal import log -import cereal.messaging as messaging +from openpilot.cereal import log +import openpilot.cereal.messaging as messaging from openpilot.sunnypilot.sunnylink.api import SunnylinkApi from openpilot.common.utils import get_upload_stream from openpilot.common.params import Params diff --git a/sunnypilot/sunnylink/utils.py b/openpilot/sunnypilot/sunnylink/utils.py similarity index 98% rename from sunnypilot/sunnylink/utils.py rename to openpilot/sunnypilot/sunnylink/utils.py index 89c3c8a0c8..5588711977 100644 --- a/sunnypilot/sunnylink/utils.py +++ b/openpilot/sunnypilot/sunnylink/utils.py @@ -3,7 +3,7 @@ import gzip import json from openpilot.sunnypilot.sunnylink.api import SunnylinkApi, UNREGISTERED_SUNNYLINK_DONGLE_ID from openpilot.common.params import Params, ParamKeyType -from openpilot.system.version import is_prebuilt +from openpilot.common.version import is_prebuilt def get_sunnylink_status(params=None) -> tuple[bool, bool, bool]: diff --git a/sunnypilot/system/__init__.py b/openpilot/sunnypilot/system/__init__.py similarity index 100% rename from sunnypilot/system/__init__.py rename to openpilot/sunnypilot/system/__init__.py diff --git a/sunnypilot/system/hardware/c3/README.md b/openpilot/sunnypilot/system/hardware/c3/README.md similarity index 100% rename from sunnypilot/system/hardware/c3/README.md rename to openpilot/sunnypilot/system/hardware/c3/README.md diff --git a/sunnypilot/system/hardware/c3/agnos.json b/openpilot/sunnypilot/system/hardware/c3/agnos.json similarity index 100% rename from sunnypilot/system/hardware/c3/agnos.json rename to openpilot/sunnypilot/system/hardware/c3/agnos.json diff --git a/sunnypilot/system/hardware/c3/launch_chffrplus.sh b/openpilot/sunnypilot/system/hardware/c3/launch_chffrplus.sh similarity index 100% rename from sunnypilot/system/hardware/c3/launch_chffrplus.sh rename to openpilot/sunnypilot/system/hardware/c3/launch_chffrplus.sh diff --git a/sunnypilot/system/hardware/c3/launch_env.sh b/openpilot/sunnypilot/system/hardware/c3/launch_env.sh similarity index 100% rename from sunnypilot/system/hardware/c3/launch_env.sh rename to openpilot/sunnypilot/system/hardware/c3/launch_env.sh diff --git a/sunnypilot/system/params_migration.py b/openpilot/sunnypilot/system/params_migration.py similarity index 100% rename from sunnypilot/system/params_migration.py rename to openpilot/sunnypilot/system/params_migration.py diff --git a/sunnypilot/system/sensord/.gitignore b/openpilot/sunnypilot/system/sensord/.gitignore similarity index 100% rename from sunnypilot/system/sensord/.gitignore rename to openpilot/sunnypilot/system/sensord/.gitignore diff --git a/sunnypilot/system/sensord/SConscript b/openpilot/sunnypilot/system/sensord/SConscript similarity index 100% rename from sunnypilot/system/sensord/SConscript rename to openpilot/sunnypilot/system/sensord/SConscript diff --git a/sunnypilot/system/sensord/sensors/bmx055_accel.cc b/openpilot/sunnypilot/system/sensord/sensors/bmx055_accel.cc similarity index 100% rename from sunnypilot/system/sensord/sensors/bmx055_accel.cc rename to openpilot/sunnypilot/system/sensord/sensors/bmx055_accel.cc diff --git a/sunnypilot/system/sensord/sensors/bmx055_accel.h b/openpilot/sunnypilot/system/sensord/sensors/bmx055_accel.h similarity index 100% rename from sunnypilot/system/sensord/sensors/bmx055_accel.h rename to openpilot/sunnypilot/system/sensord/sensors/bmx055_accel.h diff --git a/sunnypilot/system/sensord/sensors/bmx055_gyro.cc b/openpilot/sunnypilot/system/sensord/sensors/bmx055_gyro.cc similarity index 100% rename from sunnypilot/system/sensord/sensors/bmx055_gyro.cc rename to openpilot/sunnypilot/system/sensord/sensors/bmx055_gyro.cc diff --git a/sunnypilot/system/sensord/sensors/bmx055_gyro.h b/openpilot/sunnypilot/system/sensord/sensors/bmx055_gyro.h similarity index 100% rename from sunnypilot/system/sensord/sensors/bmx055_gyro.h rename to openpilot/sunnypilot/system/sensord/sensors/bmx055_gyro.h diff --git a/sunnypilot/system/sensord/sensors/bmx055_magn.cc b/openpilot/sunnypilot/system/sensord/sensors/bmx055_magn.cc similarity index 100% rename from sunnypilot/system/sensord/sensors/bmx055_magn.cc rename to openpilot/sunnypilot/system/sensord/sensors/bmx055_magn.cc diff --git a/sunnypilot/system/sensord/sensors/bmx055_magn.h b/openpilot/sunnypilot/system/sensord/sensors/bmx055_magn.h similarity index 100% rename from sunnypilot/system/sensord/sensors/bmx055_magn.h rename to openpilot/sunnypilot/system/sensord/sensors/bmx055_magn.h diff --git a/sunnypilot/system/sensord/sensors/bmx055_temp.cc b/openpilot/sunnypilot/system/sensord/sensors/bmx055_temp.cc similarity index 100% rename from sunnypilot/system/sensord/sensors/bmx055_temp.cc rename to openpilot/sunnypilot/system/sensord/sensors/bmx055_temp.cc diff --git a/sunnypilot/system/sensord/sensors/bmx055_temp.h b/openpilot/sunnypilot/system/sensord/sensors/bmx055_temp.h similarity index 100% rename from sunnypilot/system/sensord/sensors/bmx055_temp.h rename to openpilot/sunnypilot/system/sensord/sensors/bmx055_temp.h diff --git a/sunnypilot/system/sensord/sensors/constants.h b/openpilot/sunnypilot/system/sensord/sensors/constants.h similarity index 100% rename from sunnypilot/system/sensord/sensors/constants.h rename to openpilot/sunnypilot/system/sensord/sensors/constants.h diff --git a/sunnypilot/system/sensord/sensors/i2c_sensor.cc b/openpilot/sunnypilot/system/sensord/sensors/i2c_sensor.cc similarity index 100% rename from sunnypilot/system/sensord/sensors/i2c_sensor.cc rename to openpilot/sunnypilot/system/sensord/sensors/i2c_sensor.cc diff --git a/sunnypilot/system/sensord/sensors/i2c_sensor.h b/openpilot/sunnypilot/system/sensord/sensors/i2c_sensor.h similarity index 100% rename from sunnypilot/system/sensord/sensors/i2c_sensor.h rename to openpilot/sunnypilot/system/sensord/sensors/i2c_sensor.h diff --git a/sunnypilot/system/sensord/sensors/lsm6ds3_accel.cc b/openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_accel.cc similarity index 100% rename from sunnypilot/system/sensord/sensors/lsm6ds3_accel.cc rename to openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_accel.cc diff --git a/sunnypilot/system/sensord/sensors/lsm6ds3_accel.h b/openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_accel.h similarity index 100% rename from sunnypilot/system/sensord/sensors/lsm6ds3_accel.h rename to openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_accel.h diff --git a/sunnypilot/system/sensord/sensors/lsm6ds3_gyro.cc b/openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_gyro.cc similarity index 100% rename from sunnypilot/system/sensord/sensors/lsm6ds3_gyro.cc rename to openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_gyro.cc diff --git a/sunnypilot/system/sensord/sensors/lsm6ds3_gyro.h b/openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_gyro.h similarity index 100% rename from sunnypilot/system/sensord/sensors/lsm6ds3_gyro.h rename to openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_gyro.h diff --git a/sunnypilot/system/sensord/sensors/lsm6ds3_temp.cc b/openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_temp.cc similarity index 100% rename from sunnypilot/system/sensord/sensors/lsm6ds3_temp.cc rename to openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_temp.cc diff --git a/sunnypilot/system/sensord/sensors/lsm6ds3_temp.h b/openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_temp.h similarity index 100% rename from sunnypilot/system/sensord/sensors/lsm6ds3_temp.h rename to openpilot/sunnypilot/system/sensord/sensors/lsm6ds3_temp.h diff --git a/sunnypilot/system/sensord/sensors/mmc5603nj_magn.cc b/openpilot/sunnypilot/system/sensord/sensors/mmc5603nj_magn.cc similarity index 100% rename from sunnypilot/system/sensord/sensors/mmc5603nj_magn.cc rename to openpilot/sunnypilot/system/sensord/sensors/mmc5603nj_magn.cc diff --git a/sunnypilot/system/sensord/sensors/mmc5603nj_magn.h b/openpilot/sunnypilot/system/sensord/sensors/mmc5603nj_magn.h similarity index 100% rename from sunnypilot/system/sensord/sensors/mmc5603nj_magn.h rename to openpilot/sunnypilot/system/sensord/sensors/mmc5603nj_magn.h diff --git a/sunnypilot/system/sensord/sensors/sensor.h b/openpilot/sunnypilot/system/sensord/sensors/sensor.h similarity index 100% rename from sunnypilot/system/sensord/sensors/sensor.h rename to openpilot/sunnypilot/system/sensord/sensors/sensor.h diff --git a/sunnypilot/system/sensord/sensors_qcom2.cc b/openpilot/sunnypilot/system/sensord/sensors_qcom2.cc similarity index 100% rename from sunnypilot/system/sensord/sensors_qcom2.cc rename to openpilot/sunnypilot/system/sensord/sensors_qcom2.cc diff --git a/sunnypilot/system/sensord/tests/test_sensord.py b/openpilot/sunnypilot/system/sensord/tests/test_sensord.py similarity index 98% rename from sunnypilot/system/sensord/tests/test_sensord.py rename to openpilot/sunnypilot/system/sensord/tests/test_sensord.py index 9e09930f0c..2513628019 100644 --- a/sunnypilot/system/sensord/tests/test_sensord.py +++ b/openpilot/sunnypilot/system/sensord/tests/test_sensord.py @@ -4,9 +4,9 @@ import time import numpy as np from collections import namedtuple, defaultdict -import cereal.messaging as messaging -from cereal import log -from cereal.services import SERVICE_LIST +import openpilot.cereal.messaging as messaging +from openpilot.cereal import log +from openpilot.cereal.services import SERVICE_LIST from openpilot.common.gpio import get_irqs_for_action from openpilot.common.timeout import Timeout from openpilot.common.hardware import HARDWARE diff --git a/sunnypilot/system/sensord/tests/ttff_test.py b/openpilot/sunnypilot/system/sensord/tests/ttff_test.py similarity index 96% rename from sunnypilot/system/sensord/tests/ttff_test.py rename to openpilot/sunnypilot/system/sensord/tests/ttff_test.py index a9cc16d707..cc8408055c 100755 --- a/sunnypilot/system/sensord/tests/ttff_test.py +++ b/openpilot/sunnypilot/system/sensord/tests/ttff_test.py @@ -3,7 +3,7 @@ import time import atexit -from cereal import messaging +from openpilot.cereal import messaging from openpilot.system.manager.process_config import managed_processes TIMEOUT = 10*60 diff --git a/system/statsd.py b/openpilot/sunnypilot/system/statsd.py similarity index 98% rename from system/statsd.py rename to openpilot/sunnypilot/system/statsd.py index 4b2e67caeb..ff77a5a57f 100755 --- a/system/statsd.py +++ b/openpilot/sunnypilot/system/statsd.py @@ -13,12 +13,12 @@ from datetime import datetime, UTC, date from typing import NoReturn from openpilot.common.params import Params -from cereal.messaging import SubMaster +from openpilot.cereal.messaging import SubMaster from openpilot.common.hardware.hw import Paths from openpilot.common.swaglog import cloudlog from openpilot.common.hardware import HARDWARE from openpilot.common.utils import atomic_write -from openpilot.system.version import get_build_metadata +from openpilot.common.version import get_build_metadata from openpilot.system.loggerd.config import STATS_DIR_FILE_LIMIT, STATS_SOCKET, STATS_FLUSH_TIME_S diff --git a/sunnypilot/system/updated/tests/test_sp_branch_migrations.py b/openpilot/sunnypilot/system/updated/tests/test_sp_branch_migrations.py similarity index 100% rename from sunnypilot/system/updated/tests/test_sp_branch_migrations.py rename to openpilot/sunnypilot/system/updated/tests/test_sp_branch_migrations.py diff --git a/sunnypilot/tools/__init__.py b/openpilot/sunnypilot/tools/__init__.py similarity index 100% rename from sunnypilot/tools/__init__.py rename to openpilot/sunnypilot/tools/__init__.py diff --git a/sunnypilot/tools/memory_profiler/__init__.py b/openpilot/sunnypilot/tools/memory_profiler/__init__.py similarity index 100% rename from sunnypilot/tools/memory_profiler/__init__.py rename to openpilot/sunnypilot/tools/memory_profiler/__init__.py diff --git a/sunnypilot/tools/memory_profiler/mem_usage.py b/openpilot/sunnypilot/tools/memory_profiler/mem_usage.py similarity index 100% rename from sunnypilot/tools/memory_profiler/mem_usage.py rename to openpilot/sunnypilot/tools/memory_profiler/mem_usage.py diff --git a/sunnypilot/tools/pull_footage.py b/openpilot/sunnypilot/tools/pull_footage.py similarity index 100% rename from sunnypilot/tools/pull_footage.py rename to openpilot/sunnypilot/tools/pull_footage.py diff --git a/openpilot/system/hardware/hardwared.py b/openpilot/system/hardware/hardwared.py index 165bdd6d16..f094be24c1 100755 --- a/openpilot/system/hardware/hardwared.py +++ b/openpilot/system/hardware/hardwared.py @@ -20,6 +20,7 @@ from openpilot.common.hardware.usb import get_usb_state, set_usb_state from openpilot.common.linux import LinuxSystemStats from openpilot.system.loggerd.config import get_available_percent from openpilot.common.swaglog import cloudlog +from openpilot.sunnypilot.system.statsd import statlog from openpilot.system.hardware.power_monitoring import PowerMonitoring from openpilot.system.hardware.fan_controller import FanController from openpilot.common.version import terms_version, training_version, get_build_metadata, terms_version_sp @@ -379,9 +380,11 @@ def hardware_thread(end_event, hw_queue) -> None: msg.deviceState.offroadPowerUsageUwh = power_monitor.get_power_used() msg.deviceState.carBatteryCapacityUwh = max(0, power_monitor.get_car_battery_capacity()) current_power_draw = HARDWARE.get_current_power_draw() + statlog.sample("power_draw", current_power_draw) msg.deviceState.powerDrawW = current_power_draw som_power_draw = HARDWARE.get_som_power_draw() + statlog.sample("som_power_draw", som_power_draw) msg.deviceState.somPowerDrawW = som_power_draw # Check if we need to shut down @@ -399,6 +402,23 @@ def hardware_thread(end_event, hw_queue) -> None: msg.deviceState.thermalStatus = thermal_status pm.send("deviceState", msg) + statlog.gauge("free_space_percent", msg.deviceState.freeSpacePercent) + statlog.gauge("gpu_usage_percent", msg.deviceState.gpuUsagePercent) + statlog.gauge("memory_usage_percent", msg.deviceState.memoryUsagePercent) + for i, usage in enumerate(msg.deviceState.cpuUsagePercent): + statlog.gauge(f"cpu{i}_usage_percent", usage) + for i, temp in enumerate(msg.deviceState.cpuTempC): + statlog.gauge(f"cpu{i}_temperature", temp) + for i, temp in enumerate(msg.deviceState.gpuTempC): + statlog.gauge(f"gpu{i}_temperature", temp) + statlog.gauge("memory_temperature", msg.deviceState.memoryTempC) + for i, temp in enumerate(msg.deviceState.pmicTempC): + statlog.gauge(f"pmic{i}_temperature", temp) + for i, temp in enumerate(last_hw_state.modem_temps): + statlog.gauge(f"modem_temperature{i}", temp) + statlog.gauge("fan_speed_percent_desired", msg.deviceState.fanSpeedPercentDesired) + statlog.gauge("screen_brightness_percent", msg.deviceState.screenBrightnessPercent) + # report to server once every 10 minutes, or every 1s when thermally blocked rising_edge_started = should_start and not should_start_prev status_packet_interval = 1. if show_alert else 600. diff --git a/openpilot/system/hardware/power_monitoring.py b/openpilot/system/hardware/power_monitoring.py index 0c26569731..ca3390b8f0 100644 --- a/openpilot/system/hardware/power_monitoring.py +++ b/openpilot/system/hardware/power_monitoring.py @@ -4,6 +4,7 @@ import threading from openpilot.common.params import Params from openpilot.common.hardware import HARDWARE from openpilot.common.swaglog import cloudlog +from openpilot.sunnypilot.system.statsd import statlog CAR_VOLTAGE_LOW_PASS_K = 0.011 # LPF gain for 45s tau (dt/tau / (dt/tau + 1)) @@ -49,6 +50,7 @@ class PowerMonitoring: # Low-pass battery voltage self.car_voltage_instant_mV = voltage self.car_voltage_mV = ((voltage * CAR_VOLTAGE_LOW_PASS_K) + (self.car_voltage_mV * (1 - CAR_VOLTAGE_LOW_PASS_K))) + statlog.gauge("car_voltage", self.car_voltage_mV / 1e3) # Cap the car battery power and save it in a param every 10-ish seconds self.car_battery_capacity_uWh = max(self.car_battery_capacity_uWh, 0) diff --git a/openpilot/system/manager/process_config.py b/openpilot/system/manager/process_config.py index 655d1c4e29..ec951dfe6a 100644 --- a/openpilot/system/manager/process_config.py +++ b/openpilot/system/manager/process_config.py @@ -3,9 +3,16 @@ import operator import platform from opendbc.car.structs import car +from openpilot.cereal import custom from openpilot.common.params import Params from openpilot.common.hardware import PC, TICI from openpilot.system.manager.process import PythonProcess, NativeProcess, DaemonProcess +from openpilot.common.hardware.hw import Paths + +from openpilot.sunnypilot.mapd.mapd_manager import MAPD_PATH + +from openpilot.sunnypilot.models.helpers import get_active_model_runner +from openpilot.sunnypilot.sunnylink.utils import sunnylink_need_register, sunnylink_ready, use_sunnylink_uploader WEBCAM = os.getenv("USE_WEBCAM") is not None @@ -61,6 +68,42 @@ def only_offroad(started: bool, params: Params, CP: car.CarParams) -> bool: def livestream(started: bool, params: Params, CP: car.CarParams) -> bool: return params.get_bool("IsLiveStreaming") +def use_github_runner(started, params, CP: car.CarParams) -> bool: + return not PC and params.get_bool("EnableGithubRunner") and ( + not params.get_bool("NetworkMetered") and not params.get_bool("GithubRunnerSufficientVoltage")) + +def use_copyparty(started, params, CP: car.CarParams) -> bool: + return bool(params.get_bool("EnableCopyparty")) + +def sunnylink_ready_shim(started, params, CP: car.CarParams) -> bool: + """Shim for sunnylink_ready to match the process manager signature.""" + return sunnylink_ready(params) + +def sunnylink_need_register_shim(started, params, CP: car.CarParams) -> bool: + """Shim for sunnylink_need_register to match the process manager signature.""" + return sunnylink_need_register(params) + +def use_sunnylink_uploader_shim(started, params, CP: car.CarParams) -> bool: + """Shim for use_sunnylink_uploader to match the process manager signature.""" + return use_sunnylink_uploader(params) + +def is_tinygrad_model(started, params, CP: car.CarParams) -> bool: + """Check if the active model runner is SNPE.""" + return bool(get_active_model_runner(params, not started) == custom.ModelManagerSP.Runner.tinygrad) + +def is_stock_model(started, params, CP: car.CarParams) -> bool: + """Check if the active model runner is stock.""" + return bool(get_active_model_runner(params, not started) == custom.ModelManagerSP.Runner.stock) + +def mapd_ready(started: bool, params: Params, CP: car.CarParams) -> bool: + return bool(os.path.exists(Paths.mapd_root())) + +def uploader_ready(started: bool, params: Params, CP: car.CarParams) -> bool: + if not params.get_bool("OnroadUploads"): + return only_offroad(started, params, CP) + + return always_run(started, params, CP) + def or_(*fns): return lambda *args: operator.or_(*(fn(*args) for fn in fns)) @@ -85,7 +128,7 @@ procs = [ PythonProcess("micd", "openpilot.system.micd", iscar), PythonProcess("timed", "openpilot.system.timed", always_run, enabled=not PC), - PythonProcess("modeld", "openpilot.selfdrive.modeld.modeld", only_onroad), + PythonProcess("modeld", "openpilot.selfdrive.modeld.modeld", and_(only_onroad, is_stock_model)), PythonProcess("dmonitoringmodeld", "openpilot.selfdrive.modeld.dmonitoringmodeld", driverview, enabled=(WEBCAM or not PC)), PythonProcess("sensord", "openpilot.system.sensord.sensord", only_onroad, enabled=not PC), @@ -115,13 +158,53 @@ procs = [ PythonProcess("modem", "openpilot.common.hardware.tici.modem", always_run, enabled=TICI), PythonProcess("tombstoned", "openpilot.system.tombstoned", always_run, enabled=not PC), PythonProcess("updated", "openpilot.system.updated.updated", only_offroad, enabled=not PC), - PythonProcess("uploader", "openpilot.system.loggerd.uploader", always_run), + PythonProcess("uploader", "openpilot.system.loggerd.uploader", uploader_ready), + PythonProcess("statsd", "openpilot.sunnypilot.system.statsd", always_run), PythonProcess("feedbackd", "openpilot.selfdrive.ui.feedback.feedbackd", only_onroad), # debug procs NativeProcess("bridge", "openpilot/cereal/messaging", ["./bridge"], notcar), PythonProcess("webrtcd", "openpilot.system.webrtc.webrtcd", or_(and_(livestream, not_(iscar)), notcar)), PythonProcess("joystick", "openpilot.tools.joystick.joystick_control", and_(joystick, iscar)), + + # sunnylink <3 + DaemonProcess("manage_sunnylinkd", "openpilot.sunnypilot.sunnylink.athena.manage_sunnylinkd", "SunnylinkdPid"), + PythonProcess("sunnylink_registration_manager", "openpilot.sunnypilot.sunnylink.registration_manager", sunnylink_need_register_shim), + PythonProcess("statsd_sp", "openpilot.sunnypilot.sunnylink.statsd", and_(always_run, sunnylink_ready_shim)), ] +# sunnypilot +procs += [ + # Models + PythonProcess("models_manager", "openpilot.sunnypilot.models.manager", only_offroad), + NativeProcess("modeld_tinygrad", "openpilot/sunnypilot/modeld_v2", ["./modeld"], and_(only_onroad, is_tinygrad_model)), + + # Backup + PythonProcess("backup_manager", "openpilot.sunnypilot.sunnylink.backups.manager", and_(only_offroad, sunnylink_ready_shim)), + + # mapd + NativeProcess("mapd", Paths.mapd_root(), ["bash", "-c", f"{MAPD_PATH} > /dev/null 2>&1"], mapd_ready), + PythonProcess("mapd_manager", "openpilot.sunnypilot.mapd.mapd_manager", always_run), + + # locationd + NativeProcess("locationd_llk", "openpilot/sunnypilot/selfdrive/locationd", ["./locationd"], only_onroad), +] + +if os.path.exists("./github_runner.sh"): + procs += [NativeProcess("github_runner_start", "openpilot/system/manager", ["./github_runner.sh", "start"], and_(only_offroad, use_github_runner), sigkill=False)] + +if os.path.exists("../../sunnypilot/sunnylink/uploader.py"): + procs += [PythonProcess("sunnylink_uploader", "openpilot.sunnypilot.sunnylink.uploader", use_sunnylink_uploader_shim)] + +if os.path.exists("../../third_party/copyparty/copyparty-sfx.py"): + sunnypilot_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) + copyparty_args = [f"-v{Paths.crash_log_root()}:/swaglogs:r"] + copyparty_args += [f"-v{Paths.log_root()}:/routes:r"] + copyparty_args += [f"-v{Paths.model_root()}:/models:rw"] + copyparty_args += [f"-v{sunnypilot_root}:/sunnypilot:rw"] + copyparty_args += ["-p8080"] + copyparty_args += ["-z"] + copyparty_args += ["-q"] + procs += [NativeProcess("copyparty-sfx", "openpilot/third_party/copyparty", ["./copyparty-sfx.py", *copyparty_args], and_(only_offroad, use_copyparty))] + managed_processes = {p.name: p for p in procs} diff --git a/system/ui/sunnypilot/lib/application.py b/openpilot/system/ui/sunnypilot/lib/application.py similarity index 100% rename from system/ui/sunnypilot/lib/application.py rename to openpilot/system/ui/sunnypilot/lib/application.py diff --git a/system/ui/sunnypilot/lib/styles.py b/openpilot/system/ui/sunnypilot/lib/styles.py similarity index 100% rename from system/ui/sunnypilot/lib/styles.py rename to openpilot/system/ui/sunnypilot/lib/styles.py diff --git a/system/ui/sunnypilot/lib/utils.py b/openpilot/system/ui/sunnypilot/lib/utils.py similarity index 100% rename from system/ui/sunnypilot/lib/utils.py rename to openpilot/system/ui/sunnypilot/lib/utils.py diff --git a/system/ui/sunnypilot/widgets/__init__.py b/openpilot/system/ui/sunnypilot/widgets/__init__.py similarity index 100% rename from system/ui/sunnypilot/widgets/__init__.py rename to openpilot/system/ui/sunnypilot/widgets/__init__.py diff --git a/system/ui/sunnypilot/widgets/helpers/__init__.py b/openpilot/system/ui/sunnypilot/widgets/helpers/__init__.py similarity index 100% rename from system/ui/sunnypilot/widgets/helpers/__init__.py rename to openpilot/system/ui/sunnypilot/widgets/helpers/__init__.py diff --git a/system/ui/sunnypilot/widgets/helpers/fuzzy_search.py b/openpilot/system/ui/sunnypilot/widgets/helpers/fuzzy_search.py similarity index 100% rename from system/ui/sunnypilot/widgets/helpers/fuzzy_search.py rename to openpilot/system/ui/sunnypilot/widgets/helpers/fuzzy_search.py diff --git a/system/ui/sunnypilot/widgets/helpers/star_icon.py b/openpilot/system/ui/sunnypilot/widgets/helpers/star_icon.py similarity index 100% rename from system/ui/sunnypilot/widgets/helpers/star_icon.py rename to openpilot/system/ui/sunnypilot/widgets/helpers/star_icon.py diff --git a/system/ui/sunnypilot/widgets/html_render.py b/openpilot/system/ui/sunnypilot/widgets/html_render.py similarity index 100% rename from system/ui/sunnypilot/widgets/html_render.py rename to openpilot/system/ui/sunnypilot/widgets/html_render.py diff --git a/system/ui/sunnypilot/widgets/input_dialog.py b/openpilot/system/ui/sunnypilot/widgets/input_dialog.py similarity index 100% rename from system/ui/sunnypilot/widgets/input_dialog.py rename to openpilot/system/ui/sunnypilot/widgets/input_dialog.py diff --git a/system/ui/sunnypilot/widgets/list_view.py b/openpilot/system/ui/sunnypilot/widgets/list_view.py similarity index 100% rename from system/ui/sunnypilot/widgets/list_view.py rename to openpilot/system/ui/sunnypilot/widgets/list_view.py diff --git a/system/ui/sunnypilot/widgets/option_control.py b/openpilot/system/ui/sunnypilot/widgets/option_control.py similarity index 100% rename from system/ui/sunnypilot/widgets/option_control.py rename to openpilot/system/ui/sunnypilot/widgets/option_control.py diff --git a/system/ui/sunnypilot/widgets/progress_bar.py b/openpilot/system/ui/sunnypilot/widgets/progress_bar.py similarity index 100% rename from system/ui/sunnypilot/widgets/progress_bar.py rename to openpilot/system/ui/sunnypilot/widgets/progress_bar.py diff --git a/system/ui/sunnypilot/widgets/sunnylink_pairing_dialog.py b/openpilot/system/ui/sunnypilot/widgets/sunnylink_pairing_dialog.py similarity index 100% rename from system/ui/sunnypilot/widgets/sunnylink_pairing_dialog.py rename to openpilot/system/ui/sunnypilot/widgets/sunnylink_pairing_dialog.py diff --git a/system/ui/sunnypilot/widgets/toggle.py b/openpilot/system/ui/sunnypilot/widgets/toggle.py similarity index 100% rename from system/ui/sunnypilot/widgets/toggle.py rename to openpilot/system/ui/sunnypilot/widgets/toggle.py diff --git a/system/ui/sunnypilot/widgets/tree_dialog.py b/openpilot/system/ui/sunnypilot/widgets/tree_dialog.py similarity index 100% rename from system/ui/sunnypilot/widgets/tree_dialog.py rename to openpilot/system/ui/sunnypilot/widgets/tree_dialog.py diff --git a/third_party/copyparty/copyparty-sfx.py b/openpilot/third_party/copyparty/copyparty-sfx.py similarity index 100% rename from third_party/copyparty/copyparty-sfx.py rename to openpilot/third_party/copyparty/copyparty-sfx.py diff --git a/third_party/mapd_pfeiferj/README.md b/openpilot/third_party/mapd_pfeiferj/README.md similarity index 100% rename from third_party/mapd_pfeiferj/README.md rename to openpilot/third_party/mapd_pfeiferj/README.md diff --git a/third_party/mapd_pfeiferj/mapd b/openpilot/third_party/mapd_pfeiferj/mapd similarity index 100% rename from third_party/mapd_pfeiferj/mapd rename to openpilot/third_party/mapd_pfeiferj/mapd diff --git a/panda b/panda index d994e8e800..9379184e70 160000 --- a/panda +++ b/panda @@ -1 +1 @@ -Subproject commit d994e8e8009d934a94c3a94c863b559118353bdd +Subproject commit 9379184e708ecd06efae743c0fc366b4e1fe72e7 diff --git a/sunnypilot/selfdrive/car/car_list.json b/sunnypilot/selfdrive/car/car_list.json deleted file mode 120000 index a4ae7b75f9..0000000000 --- a/sunnypilot/selfdrive/car/car_list.json +++ /dev/null @@ -1 +0,0 @@ -../../../opendbc_repo/opendbc/sunnypilot/car/car_list.json \ No newline at end of file diff --git a/system/manager/process_config.py b/system/manager/process_config.py deleted file mode 100644 index 510395b93b..0000000000 --- a/system/manager/process_config.py +++ /dev/null @@ -1,209 +0,0 @@ -import os -import operator -import platform - -from cereal import car, custom -from openpilot.common.params import Params -from openpilot.common.hardware import PC, TICI -from openpilot.system.manager.process import PythonProcess, NativeProcess, DaemonProcess -from openpilot.common.hardware.hw import Paths - -from openpilot.sunnypilot.mapd.mapd_manager import MAPD_PATH - -from openpilot.sunnypilot.models.helpers import get_active_model_runner -from openpilot.sunnypilot.sunnylink.utils import sunnylink_need_register, sunnylink_ready, use_sunnylink_uploader - -WEBCAM = os.getenv("USE_WEBCAM") is not None - -def driverview(started: bool, params: Params, CP: car.CarParams) -> bool: - return started or params.get_bool("IsDriverViewEnabled") - -def notcar(started: bool, params: Params, CP: car.CarParams) -> bool: - return started and CP.notCar - -def iscar(started: bool, params: Params, CP: car.CarParams) -> bool: - return started and not CP.notCar - -def logging(started: bool, params: Params, CP: car.CarParams) -> bool: - run = (not CP.notCar) or not params.get_bool("DisableLogging") - return started and run - -def ublox_available() -> bool: - return os.path.exists('/dev/ttyHS0') and not os.path.exists('/persist/comma/use-quectel-gps') - -def ublox(started: bool, params: Params, CP: car.CarParams) -> bool: - use_ublox = ublox_available() - if use_ublox != params.get_bool("UbloxAvailable"): - params.put_bool("UbloxAvailable", use_ublox, block=True) - return started and use_ublox - -def joystick(started: bool, params: Params, CP: car.CarParams) -> bool: - return started and params.get_bool("JoystickDebugMode") - -def not_joystick(started: bool, params: Params, CP: car.CarParams) -> bool: - return started and not params.get_bool("JoystickDebugMode") - -def long_maneuver(started: bool, params: Params, CP: car.CarParams) -> bool: - return started and params.get_bool("LongitudinalManeuverMode") - -def lat_maneuver(started: bool, params: Params, CP: car.CarParams) -> bool: - return started and params.get_bool("LateralManeuverMode") - -def not_long_maneuver(started: bool, params: Params, CP: car.CarParams) -> bool: - return started and not params.get_bool("LongitudinalManeuverMode") - -def qcomgps(started: bool, params: Params, CP: car.CarParams) -> bool: - return started and not ublox_available() - -def always_run(started: bool, params: Params, CP: car.CarParams) -> bool: - return True - -def only_onroad(started: bool, params: Params, CP: car.CarParams) -> bool: - return started - -def only_offroad(started: bool, params: Params, CP: car.CarParams) -> bool: - return not started - -def livestream(started: bool, params: Params, CP: car.CarParams) -> bool: - return params.get_bool("IsLiveStreaming") - -def use_github_runner(started, params, CP: car.CarParams) -> bool: - return not PC and params.get_bool("EnableGithubRunner") and ( - not params.get_bool("NetworkMetered") and not params.get_bool("GithubRunnerSufficientVoltage")) - -def use_copyparty(started, params, CP: car.CarParams) -> bool: - return bool(params.get_bool("EnableCopyparty")) - -def sunnylink_ready_shim(started, params, CP: car.CarParams) -> bool: - """Shim for sunnylink_ready to match the process manager signature.""" - return sunnylink_ready(params) - -def sunnylink_need_register_shim(started, params, CP: car.CarParams) -> bool: - """Shim for sunnylink_need_register to match the process manager signature.""" - return sunnylink_need_register(params) - -def use_sunnylink_uploader_shim(started, params, CP: car.CarParams) -> bool: - """Shim for use_sunnylink_uploader to match the process manager signature.""" - return use_sunnylink_uploader(params) - -def is_tinygrad_model(started, params, CP: car.CarParams) -> bool: - """Check if the active model runner is SNPE.""" - return bool(get_active_model_runner(params, not started) == custom.ModelManagerSP.Runner.tinygrad) - -def is_stock_model(started, params, CP: car.CarParams) -> bool: - """Check if the active model runner is stock.""" - return bool(get_active_model_runner(params, not started) == custom.ModelManagerSP.Runner.stock) - -def mapd_ready(started: bool, params: Params, CP: car.CarParams) -> bool: - return bool(os.path.exists(Paths.mapd_root())) - -def uploader_ready(started: bool, params: Params, CP: car.CarParams) -> bool: - if not params.get_bool("OnroadUploads"): - return only_offroad(started, params, CP) - - return always_run(started, params, CP) - -def or_(*fns): - return lambda *args: operator.or_(*(fn(*args) for fn in fns)) - -def and_(*fns): - return lambda *args: operator.and_(*(fn(*args) for fn in fns)) - -def not_(*fns): - return lambda *args: operator.not_(*(fn(*args) for fn in fns)) - -procs = [ - DaemonProcess("manage_athenad", "system.athena.manage_athenad", "AthenadPid"), - - NativeProcess("loggerd", "system/loggerd", ["./loggerd"], logging), - NativeProcess("encoderd", "system/loggerd", ["./encoderd"], only_onroad), - NativeProcess("stream_encoderd", "system/loggerd", ["./encoderd", "--stream"], or_(and_(livestream, not_(iscar)), notcar)), - PythonProcess("logmessaged", "system.logmessaged", always_run), - - NativeProcess("camerad", "system/camerad", ["./camerad"], or_(driverview, livestream), enabled=not WEBCAM), - PythonProcess("webcamerad", "system.camerad.webcam.camerad", driverview, enabled=WEBCAM), - PythonProcess("proclogd", "system.proclogd", only_onroad, enabled=platform.system() != "Darwin"), - PythonProcess("journald", "system.journald", only_onroad, platform.system() != "Darwin"), - PythonProcess("micd", "system.micd", iscar), - PythonProcess("timed", "system.timed", always_run, enabled=not PC), - - PythonProcess("modeld", "selfdrive.modeld.modeld", and_(only_onroad, is_stock_model)), - PythonProcess("dmonitoringmodeld", "selfdrive.modeld.dmonitoringmodeld", driverview, enabled=(WEBCAM or not PC)), - - PythonProcess("sensord", "system.sensord.sensord", only_onroad, enabled=not PC), - PythonProcess("ui", "selfdrive.ui.ui", always_run, restart_if_crash=True), - PythonProcess("soundd", "selfdrive.ui.soundd", driverview), - PythonProcess("locationd", "selfdrive.locationd.locationd", only_onroad), - NativeProcess("_pandad", "selfdrive/pandad", ["./pandad"], always_run, enabled=False), - PythonProcess("calibrationd", "selfdrive.locationd.calibrationd", only_onroad), - PythonProcess("torqued", "selfdrive.locationd.torqued", only_onroad), - PythonProcess("controlsd", "selfdrive.controls.controlsd", and_(not_joystick, iscar)), - PythonProcess("joystickd", "tools.joystick.joystickd", or_(joystick, notcar)), - PythonProcess("selfdrived", "selfdrive.selfdrived.selfdrived", only_onroad), - PythonProcess("card", "selfdrive.car.card", only_onroad), - PythonProcess("deleter", "system.loggerd.deleter", always_run), - PythonProcess("dmonitoringd", "selfdrive.monitoring.dmonitoringd", driverview, enabled=(WEBCAM or not PC)), - PythonProcess("qcomgpsd", "system.qcomgpsd.qcomgpsd", qcomgps, enabled=TICI), - PythonProcess("pandad", "selfdrive.pandad.pandad", always_run), - PythonProcess("paramsd", "selfdrive.locationd.paramsd", only_onroad), - PythonProcess("lagd", "selfdrive.locationd.lagd", only_onroad), - PythonProcess("ubloxd", "system.ubloxd.ubloxd", ublox, enabled=TICI), - PythonProcess("pigeond", "system.ubloxd.pigeond", ublox, enabled=TICI), - PythonProcess("plannerd", "selfdrive.controls.plannerd", not_long_maneuver), - PythonProcess("maneuversd", "tools.longitudinal_maneuvers.maneuversd", long_maneuver), - PythonProcess("lateral_maneuversd", "tools.lateral_maneuvers.lateral_maneuversd", lat_maneuver), - PythonProcess("radard", "selfdrive.controls.radard", only_onroad), - PythonProcess("hardwared", "system.hardware.hardwared", always_run), - PythonProcess("modem", "common.hardware.tici.modem", always_run, enabled=TICI), - PythonProcess("tombstoned", "system.tombstoned", always_run, enabled=not PC), - PythonProcess("updated", "system.updated.updated", only_offroad, enabled=not PC), - PythonProcess("uploader", "system.loggerd.uploader", uploader_ready), - PythonProcess("statsd", "system.statsd", always_run), - PythonProcess("feedbackd", "selfdrive.ui.feedback.feedbackd", only_onroad), - - # debug procs - NativeProcess("bridge", "cereal/messaging", ["./bridge"], notcar), - PythonProcess("webrtcd", "system.webrtc.webrtcd", or_(and_(livestream, not_(iscar)), notcar)), - PythonProcess("joystick", "tools.joystick.joystick_control", and_(joystick, iscar)), - - # sunnylink <3 - DaemonProcess("manage_sunnylinkd", "sunnypilot.sunnylink.athena.manage_sunnylinkd", "SunnylinkdPid"), - PythonProcess("sunnylink_registration_manager", "sunnypilot.sunnylink.registration_manager", sunnylink_need_register_shim), - PythonProcess("statsd_sp", "sunnypilot.sunnylink.statsd", and_(always_run, sunnylink_ready_shim)), -] - -# sunnypilot -procs += [ - # Models - PythonProcess("models_manager", "sunnypilot.models.manager", only_offroad), - NativeProcess("modeld_tinygrad", "sunnypilot/modeld_v2", ["./modeld"], and_(only_onroad, is_tinygrad_model)), - - # Backup - PythonProcess("backup_manager", "sunnypilot.sunnylink.backups.manager", and_(only_offroad, sunnylink_ready_shim)), - - # mapd - NativeProcess("mapd", Paths.mapd_root(), ["bash", "-c", f"{MAPD_PATH} > /dev/null 2>&1"], mapd_ready), - PythonProcess("mapd_manager", "sunnypilot.mapd.mapd_manager", always_run), - - # locationd - NativeProcess("locationd_llk", "sunnypilot/selfdrive/locationd", ["./locationd"], only_onroad), -] - -if os.path.exists("./github_runner.sh"): - procs += [NativeProcess("github_runner_start", "system/manager", ["./github_runner.sh", "start"], and_(only_offroad, use_github_runner), sigkill=False)] - -if os.path.exists("../../sunnypilot/sunnylink/uploader.py"): - procs += [PythonProcess("sunnylink_uploader", "sunnypilot.sunnylink.uploader", use_sunnylink_uploader_shim)] - -if os.path.exists("../../third_party/copyparty/copyparty-sfx.py"): - sunnypilot_root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..")) - copyparty_args = [f"-v{Paths.crash_log_root()}:/swaglogs:r"] - copyparty_args += [f"-v{Paths.log_root()}:/routes:r"] - copyparty_args += [f"-v{Paths.model_root()}:/models:rw"] - copyparty_args += [f"-v{sunnypilot_root}:/sunnypilot:rw"] - copyparty_args += ["-p8080"] - copyparty_args += ["-z"] - copyparty_args += ["-q"] - procs += [NativeProcess("copyparty-sfx", "third_party/copyparty", ["./copyparty-sfx.py", *copyparty_args], and_(only_offroad, use_copyparty))] - -managed_processes = {p.name: p for p in procs} diff --git a/uv.lock b/uv.lock index 2284243b55..ef8bbf19b7 100644 --- a/uv.lock +++ b/uv.lock @@ -1043,7 +1043,7 @@ requires-dist = [ { name = "gcc-arm-none-eabi", marker = "extra == 'dev'", git = "https://github.com/commaai/dependencies.git?subdirectory=gcc-arm-none-eabi&rev=release-gcc-arm-none-eabi" }, { name = "libusb-package" }, { name = "libusb1" }, - { name = "opendbc", git = "https://github.com/commaai/opendbc.git?rev=master" }, + { name = "opendbc", git = "https://github.com/sunnypilot/opendbc.git?rev=master" }, { name = "pycryptodome", marker = "extra == 'dev'", specifier = ">=3.9.8" }, { name = "pytest", marker = "extra == 'dev'" }, { name = "pytest-mock", marker = "extra == 'dev'" }, @@ -1310,7 +1310,7 @@ wheels = [ [[package]] name = "pytest-xdist" -version = "3.7.1.dev24+g2b4372bd6" +version = "3.7.1.dev24+g2b4372b" source = { git = "https://github.com/sshane/pytest-xdist?rev=2b4372bd62699fb412c4fe2f95bf9f01bd2018da#2b4372bd62699fb412c4fe2f95bf9f01bd2018da" } dependencies = [ { name = "execnet" }, @@ -1586,7 +1586,7 @@ provides-extras = ["dev"] [[package]] name = "tinygrad" -version = "0.13.0" +version = "0.12.0" source = { editable = "tinygrad_repo" } [package.metadata] @@ -1633,7 +1633,6 @@ requires-dist = [ { name = "tiktoken", marker = "extra == 'testing'" }, { name = "tinygrad", extras = ["testing-minimal"], marker = "extra == 'testing-unit'" }, { name = "tinygrad", extras = ["testing-unit"], marker = "extra == 'testing'" }, - { name = "tinymesa", marker = "extra == 'mesa'", specifier = "==25.2.7.2" }, { name = "torch", marker = "extra == 'testing-minimal'", specifier = "==2.9.1" }, { name = "tqdm", marker = "extra == 'testing-unit'" }, { name = "transformers", marker = "extra == 'testing'" }, @@ -1641,7 +1640,7 @@ requires-dist = [ { name = "typing-extensions", marker = "extra == 'linting'" }, { name = "z3-solver", marker = "extra == 'testing-minimal'", specifier = "<4.15.4" }, ] -provides-extras = ["linting", "testing-minimal", "testing-unit", "testing", "docs", "mesa"] +provides-extras = ["linting", "testing-minimal", "testing-unit", "testing", "docs"] [[package]] name = "tomli"