diff --git a/README.md b/README.md index 1702249169..5e4a84e439 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Also, we have a 3500+ person [community on slack](https://slack.comma.ai). Hardware ------ -Right now openpilot supports the [EON Dashcam DevKit](https://shop.comma.ai/products/eon-dashcam-devkit). We'd like to support other platforms as well. +Right now openpilot supports the [EON Dashcam DevKit](https://comma.ai/shop/products/eon-dashcam-devkit). We'd like to support other platforms as well. Install openpilot on a neo device by entering ``https://openpilot.comma.ai`` during NEOS setup. @@ -108,7 +108,7 @@ Community Maintained Cars How can I add support for my car? ------ -If your car has adaptive cruise control and lane keep assist, you are in luck. Using a [panda](https://panda.comma.ai) and [cabana](https://community.comma.ai/cabana/), you can understand how to make your car drive by wire. +If your car has adaptive cruise control and lane keep assist, you are in luck. Using a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle/) and [cabana](https://community.comma.ai/cabana/), you can understand how to make your car drive by wire. We've written a [porting guide](https://medium.com/@comma_ai/openpilot-port-guide-for-toyota-models-e5467f4b5fe6) for Toyota that might help you after you have the basics figured out. @@ -150,7 +150,7 @@ There is rudimentary infrastructure to run a basic simulation and generate a rep ./run_docker_tests.sh ``` -The results are written to `selfdrive/test/plant/out/index.html` +The results are written to `selfdrive/test/tests/plant/out/longitudinal/index.html` More extensive testing infrastructure and simulation environments are coming soon. @@ -164,7 +164,7 @@ It's open source software, so you are free to disable it if you wish. It logs the road facing camera, CAN, GPS, IMU, magnetometer, thermal sensors, crashes, and operating system logs. It does not log the user facing camera or the microphone. -By using it, you agree to [our privacy policy](https://beta.comma.ai/privacy.html). You understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma.ai. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma.ai for the use of this data. +By using it, you agree to [our privacy policy](https://community.comma.ai/privacy.html). You understand that use of this software or its related services will generate certain types of user data, which may be logged and stored at the sole discretion of comma.ai. By accepting this agreement, you grant an irrevocable, perpetual, worldwide right to comma.ai for the use of this data. Contributing ------ @@ -173,7 +173,7 @@ We welcome both pull requests and issues on [github](http://github.com/commaai/openpilot). See the TODO file for a list of good places to start. -Want to get paid to work on openpilot? [comma.ai is hiring](http://comma.ai/positions.html) +Want to get paid to work on openpilot? [comma.ai is hiring](https://comma.ai/jobs/) Licensing ------ diff --git a/selfdrive/can/parser.py b/selfdrive/can/parser.py index 4806e1a1d5..c4c007d1f5 100644 --- a/selfdrive/can/parser.py +++ b/selfdrive/can/parser.py @@ -25,7 +25,7 @@ class CANParser(object): self.msg_name_to_addres[name] = address self.address_to_msg_name[address] = name - # Convert message names into adresses + # Convert message names into addresses for i in range(len(signals)): s = signals[i] if not isinstance(s[1], numbers.Number): diff --git a/selfdrive/can/process_dbc.py b/selfdrive/can/process_dbc.py index 7c554081d0..b1e66780a7 100755 --- a/selfdrive/can/process_dbc.py +++ b/selfdrive/can/process_dbc.py @@ -49,7 +49,7 @@ for address, msg_name, msg_size, sigs in msgs: sys.exit("COUNTER starts at wrong bit %s" % msg_name) -# Fail on duplicate messgae names +# Fail on duplicate message names c = Counter([msg_name for address, msg_name, msg_size, sigs in msgs]) for name, count in c.items(): if count > 1: diff --git a/selfdrive/car/ford/carstate.py b/selfdrive/car/ford/carstate.py index f85e2155a4..4626d28f4a 100644 --- a/selfdrive/car/ford/carstate.py +++ b/selfdrive/car/ford/carstate.py @@ -80,7 +80,7 @@ class CarState(object): self.v_wheel_fr = cp.vl["WheelSpeed_CG1"]['WhlRl_W_Meas'] * WHEEL_RADIUS self.v_wheel_rl = cp.vl["WheelSpeed_CG1"]['WhlFr_W_Meas'] * WHEEL_RADIUS self.v_wheel_rr = cp.vl["WheelSpeed_CG1"]['WhlFl_W_Meas'] * WHEEL_RADIUS - self.v_wheel = (self.v_wheel_fl + self.v_wheel_fr + self.v_wheel_rl + self.v_wheel_rr) / 4. + self.v_wheel = float(np.mean([self.v_wheel_fl, self.v_wheel_fr, self.v_wheel_rl, self.v_wheel_rr])) # Kalman filter if abs(self.v_wheel - self.v_ego) > 2.0: # Prevent large accelerations when car starts at non zero speed diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index 568c1f3ab7..f4163f526d 100755 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -60,7 +60,7 @@ class CarInterface(object): # FIXME: hardcoding honda civic 2016 touring params so they can be used to # scale unknown params for other cars - mass_civic = 2923./2.205 + std_cargo + mass_civic = 2923. * CV.LB_TO_KG + std_cargo wheelbase_civic = 2.70 centerToFront_civic = wheelbase_civic * 0.4 centerToRear_civic = wheelbase_civic - centerToFront_civic @@ -71,7 +71,7 @@ class CarInterface(object): ret.steerKiBP, ret.steerKpBP = [[0.], [0.]] ret.wheelbase = 2.85 ret.steerRatio = 14.8 - ret.mass = 3045./2.205 + std_cargo + ret.mass = 3045. * CV.LB_TO_KG + std_cargo 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 diff --git a/selfdrive/car/gm/carstate.py b/selfdrive/car/gm/carstate.py index 39d7c32736..59b6e35c74 100644 --- a/selfdrive/car/gm/carstate.py +++ b/selfdrive/car/gm/carstate.py @@ -74,8 +74,7 @@ class CarState(object): self.v_wheel_fr = pt_cp.vl["EBCMWheelSpdFront"]['FRWheelSpd'] * CV.KPH_TO_MS self.v_wheel_rl = pt_cp.vl["EBCMWheelSpdRear"]['RLWheelSpd'] * CV.KPH_TO_MS self.v_wheel_rr = pt_cp.vl["EBCMWheelSpdRear"]['RRWheelSpd'] * CV.KPH_TO_MS - speed_estimate = (self.v_wheel_fl + self.v_wheel_fr + - self.v_wheel_rl + self.v_wheel_rr) / 4.0 + speed_estimate = float(np.mean([self.v_wheel_fl, self.v_wheel_fr, self.v_wheel_rl, self.v_wheel_rr])) self.v_ego_raw = speed_estimate v_ego_x = self.v_ego_kf.update(speed_estimate) diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index c3ce3e3422..3f53291f99 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -92,7 +92,7 @@ class CarInterface(object): # engage speed is decided by pcm ret.minEnableSpeed = -1 # kg of standard extra cargo to count for drive, gas, etc... - ret.mass = 4016/2.205 + std_cargo + ret.mass = 4016. * CV.LB_TO_KG + std_cargo ret.safetyModel = car.CarParams.SafetyModels.cadillac ret.wheelbase = 3.11 ret.steerRatio = 14.6 # it's 16.3 without rear active steering @@ -102,7 +102,7 @@ class CarInterface(object): # hardcoding honda civic 2016 touring params so they can be used to # scale unknown params for other cars - mass_civic = 2923./2.205 + std_cargo + mass_civic = 2923. * CV.LB_TO_KG + std_cargo wheelbase_civic = 2.70 centerToFront_civic = wheelbase_civic * 0.4 centerToRear_civic = wheelbase_civic - centerToFront_civic diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 4b45451c62..1a91a06bd3 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -13,7 +13,7 @@ def actuator_hystereses(brake, braking, brake_steady, v_ego, car_fingerprint): brake_hyst_off = 0.005 # to deactivate brakes below this value brake_hyst_gap = 0.01 # don't change brake command for small ocilalitons within this value - #*** histeresys logic to avoid brake blinking. go above 0.1 to trigger + #*** histeresis logic to avoid brake blinking. go above 0.1 to trigger if (brake < brake_hyst_on and not braking) or brake < brake_hyst_off: brake = 0. braking = brake > 0. @@ -90,7 +90,6 @@ class CarController(object): else: hud_lanes = 0 - # TODO: factor this out better if enabled: if hud_show_car: hud_car = 2 diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py index 88cc6d7b32..b926c156c6 100644 --- a/selfdrive/car/honda/carstate.py +++ b/selfdrive/car/honda/carstate.py @@ -219,7 +219,7 @@ class CarState(object): cp.vl["DOORS_STATUS"]['DOOR_OPEN_RL'], cp.vl["DOORS_STATUS"]['DOOR_OPEN_RR']]) self.seatbelt = not cp.vl["SEATBELT_STATUS"]['SEATBELT_DRIVER_LAMP'] and cp.vl["SEATBELT_STATUS"]['SEATBELT_DRIVER_LATCHED'] - # 2 = temporary 3= TBD 4 = temporary, hit a bump 5 (permanent) 6 = temporary 7 (permanent) + # 2 = temporary; 3 = TBD; 4 = temporary, hit a bump; 5 = (permanent); 6 = temporary; 7 = (permanent) # TODO: Use values from DBC to parse this field self.steer_error = cp.vl["STEER_STATUS"]['STEER_STATUS'] not in [0, 2, 3, 4, 6] self.steer_not_allowed = cp.vl["STEER_STATUS"]['STEER_STATUS'] != 0 @@ -232,7 +232,7 @@ class CarState(object): self.v_wheel_fr = cp.vl["WHEEL_SPEEDS"]['WHEEL_SPEED_FR'] * CV.KPH_TO_MS self.v_wheel_rl = cp.vl["WHEEL_SPEEDS"]['WHEEL_SPEED_RL'] * CV.KPH_TO_MS self.v_wheel_rr = cp.vl["WHEEL_SPEEDS"]['WHEEL_SPEED_RR'] * CV.KPH_TO_MS - self.v_wheel = (self.v_wheel_fl + self.v_wheel_fr + self.v_wheel_rl + self.v_wheel_rr) / 4. + self.v_wheel = float(np.mean([self.v_wheel_fl, self.v_wheel_fr, self.v_wheel_rl, self.v_wheel_rr])) # blend in transmission speed at low speed, since it has more low speed accuracy self.v_weight = interp(self.v_wheel, v_weight_bp, v_weight_v) diff --git a/selfdrive/car/toyota/carstate.py b/selfdrive/car/toyota/carstate.py index 1168c01fc3..28bfc0fb57 100644 --- a/selfdrive/car/toyota/carstate.py +++ b/selfdrive/car/toyota/carstate.py @@ -128,7 +128,7 @@ class CarState(object): self.v_wheel_fr = cp.vl["WHEEL_SPEEDS"]['WHEEL_SPEED_FR'] * CV.KPH_TO_MS self.v_wheel_rl = cp.vl["WHEEL_SPEEDS"]['WHEEL_SPEED_RL'] * CV.KPH_TO_MS self.v_wheel_rr = cp.vl["WHEEL_SPEEDS"]['WHEEL_SPEED_RR'] * CV.KPH_TO_MS - self.v_wheel = (self.v_wheel_fl + self.v_wheel_fr + self.v_wheel_rl + self.v_wheel_rr) / 4. + self.v_wheel = float(np.mean([self.v_wheel_fl, self.v_wheel_fr, self.v_wheel_rl, self.v_wheel_rr])) # Kalman filter if abs(self.v_wheel - self.v_ego) > 2.0: # Prevent large accelerations when car starts at non zero speed diff --git a/selfdrive/controls/lib/pid.py b/selfdrive/controls/lib/pid.py index b25275d668..b68dc3810e 100644 --- a/selfdrive/controls/lib/pid.py +++ b/selfdrive/controls/lib/pid.py @@ -13,7 +13,7 @@ def apply_deadzone(error, deadzone): class PIController(object): def __init__(self, k_p, k_i, k_f=1., pos_limit=None, neg_limit=None, rate=100, sat_limit=0.8, convert=None): self._k_p = k_p # proportional gain - self._k_i = k_i # integrale gain + self._k_i = k_i # integral gain self.k_f = k_f # feedforward gain self.pos_limit = pos_limit