VW MQB: Min steer speed support, other cleanup (#22324)
* VW MQB: Min steer speed support, other cleanup * simplify * more correct * fix READMEpull/22328/head
parent
0f8c6f130b
commit
c51eba3fd6
|
@ -140,7 +140,7 @@ Community Maintained Cars and Features
|
|||
| Subaru | Impreza 2017-19 | EyeSight | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Arteon 2021<sup>4</sup> | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Atlas 2018-19 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| California 2021<sup>4</sup> | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| California 2021<sup>4</sup> | Driver Assistance | Stock | 0mph | 32mph |
|
||||
| Volkswagen| e-Golf 2014, 2019-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf 2015-20 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
| Volkswagen| Golf Alltrack 2017-18 | Driver Assistance | Stock | 0mph | 0mph |
|
||||
|
|
|
@ -39,7 +39,7 @@ class CarController():
|
|||
# torque value. Do that anytime we happen to have 0 torque, or failing that,
|
||||
# when exceeding ~1/3 the 360 second timer.
|
||||
|
||||
if enabled and not (CS.out.standstill or CS.out.steerError or CS.out.steerWarning):
|
||||
if enabled and CS.out.vEgo > CS.CP.minSteerSpeed and not (CS.out.standstill or CS.out.steerError or CS.out.steerWarning):
|
||||
new_steer = int(round(actuators.steer * P.STEER_MAX))
|
||||
apply_steer = apply_std_steer_torque_limits(new_steer, self.apply_steer_last, CS.out.steeringTorque, P)
|
||||
self.steer_rate_limited = new_steer != apply_steer
|
||||
|
|
|
@ -94,6 +94,7 @@ class CarInterface(CarInterfaceBase):
|
|||
elif candidate == CAR.TRANSPORTER_T61:
|
||||
ret.mass = 1926 + STD_CARGO_KG
|
||||
ret.wheelbase = 3.00 # SWB, LWB is 3.40, TBD how to detect difference
|
||||
ret.minSteerSpeed = 14.0
|
||||
|
||||
elif candidate == CAR.AUDI_A3_MK3:
|
||||
ret.mass = 1335 + STD_CARGO_KG
|
||||
|
@ -135,16 +136,13 @@ class CarInterface(CarInterfaceBase):
|
|||
ret.mass = 1505 + STD_CARGO_KG
|
||||
ret.wheelbase = 2.84
|
||||
|
||||
# TODO: get actual value, for now starting with reasonable value for
|
||||
# civic and scaling by mass and wheelbase
|
||||
ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase)
|
||||
else:
|
||||
raise ValueError("unsupported car %s" % candidate)
|
||||
|
||||
# TODO: start from empirically derived lateral slip stiffness for the civic and scale by
|
||||
# mass and CG position, so all cars will have approximately similar dyn behaviors
|
||||
ret.rotationalInertia = scale_rot_inertia(ret.mass, ret.wheelbase)
|
||||
ret.centerToFront = ret.wheelbase * 0.45
|
||||
ret.tireStiffnessFront, ret.tireStiffnessRear = scale_tire_stiffness(ret.mass, ret.wheelbase, ret.centerToFront,
|
||||
tire_stiffness_factor=tire_stiffness_factor)
|
||||
|
||||
return ret
|
||||
|
||||
# returns a car.CarState
|
||||
|
@ -182,6 +180,14 @@ class CarInterface(CarInterfaceBase):
|
|||
if self.CS.parkingBrakeSet:
|
||||
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.buttonEvents = buttonEvents
|
||||
|
||||
|
|
Loading…
Reference in New Issue