diff --git a/selfdrive/car/modules/ALCA_module.py b/selfdrive/car/modules/ALCA_module.py index 63e5dd333dc5e0..b2238a39342671 100644 --- a/selfdrive/car/modules/ALCA_module.py +++ b/selfdrive/car/modules/ALCA_module.py @@ -47,7 +47,7 @@ from common.numpy_fast import interp,clip from selfdrive.controls.lib.pid import PIController from common.realtime import sec_since_boot -from selfdrive.services import service_list +from cereal.services import service_list import selfdrive.messaging as messaging import numpy as np from cereal import tesla diff --git a/selfdrive/car/modules/GYRO_module.py b/selfdrive/car/modules/GYRO_module.py index 8e7ae580f503e5..a4d34cf691d060 100644 --- a/selfdrive/car/modules/GYRO_module.py +++ b/selfdrive/car/modules/GYRO_module.py @@ -1,4 +1,4 @@ -from selfdrive.services import service_list +from cereal.services import service_list from collections import deque import selfdrive.messaging as messaging import cereal diff --git a/selfdrive/car/tesla/carcontroller.py b/selfdrive/car/tesla/carcontroller.py index 3c1276fc014f7d..e68859dff9a705 100644 --- a/selfdrive/car/tesla/carcontroller.py +++ b/selfdrive/car/tesla/carcontroller.py @@ -8,7 +8,7 @@ from selfdrive.car.tesla.blinker_module import Blinker from selfdrive.car.tesla.speed_utils.fleet_speed import FleetSpeed from selfdrive.car.tesla.values import AH, CM -from selfdrive.can.packer import CANPacker +from opendbc.can.packer import CANPacker from selfdrive.config import Conversions as CV from selfdrive.car.modules.ALCA_module import ALCAController from selfdrive.car.modules.GYRO_module import GYROController diff --git a/selfdrive/car/tesla/carstate.py b/selfdrive/car/tesla/carstate.py index 5ea34d663da11b..a9fce760145698 100644 --- a/selfdrive/car/tesla/carstate.py +++ b/selfdrive/car/tesla/carstate.py @@ -1,5 +1,5 @@ from common.kalman.simple_kalman import KF1D -from selfdrive.can.parser import CANParser +from opendbc.can.parser import CANParser from selfdrive.config import Conversions as CV from selfdrive.car.tesla.ACC_module import ACCMode from selfdrive.car.tesla.PCC_module import PCCModes diff --git a/selfdrive/car/tesla/interface.py b/selfdrive/car/tesla/interface.py index a9ca80a4b669db..887913151692e1 100644 --- a/selfdrive/car/tesla/interface.py +++ b/selfdrive/car/tesla/interface.py @@ -11,7 +11,7 @@ from selfdrive.car import STD_CARGO_KG from selfdrive.car.tesla.readconfig import CarSettings import selfdrive.messaging as messaging -from selfdrive.services import service_list +from cereal.services import service_list from selfdrive.controls.lib.planner import _A_CRUISE_MAX_V A_ACC_MAX = max(_A_CRUISE_MAX_V) diff --git a/selfdrive/car/tesla/radar_interface.py b/selfdrive/car/tesla/radar_interface.py index d003c238fdd865..ee1507e594fb99 100644 --- a/selfdrive/car/tesla/radar_interface.py +++ b/selfdrive/car/tesla/radar_interface.py @@ -4,7 +4,7 @@ from cereal import car, tesla from selfdrive.can.parser import CANParser from common.realtime import DT_RDR -from selfdrive.services import service_list +from cereal.services import service_list import selfdrive.messaging as messaging from selfdrive.car.interfaces import RadarInterfaceBase from selfdrive.car.tesla.readconfig import CarSettings diff --git a/selfdrive/car/tesla/radar_tools/calibrateRadar.py b/selfdrive/car/tesla/radar_tools/calibrateRadar.py index 9f8c660df45443..7276b165bf9c45 100644 --- a/selfdrive/car/tesla/radar_tools/calibrateRadar.py +++ b/selfdrive/car/tesla/radar_tools/calibrateRadar.py @@ -10,7 +10,7 @@ import os from selfdrive.can.parser import CANParser from common.realtime import sec_since_boot -from selfdrive.services import service_list +from cereal.services import service_list import selfdrive.messaging as messaging from selfdrive.car.tesla.readconfig import read_config_file,CarSettings from selfdrive.car.tesla.radar_interface import RadarInterface diff --git a/selfdrive/car/toyota/carcontroller.py b/selfdrive/car/toyota/carcontroller.py index fdbdfb41bcd833..2a89548c182dbb 100644 --- a/selfdrive/car/toyota/carcontroller.py +++ b/selfdrive/car/toyota/carcontroller.py @@ -51,20 +51,13 @@ def __init__(self, dbc_name, CP, VM): self.alert_active = False self.last_standstill = False self.standstill_req = False - + self.last_fault_frame = -200 self.steer_rate_limited = False self.fake_ecus = set() -<<<<<<< HEAD - if enable_camera: self.fake_ecus.add(ECU.CAM) - if enable_dsu: self.fake_ecus.add(ECU.DSU) - if enable_apg: self.fake_ecus.add(ECU.APGS) - self.ALCA = ALCAController(self,True,False) # Enabled True and SteerByAngle only False -======= if CP.enableCamera: self.fake_ecus.add(Ecu.fwdCamera) if CP.enableDsu: self.fake_ecus.add(Ecu.dsu) ->>>>>>> cc6358d983479e918d8deac95554c39ed5866e1a self.packer = CANPacker(dbc_name) @@ -97,16 +90,9 @@ def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd, hud_alert, if (frame % 10 == 0): self.ALCA.update_status(CS.cstm_btns.get_button_status("alca") > 0) # steer torque -<<<<<<< HEAD - alca_angle, alca_steer, alca_enabled, turn_signal_needed = self.ALCA.update(enabled, CS, frame, actuators) - apply_steer = int(round(alca_steer * SteerLimitParams.STEER_MAX)) - - apply_steer = apply_toyota_steer_torque_limits(apply_steer, self.last_steer, CS.steer_torque_motor, SteerLimitParams) -======= new_steer = int(round(actuators.steer * SteerLimitParams.STEER_MAX)) apply_steer = apply_toyota_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, SteerLimitParams) self.steer_rate_limited = new_steer != apply_steer ->>>>>>> cc6358d983479e918d8deac95554c39ed5866e1a # only cut torque when steer state is a known fault if CS.steer_state in [9, 25]: @@ -119,31 +105,6 @@ def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd, hud_alert, else: apply_steer_req = 1 -<<<<<<< HEAD - self.steer_angle_enabled, self.ipas_reset_counter = \ - ipas_state_transition(self.steer_angle_enabled, enabled, CS.ipas_active, self.ipas_reset_counter) - #print("{0} {1} {2}".format(self.steer_angle_enabled, self.ipas_reset_counter, CS.ipas_active)) - - - # steer angle - if self.steer_angle_enabled and CS.ipas_active: - - apply_angle = alca_angle - angle_lim = interp(CS.v_ego, ANGLE_MAX_BP, ANGLE_MAX_V) - apply_angle = clip(apply_angle, -angle_lim, angle_lim) - - # windup slower - if self.last_angle * apply_angle > 0. and abs(apply_angle) > abs(self.last_angle): - angle_rate_lim = interp(CS.v_ego, ANGLE_DELTA_BP, ANGLE_DELTA_V) - else: - angle_rate_lim = interp(CS.v_ego, ANGLE_DELTA_BP, ANGLE_DELTA_VU) - - apply_angle = clip(apply_angle, self.last_angle - angle_rate_lim, self.last_angle + angle_rate_lim) - else: - apply_angle = CS.angle_steers - -======= ->>>>>>> cc6358d983479e918d8deac95554c39ed5866e1a if not enabled and CS.pcm_acc_status: # send pcm acc cancel cmd if drive is disabled but pcm is still on, or if the system can't be activated pcm_cancel_cmd = 1 diff --git a/selfdrive/ui/Makefile b/selfdrive/ui/Makefile deleted file mode 100644 index 0d47649c47fc24..00000000000000 --- a/selfdrive/ui/Makefile +++ /dev/null @@ -1,127 +0,0 @@ -CC = clang -CXX = clang++ - -BASEDIR = ../.. -PHONELIBS = ../../phonelibs - -WARN_FLAGS = -Werror=implicit-function-declaration \ - -Werror=incompatible-pointer-types \ - -Werror=int-conversion \ - -Werror=return-type \ - -Werror=format-extra-args - -CFLAGS = -std=gnu11 -fPIC -O2 $(WARN_FLAGS) -CXXFLAGS = -std=c++11 -fPIC -O2 $(WARN_FLAGS) - -ZMQ_LIBS = -l:libczmq.a - -MESSAGING_FLAGS = -I$(BASEDIR)/selfdrive/messaging -MESSAGING_LIBS = $(BASEDIR)/selfdrive/messaging/messaging.a - -CEREAL_LIBS = -l:libcapn.a -CEREAL_OBJS = ../../cereal/gen/c/log.capnp.o ../../cereal/gen/c/ui.capnp.o - -NANOVG_FLAGS = -I$(PHONELIBS)/nanovg -JSON_FLAGS = -I$(PHONELIBS)/json/src - -OPENCL_FLAGS = -I$(PHONELIBS)/opencl/include -OPENCL_LIBS = -lgsl -lCB -lOpenCL - -OPENGL_LIBS = -lGLESv3 - -OPENSL_LIBS = -lOpenSLES - -UUID_LIBS = -luuid - -FRAMEBUFFER_LIBS = -lutils -lgui -lEGL - -CFLAGS += -DQCOM \ - -I$(PHONELIBS)/android_frameworks_native/include \ - -I$(PHONELIBS)/android_system_core/include \ - -I$(PHONELIBS)/android_hardware_libhardware/include -CXXFLAGS += -DQCOM \ - -I$(PHONELIBS)/android_frameworks_native/include \ - -I$(PHONELIBS)/android_system_core/include \ - -I$(PHONELIBS)/android_hardware_libhardware/include - -# ui can only be compiled for the phone -CFLAGS += -mcpu=cortex-a57 -CXXFLAGS += -mcpu=cortex-a57 - -OBJS = slplay.o \ - ui.o \ - ../common/glutil.o \ - ../common/visionipc.o \ - ../common/ipc.o \ - ../common/visionimg.o \ - ../common/visionbuf_ion.o \ - ../common/framebuffer.o \ - ../common/params.o \ - ../common/util.o \ - ../common/touch.o \ - ../common/swaglog.o \ - $(PHONELIBS)/nanovg/nanovg.o \ - $(PHONELIBS)/json/src/json.o \ - $(CEREAL_OBJS) - -DEPS := $(OBJS:.o=.d) - -all: ui - -ui: $(OBJS) $(MESSAGING_LIBS) - @echo "[ LINK ] $@" - $(CXX) -fPIC -o '$@' $^ \ - $(FRAMEBUFFER_LIBS) \ - $(CEREAL_LIBS) \ - -lgnustl_shared \ - -L/system/vendor/lib64 \ - -lhardware -lui \ - $(ZMQ_LIBS) \ - $(OPENGL_LIBS) \ - $(OPENCL_LIBS) \ - ${OPENSL_LIBS} \ - ${UUID_LIBS} \ - -Wl,-rpath=/system/lib64,-rpath=/system/comma/usr/lib \ - -lcutils -lm -llog -lui -ladreno_utils - -slplay.o: slplay.c - @echo "[ CC ] $@" - $(CC) $(CFLAGS) -fPIC \ - -I../ \ - $(OPENSL_LIBS) \ - -c -o '$@' $^ - -%.o: %.cc - @echo "[ CXX ] $@" - $(CXX) $(CXXFLAGS) -MMD \ - -Iinclude -I.. -I../.. \ - $(OPENCL_FLAGS) \ - $(NANOVG_FLAGS) \ - $(ZMQ_FLAGS) \ - $(MESSAGING_FLAGS) \ - $(CEREAL_CFLAGS) \ - $(JSON_FLAGS) \ - -I$(PHONELIBS)/android_frameworks_native/include \ - -I$(PHONELIBS)/android_system_core/include \ - -I$(PHONELIBS)/android_hardware_libhardware/include \ - -I$(PHONELIBS)/libgralloc/include \ - -I$(PHONELIBS)/linux/include \ - -c -o '$@' '$<' - -%.o: %.c - @echo "[ CC ] $@" - $(CC) $(CFLAGS) -MMD \ - -Iinclude -I.. -I../.. \ - $(NANOVG_FLAGS) \ - $(ZMQ_FLAGS) \ - $(CEREAL_CFLAGS) \ - $(JSON_FLAGS) \ - $(OPENCL_FLAGS) \ - -I$(PHONELIBS)/linux/include \ - -c -o '$@' '$<' - -.PHONY: clean -clean: - rm -f ui $(OBJS) $(DEPS) - --include $(DEPS) diff --git a/selfdrive/ui/spinner/spinner b/selfdrive/ui/spinner/spinner index c8f8e68ecf4ae3..17b6491b142281 100755 Binary files a/selfdrive/ui/spinner/spinner and b/selfdrive/ui/spinner/spinner differ diff --git a/selfdrive/ui/ui b/selfdrive/ui/ui deleted file mode 100755 index d212c92da72524..00000000000000 --- a/selfdrive/ui/ui +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -export LD_LIBRARY_PATH="/system/lib64:$LD_LIBRARY_PATH" -exec ./_ui -