|
|
@ -94,6 +94,7 @@ class CarInterface(CarInterfaceBase): |
|
|
|
elif candidate == CAR.TRANSPORTER_T61: |
|
|
|
elif candidate == CAR.TRANSPORTER_T61: |
|
|
|
ret.mass = 1926 + STD_CARGO_KG |
|
|
|
ret.mass = 1926 + STD_CARGO_KG |
|
|
|
ret.wheelbase = 3.00 # SWB, LWB is 3.40, TBD how to detect difference |
|
|
|
ret.wheelbase = 3.00 # SWB, LWB is 3.40, TBD how to detect difference |
|
|
|
|
|
|
|
ret.minSteerSpeed = 14.0 |
|
|
|
|
|
|
|
|
|
|
|
elif candidate == CAR.AUDI_A3_MK3: |
|
|
|
elif candidate == CAR.AUDI_A3_MK3: |
|
|
|
ret.mass = 1335 + STD_CARGO_KG |
|
|
|
ret.mass = 1335 + STD_CARGO_KG |
|
|
@ -135,16 +136,13 @@ class CarInterface(CarInterfaceBase): |
|
|
|
ret.mass = 1505 + STD_CARGO_KG |
|
|
|
ret.mass = 1505 + STD_CARGO_KG |
|
|
|
ret.wheelbase = 2.84 |
|
|
|
ret.wheelbase = 2.84 |
|
|
|
|
|
|
|
|
|
|
|
# TODO: get actual value, for now starting with reasonable value for |
|
|
|
else: |
|
|
|
# civic and scaling by mass and wheelbase |
|
|
|
raise ValueError("unsupported car %s" % candidate) |
|
|
|
ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# TODO: start from empirically derived lateral slip stiffness for the civic and scale by |
|
|
|
ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase) |
|
|
|
# mass and CG position, so all cars will have approximately similar dyn behaviors |
|
|
|
|
|
|
|
ret.centerToFront = ret.wheelbase * 0.45 |
|
|
|
ret.centerToFront = ret.wheelbase * 0.45 |
|
|
|
ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, |
|
|
|
ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront, |
|
|
|
tire_stiffness_factor=tire_stiffness_factor) |
|
|
|
tire_stiffness_factor=tire_stiffness_factor) |
|
|
|
|
|
|
|
|
|
|
|
return ret |
|
|
|
return ret |
|
|
|
|
|
|
|
|
|
|
|
# returns a car.CarState |
|
|
|
# returns a car.CarState |
|
|
@ -182,6 +180,14 @@ class CarInterface(CarInterfaceBase): |
|
|
|
if self.CS.parkingBrakeSet: |
|
|
|
if self.CS.parkingBrakeSet: |
|
|
|
events.add(EventName.parkBrake) |
|
|
|
events.add(EventName.parkBrake) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Low speed steer alert hysteresis logic |
|
|
|
|
|
|
|
if ret.vEgo < (self.CP.minSteerSpeed + 1.): |
|
|
|
|
|
|
|
self.low_speed_alert = True |
|
|
|
|
|
|
|
elif ret.vEgo > (self.CP.minSteerSpeed + 2.): |
|
|
|
|
|
|
|
self.low_speed_alert = False |
|
|
|
|
|
|
|
if self.low_speed_alert: |
|
|
|
|
|
|
|
events.add(EventName.belowSteerSpeed) |
|
|
|
|
|
|
|
|
|
|
|
ret.events = events.to_msg() |
|
|
|
ret.events = events.to_msg() |
|
|
|
ret.buttonEvents = buttonEvents |
|
|
|
ret.buttonEvents = buttonEvents |
|
|
|
|
|
|
|
|
|
|
|