diff --git a/README.md b/README.md index dbd0c62017..1702249169 100644 --- a/README.md +++ b/README.md @@ -88,15 +88,9 @@ Supported Cars ### GM (Chevrolet + Cadillac) ### -- Chevrolet Volt Premier 2017+ - - Driver Confidence II package (adaptive cruise control) required - - Can only be enabled above 18 mph +- Chevrolet Volt Premier 2017+ with Driver Confidence II package - Read the [installation guide](https://www.zoneos.com/volt.htm) -- Cadillac CT6 - - Uses stock ACC for longitudinal control - - Requires multiple panda for proxying the ASCMs - In Progress Cars ------ - All TSS-P Toyota with Steering Assist. diff --git a/RELEASES.md b/RELEASES.md index 741ec98b51..711b5c23fc 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,9 @@ +Version 0.4.7.2 (2018-06-25) +========================== + * Fix loggerd lag issue + * No longer prompt for updates + * Mitigate right lane hugging for properly mounted EON (procedure on wiki) + Version 0.4.7.1 (2018-06-18) ========================== * Fix Acura ILX steer faults diff --git a/cereal/car.capnp b/cereal/car.capnp index a1444e5d78..b4c766651b 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -170,6 +170,7 @@ struct RadarState { enum Error { commIssue @0; fault @1; + wrongConfig @2; } # similar to LiveTracks @@ -332,7 +333,7 @@ struct CarParams { directAccelControl @31 :Bool; # Does the car have direct accel control or just gas/brake stoppingControl @34 :Bool; # Does the car allows full control even at lows speeds when stopping startAccel @35 :Float32; # Required acceleraton to overcome creep braking - steerRateCost @40 :Float32; # Lateral MPC cost on steering rate + steerRateCostDEPRECATED @40 :Float32; # Lateral MPC cost on steering rate steerControlType @46 :SteerControlType; radarOffCan @47 :Bool; # True when radar objects aren't visible on CAN diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 00e126c58b..41f8a607cf 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -5,14 +5,11 @@ if [ -z "$PASSIVE" ]; then fi function launch { - DO_UPDATE=$(cat /data/params/d/ShouldDoUpdate) # apply update - if [ "$DO_UPDATE" == "1" ] && [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then + if [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then git reset --hard @{u} && git clean -xdf && exec "${BASH_SOURCE[0]}" - echo -n 0 > /data/params/d/ShouldDoUpdate - echo -n 0 > /data/params/d/IsUpdateAvailable fi # no cpu rationing for now diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index 663d521874..568c1f3ab7 100755 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -75,7 +75,6 @@ class CarInterface(object): ret.steerKpV, ret.steerKiV = [[0.01], [0.005]] # TODO: tune this ret.steerKf = 1. / MAX_ANGLE # MAX Steer angle to normalize FF ret.steerActuatorDelay = 0.1 # Default delay, not measured yet - ret.steerRateCost = 0.5 f = 1.2 tireStiffnessFront_civic *= f diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index d23f138089..c3ce3e3422 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -151,7 +151,6 @@ class CarInterface(object): ret.startAccel = 0.8 ret.steerActuatorDelay = 0.1 # Default delay, not measured yet - ret.steerRateCost = 0.5 ret.steerControlType = car.CarParams.SteerControlType.torque return ret diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 9109150df7..4b45451c62 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -1,4 +1,3 @@ -import os from collections import namedtuple from selfdrive.boardd.boardd import can_list_to_can_capnp from selfdrive.controls.lib.drive_helpers import rate_limit @@ -123,8 +122,7 @@ class CarController(object): elif CS.CP.carFingerprint in (CAR.CRV, CAR.ACURA_RDX): STEER_MAX = 0x3e8 # CR-V only uses 12-bits and requires a lower value (max value from energee) else: - is_fw_modified = os.getenv("DONGLE_ID") in ['99c94dc769b5d96e'] - STEER_MAX = 0x1FFF if is_fw_modified else 0x1000 + STEER_MAX = 0x1000 # steer torque is converted back to CAN reference (positive when steering right) apply_gas = clip(actuators.gas, 0., 1.) diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py index 9dfb120088..92e74cd686 100644 --- a/selfdrive/car/honda/hondacan.py +++ b/selfdrive/car/honda/hondacan.py @@ -37,11 +37,11 @@ def create_brake_command(packer, apply_brake, pcm_override, pcm_cancel_cmd, chim values = { "COMPUTER_BRAKE": apply_brake, - "COMPUTER_BRAKE_REQUEST": pump_on, + "BRAKE_PUMP_REQUEST": pump_on, "CRUISE_OVERRIDE": pcm_override, "CRUISE_FAULT_CMD": pcm_fault_cmd, "CRUISE_CANCEL_CMD": pcm_cancel_cmd, - "COMPUTER_BRAKE_REQUEST_2": brake_rq, + "COMPUTER_BRAKE_REQUEST": brake_rq, "SET_ME_0X80": 0x80, "BRAKE_LIGHTS": brakelights, "CHIME": chime, diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index 24b2f0ce67..32c32a64f8 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -340,7 +340,6 @@ class CarInterface(object): ret.startAccel = 0.5 ret.steerActuatorDelay = 0.09 - ret.steerRateCost = 0.5 return ret diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 23da3d4e23..d26992ad1f 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -78,7 +78,6 @@ class CarInterface(object): ret.mass = 3045 * CV.LB_TO_KG + std_cargo ret.steerKpV, ret.steerKiV = [[0.4], [0.01]] ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 - ret.steerRateCost = 1.5 f = 1.43353663 tireStiffnessFront_civic *= f @@ -93,7 +92,6 @@ class CarInterface(object): ret.mass = 3650 * CV.LB_TO_KG + std_cargo # mean between normal and hybrid ret.steerKpV, ret.steerKiV = [[0.6], [0.05]] ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 - ret.steerRateCost = 1. elif candidate == CAR.COROLLA: ret.safetyParam = 100 # see conversion factor for STEER_TORQUE_EPS in dbc file ret.wheelbase = 2.70 @@ -101,7 +99,6 @@ class CarInterface(object): ret.mass = 2860 * CV.LB_TO_KG + std_cargo # mean between normal and hybrid ret.steerKpV, ret.steerKiV = [[0.2], [0.05]] ret.steerKf = 0.00003 # full torque for 20 deg at 80mph means 0.00007818594 - ret.steerRateCost = 1. elif candidate == CAR.LEXUS_RXH: ret.safetyParam = 100 # see conversion factor for STEER_TORQUE_EPS in dbc file ret.wheelbase = 2.79 @@ -109,7 +106,6 @@ class CarInterface(object): ret.mass = 4481 * CV.LB_TO_KG + std_cargo # mean between min and max ret.steerKpV, ret.steerKiV = [[0.6], [0.1]] ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 - ret.steerRateCost = .8 ret.centerToFront = ret.wheelbase * 0.44 diff --git a/selfdrive/common/version.h b/selfdrive/common/version.h index 4c7e47de8c..8fcd679d60 100644 --- a/selfdrive/common/version.h +++ b/selfdrive/common/version.h @@ -1 +1 @@ -#define COMMA_VERSION "0.4.7.1-release" +#define COMMA_VERSION "0.4.7.2-release" diff --git a/selfdrive/controls/lib/latcontrol.py b/selfdrive/controls/lib/latcontrol.py index 74ccca832f..101b8368fa 100644 --- a/selfdrive/controls/lib/latcontrol.py +++ b/selfdrive/controls/lib/latcontrol.py @@ -28,11 +28,12 @@ class LatControl(object): (VM.CP.steerKiBP, VM.CP.steerKiV), k_f=VM.CP.steerKf, pos_limit=1.0) self.last_cloudlog_t = 0.0 - self.setup_mpc(VM.CP.steerRateCost) + self.setup_mpc() - def setup_mpc(self, steer_rate_cost): + def setup_mpc(self): self.libmpc = libmpc_py.libmpc - self.libmpc.init(MPC_COST_LAT.PATH, MPC_COST_LAT.LANE, MPC_COST_LAT.HEADING, steer_rate_cost) + self.libmpc.init(MPC_COST_LAT.PATH, MPC_COST_LAT.LANE, + MPC_COST_LAT.HEADING, MPC_COST_LAT.STEER_RATE) self.mpc_solution = libmpc_py.ffi.new("log_t *") self.cur_state = libmpc_py.ffi.new("state_t *") @@ -90,7 +91,7 @@ class LatControl(object): self.mpc_nans = np.any(np.isnan(list(self.mpc_solution[0].delta))) t = sec_since_boot() if self.mpc_nans: - self.libmpc.init(MPC_COST_LAT.PATH, MPC_COST_LAT.LANE, MPC_COST_LAT.HEADING, VM.CP.steerRateCost) + self.libmpc.init(MPC_COST_LAT.PATH, MPC_COST_LAT.LANE, MPC_COST_LAT.HEADING, MPC_COST_LAT.STEER_RATE) self.cur_state[0].delta = math.radians(angle_steers) / VM.CP.steerRatio if t > self.last_cloudlog_t + 5.0: diff --git a/selfdrive/controls/lib/pathplanner.py b/selfdrive/controls/lib/pathplanner.py index 68b4f22cfb..ab3d8d3db4 100644 --- a/selfdrive/controls/lib/pathplanner.py +++ b/selfdrive/controls/lib/pathplanner.py @@ -1,6 +1,7 @@ from common.numpy_fast import interp from selfdrive.controls.lib.latcontrol_helpers import model_polyfit, calc_desired_path, compute_path_pinv +CAMERA_OFFSET = 0.12 # ~12cm from center car to camera class PathPlanner(object): def __init__(self): @@ -21,6 +22,10 @@ class PathPlanner(object): l_poly = model_polyfit(md.model.leftLane.points, self._path_pinv) # left line r_poly = model_polyfit(md.model.rightLane.points, self._path_pinv) # right line + # only offset left and right lane lines; offsetting p_poly does not make sense + l_poly[3] += CAMERA_OFFSET + r_poly[3] += CAMERA_OFFSET + p_prob = 1. # model does not tell this probability yet, so set to 1 for now l_prob = md.model.leftLane.prob # left line prob r_prob = md.model.rightLane.prob # right line prob diff --git a/selfdrive/controls/lib/vehicle_model.py b/selfdrive/controls/lib/vehicle_model.py index f10e31a3b8..d4a954c9d7 100755 --- a/selfdrive/controls/lib/vehicle_model.py +++ b/selfdrive/controls/lib/vehicle_model.py @@ -101,3 +101,4 @@ if __name__ == '__main__': VM = VehicleModel(CP) print VM.steady_state_sol(.1, 0.15) print calc_slip_factor(VM) + print VM.yaw_rate(0.2*np.pi/180, 32.) * 180./np.pi diff --git a/selfdrive/loggerd/loggerd b/selfdrive/loggerd/loggerd index a2b013168f..ba34034e28 100755 --- a/selfdrive/loggerd/loggerd +++ b/selfdrive/loggerd/loggerd @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:41c0efcbf738804666592169f5845472dfdc230c192e50db16898c69a3a34985 +oid sha256:fb9ada8972a8a79dcf9af70260b9ac2ada87eea7acf680349a3581e75028587a size 1622712 diff --git a/selfdrive/loggerd/uploader.py b/selfdrive/loggerd/uploader.py index 8c97907b72..2d793064af 100644 --- a/selfdrive/loggerd/uploader.py +++ b/selfdrive/loggerd/uploader.py @@ -69,7 +69,11 @@ def clear_locks(root): def is_on_wifi(): # ConnectivityManager.getActiveNetworkInfo() - result = subprocess.check_output(["service", "call", "connectivity", "2"]).strip().split("\n") + try: + result = subprocess.check_output(["service", "call", "connectivity", "2"]).strip().split("\n") + except subprocess.CalledProcessError: + return False + data = ''.join(''.join(w.decode("hex")[::-1] for w in l[14:49].split()) for l in result[1:]) return "\x00".join("WIFI") in data diff --git a/selfdrive/manager.py b/selfdrive/manager.py index 53372d8916..e425304780 100755 --- a/selfdrive/manager.py +++ b/selfdrive/manager.py @@ -102,7 +102,7 @@ managed_processes = { "visiond": ("selfdrive/visiond", ["./visiond"]), "sensord": ("selfdrive/sensord", ["./sensord"]), "gpsd": ("selfdrive/sensord", ["./gpsd"]), - "orbd": ("selfdrive/orbd", ["./orbd_wrapper.sh"]), + #"orbd": ("selfdrive/orbd", ["./orbd_wrapper.sh"]), "updated": "selfdrive.updated", #"gpsplanner": "selfdrive.controls.gps_plannerd", } @@ -665,9 +665,12 @@ def main(): del managed_processes['controlsd'] del managed_processes['radard'] + # disable this until we use it + """ if os.path.isfile('logserver/logserver.py'): managed_processes["logserver"] = "selfdrive.logserver.wsgi" persistent_processes.append("logserver") + """ # support additional internal only extensions try: diff --git a/selfdrive/sensord/gpsd b/selfdrive/sensord/gpsd index 1e0f1ca1ad..f4dcf29491 100755 --- a/selfdrive/sensord/gpsd +++ b/selfdrive/sensord/gpsd @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fb638743ad0d9db5b1ecdc44b1a8058fc78cb453a7302ff5d543f1c2c3a22259 +oid sha256:d51ec7f5e069ab8d9b03b672cb65df0ddae9abe82b220debb9aecc1a36f20f45 size 1171544 diff --git a/selfdrive/sensord/sensord b/selfdrive/sensord/sensord index 9f27a9fdeb..52b1b3b93e 100755 --- a/selfdrive/sensord/sensord +++ b/selfdrive/sensord/sensord @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:57fe440a4732a791446ff62d7b47b9299b4b978653e095f1f7cd521b5d85738d +oid sha256:05853b1b3324b420d1463daf806797bb3d85659a0637ca7836b137a84e619be0 size 1159016 diff --git a/selfdrive/updated.py b/selfdrive/updated.py old mode 100644 new mode 100755 index cf40bb56be..fd5887e111 --- a/selfdrive/updated.py +++ b/selfdrive/updated.py @@ -7,14 +7,10 @@ import time import subprocess from common.basedir import BASEDIR -from common.params import Params from selfdrive.swaglog import cloudlog -from selfdrive.version import dirty NICE_LOW_PRIORITY = ["nice", "-n", "19"] def main(gctx=None): - params = Params() - while True: # try network r = subprocess.call(["ping", "-W", "4", "-c", "1", "8.8.8.8"]) @@ -22,40 +18,19 @@ def main(gctx=None): time.sleep(60) continue - # If there are modifications we preserve full history - # and disable update prompting. - # Otherwise, only store head to save space - if dirty: - r = subprocess.call(NICE_LOW_PRIORITY + ["git", "fetch", "--unshallow"]) - is_update_available = False - else: - r = subprocess.call(NICE_LOW_PRIORITY + ["git", "fetch", "--depth=1"]) - is_update_available = check_is_update_available() - - is_update_available_str = "1" if is_update_available else "0" - params.put("IsUpdateAvailable", is_update_available_str) - cloudlog.info("IsUpdateAvailable: %s", is_update_available_str) + # download application update + r = subprocess.call(NICE_LOW_PRIORITY + ["git", "fetch"]) cloudlog.info("git fetch: %r", r) if r: time.sleep(60) continue # download apks - r = subprocess.call(["nice", "-n", "19", os.path.join(BASEDIR, "apk/external/patcher.py"), "download"]) + r = subprocess.call(NICE_LOW_PRIORITY + [os.path.join(BASEDIR, "apk/external/patcher.py"), "download"]) cloudlog.info("patcher download: %r", r) time.sleep(60*60*3) -def check_is_update_available(): - try: - local_rev = subprocess.check_output(NICE_LOW_PRIORITY + ["git", "rev-parse", "@"]) - upstream_rev = subprocess.check_output(NICE_LOW_PRIORITY + ["git", "rev-parse", "@{u}"]) - - return upstream_rev != local_rev - except subprocess.CalledProcessError: - cloudlog.exception("updated: failed to compare local and upstream") - - return False - if __name__ == "__main__": - main() + main() + diff --git a/selfdrive/visiond/visiond b/selfdrive/visiond/visiond index 9d3933da72..6180106f33 100755 --- a/selfdrive/visiond/visiond +++ b/selfdrive/visiond/visiond @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae0213abe0c6f76c4850386459ee1d8478e5a965a311c9f12c3300f6367ef526 +oid sha256:9cbff07d194fcd129b105b4b9b6aa6a274e130911f10dda614db1ef60092600e size 13522344