Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update car.capnp #97

Open
wants to merge 38 commits into
base: kegman-gernby-1-gm-tune-newff-2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
452968d
enabled 1.0 x error cancellation
Gernby Jan 8, 2019
41de2f6
reverted curstate
Gernby Jan 9, 2019
c113cb8
more like FF-res plus longitudinal camera offset
Gernby Jan 10, 2019
39a44c8
updated max torque valueupdated max torque value
Gernby Jan 10, 2019
5a2e981
good breakthroughs for max_steer and steer noise
Gernby Jan 10, 2019
d176d9e
fixed torque for accords
Gernby Jan 10, 2019
2458133
Fixed typo
Gernby Jan 10, 2019
b371c10
not as good
Gernby Jan 10, 2019
3024e59
removed vibrate
Gernby Jan 10, 2019
8c64240
enabled long camera offset
Gernby Jan 10, 2019
4895768
added new steering parameters
Gernby Jan 10, 2019
30d5006
added new steering parameters
Gernby Jan 10, 2019
73e0aa1
added new steering parameters
Gernby Jan 10, 2019
5f03e03
mall cleanup
Gernby Jan 10, 2019
8d4ffb4
merge
Gernby Jan 10, 2019
0b917e3
added new parameters
Gernby Jan 15, 2019
d07a439
Update car.capnp
CryptoKylan Jan 15, 2019
3d655e9
Update interface.py
CryptoKylan Jan 15, 2019
1f07027
Add files via upload
CryptoKylan Jan 15, 2019
a54d83e
Delete visiond
CryptoKylan Jan 15, 2019
d1c9622
Add files via upload
CryptoKylan Jan 15, 2019
9a45184
Update latcontrol.py
CryptoKylan Jan 15, 2019
76446f3
Delete visiond
CryptoKylan Jan 15, 2019
fd8e20a
Merge branch 'resonant-interp-revert-curstate' of git://github.com/Ge…
geohot Jan 15, 2019
3d32904
Merge branch 'Gernby-resonant-interp-revert-curstate' into kegman-ger…
geohot Jan 15, 2019
d33a20c
Merge branch 'kegman-gernby-1-gm-tune-newff-3' of https://github.com/…
geohot Jan 15, 2019
b04ac02
Delete visiond.056
CryptoKylan Jan 15, 2019
f7159cb
Add files via upload
CryptoKylan Jan 15, 2019
d6483fc
Update interface.py
CryptoKylan Jan 15, 2019
4e57dca
tuning
CryptoKylan Jan 15, 2019
48311fa
Update car.capnp
CryptoKylan Jan 15, 2019
3f7c3c4
Update gm_global_a_powertrain.dbc
CryptoKylan Jan 15, 2019
8b44cdd
Update pathplanner.py
CryptoKylan Jan 15, 2019
1003d53
Update gm_global_a_powertrain.dbc
CryptoKylan Jan 15, 2019
ccd7968
Update gm_global_a_powertrain.dbc
CryptoKylan Jan 15, 2019
7987331
Update carcontroller.py
CryptoKylan Jan 16, 2019
8e1abd1
Update interface.py
CryptoKylan Jan 16, 2019
2104f87
lane changes
geohot Feb 15, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ struct CarEvent @0x9b1657f34caf3ad3 {
calibrationProgress @47;
lowBattery @48;
invalidGiraffeHonda @49;
manualSteeringRequired @50;
manualSteeringRequiredBlinkersOn @51;
}
}

Expand Down Expand Up @@ -345,7 +343,8 @@ struct CarParams {
steerReactance @51 :Float32;
steerInductance @52 :Float32;
steerResistance @53 :Float32;



# Kp and Ki for the longitudinal control
longitudinalKpBP @36 :List(Float32);
longitudinalKpV @37 :List(Float32);
Expand Down
2 changes: 1 addition & 1 deletion opendbc/gm_global_a_powertrain.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ BO_ 481 ASCMSteeringButton: 7 K124_ASCM
SG_ DriveModeButton : 39|1@0+ (1,0) [0|1] "" XXX

BO_ 485 PSCMSteeringAngle: 8 K43_PSCM
SG_ SteeringWheelAngle : 15|16@0- (0.0625,-0.5) [-525|525] "deg" NEO
SG_ SteeringWheelAngle : 15|16@0- (0.0625,0.3125) [-525|525] "deg" NEO
SG_ SteeringWheelRate : 27|12@0- (0.5,0) [-100|100] "deg/s" NEO

BO_ 489 EBCMVehicleDynamic: 8 K17_EBCM
Expand Down
Binary file added selfdrive/c
Binary file not shown.
2 changes: 1 addition & 1 deletion selfdrive/car/gm/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class CarControllerParams():
def __init__(self, car_fingerprint):
if car_fingerprint in (CAR.VOLT, CAR.MALIBU, CAR.HOLDEN_ASTRA, CAR.ACADIA, CAR.CADILLAC_ATS):
self.STEER_MAX = 400
self.STEER_MAX = 300
self.STEER_STEP = 2 # how often we update the steer cmd
self.STEER_DELTA_UP = 7 # ~0.75s time to peak torque (255/50hz/0.75s)
self.STEER_DELTA_DOWN = 17 # ~0.3s from peak torque to zero
Expand Down
6 changes: 3 additions & 3 deletions selfdrive/car/gm/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ def get_params(candidate, fingerprint):
ret.longPidDeadzoneBP = [0.]
ret.longPidDeadzoneV = [0.]

ret.longitudinalKpBP = [0., 5., 35.]
ret.longitudinalKpV = [3.5, 1.1, 0.7]
ret.longitudinalKiBP = [0., 5., 35.]
ret.longitudinalKpBP = [0., 2., 35.]
ret.longitudinalKpV = [3., 1.1, 0.7]
ret.longitudinalKiBP = [0., 2., 35.]
ret.longitudinalKiV = [0.25, 0.12, 0.08]

ret.steerLimitAlert = True
Expand Down
36 changes: 9 additions & 27 deletions selfdrive/car/honda/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def get_params(candidate, fingerprint):
tire_stiffness_factor = 0.8467
ret.steerReactance = 1.0
ret.steerInductance = 1.0
ret.steerResistance = 0.5
ret.steerResistance = 1.0
ret.eonToFront = 1.0
ret.steerKpV, ret.steerKiV = [[0.64], [0.192]]
ret.steerKf = 0.000064
Expand Down Expand Up @@ -317,8 +317,8 @@ def get_params(candidate, fingerprint):
ret.wheelbase = 2.81
ret.centerToFront = ret.wheelbase * 0.41
ret.steerRatio = 16.0 # as spec
tire_stiffness_factor = 0.82
ret.steerKpV, ret.steerKiV = [[0.5], [0.22]]
tire_stiffness_factor = 0.444 # not optimized yet
ret.steerKpV, ret.steerKiV = [[0.38], [0.11]]
ret.longitudinalKpBP = [0., 5., 35.]
ret.longitudinalKpV = [1.2, 0.8, 0.5]
ret.longitudinalKiBP = [0., 35.]
Expand Down Expand Up @@ -369,18 +369,8 @@ def get_params(candidate, fingerprint):
ret.steerMaxBP = [0.] # m/s
ret.steerMaxV = [1.] # max steer allowed

# prevent lurching when resuming
if ret.enableGasInterceptor:
ret.gasMaxBP = [0., 8, 35]
ret.gasMaxV = [0.2, 0.6, 0.6]
ret.longitudinalKpBP = [0., 5., 35.]
ret.longitudinalKpV = [1.2, 0.8, 0.5]
else:
ret.gasMaxBP = [0.] # m/s
ret.gasMaxV = [0.] # max gas allowed

#ret.gasMaxBP = [0.] # m/s
#ret.gasMaxV = [0.6] if ret.enableGasInterceptor else [0.] # max gas allowed
ret.gasMaxBP = [0.] # m/s
ret.gasMaxV = [0.6] if ret.enableGasInterceptor else [0.] # max gas allowed
ret.brakeMaxBP = [5., 20.] # m/s
ret.brakeMaxV = [1., 0.8] # max brake allowed

Expand Down Expand Up @@ -451,9 +441,6 @@ def update(self, c):
ret.cruiseState.available = bool(self.CS.main_on)
ret.cruiseState.speedOffset = self.CS.cruise_speed_offset
ret.cruiseState.standstill = False

ret.readdistancelines = self.CS.read_distance_lines
ret.lkMode = self.CS.lkMode

# TODO: button presses
buttonEvents = []
Expand Down Expand Up @@ -528,11 +515,7 @@ def update(self, c):
else:
self.cam_can_invalid_count = 0

if not self.CS.lkMode:
events.append(create_event('manualSteeringRequired', [ET.WARNING]))
elif self.CS.lkMode and (self.CS.left_blinker_on or self.CS.right_blinker_on):
events.append(create_event('manualSteeringRequiredBlinkersOn', [ET.WARNING]))
elif self.CS.steer_error:
if self.CS.steer_error:
events.append(create_event('steerUnavailable', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE, ET.PERMANENT]))
elif self.CS.steer_warning:
events.append(create_event('steerTempUnavailable', [ET.WARNING]))
Expand Down Expand Up @@ -571,10 +554,9 @@ def update(self, c):
if self.CP.enableCruise and not ret.cruiseState.enabled and c.actuators.brake <= 0.:
# non loud alert if cruise disbales below 25mph as expected (+ a little margin)
if ret.vEgo < self.CP.minEnableSpeed + 2.:
# events.append(create_event('speedTooLow', [ET.IMMEDIATE_DISABLE]))
#else:
events.append(create_event("cruiseDisabled", [ET.IMMEDIATE_DISABLE])) # send loud alert if slow and cruise disables during braking

events.append(create_event('speedTooLow', [ET.IMMEDIATE_DISABLE]))
else:
events.append(create_event("cruiseDisabled", [ET.IMMEDIATE_DISABLE]))
if self.CS.CP.minEnableSpeed > 0 and ret.vEgo < 0.001:
events.append(create_event('manualRestart', [ET.WARNING]))

Expand Down
5 changes: 5 additions & 0 deletions selfdrive/car/hyundai/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ def get_params(candidate, fingerprint):
ret.steerActuatorDelay = 0.1 # Default delay
tire_stiffness_factor = 1.

ret.steerReactance = 1.0
ret.steerInductance = 1.0
ret.steerResistance = 1.0
ret.eonToFront = 0.5

if candidate == CAR.SANTA_FE:
ret.steerKf = 0.00005
ret.steerRateCost = 0.5
Expand Down
5 changes: 5 additions & 0 deletions selfdrive/car/mock/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ def get_params(candidate, fingerprint):
ret.safetyModel = car.CarParams.SafetyModels.noOutput
ret.openpilotLongitudinalControl = False

ret.steerReactance = 1.0
ret.steerInductance = 1.0
ret.steerResistance = 1.0
ret.eonToFront = 0.5

# FIXME: hardcoding honda civic 2016 touring params so they can be used to
# scale unknown params for other cars
ret.mass = 1700.
Expand Down
4 changes: 4 additions & 0 deletions selfdrive/car/toyota/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ def get_params(candidate, fingerprint):
tireStiffnessFront_civic = 192150
tireStiffnessRear_civic = 202500

ret.steerReactance = 1.0
ret.steerInductance = 1.0
ret.steerResistance = 1.0
ret.eonToFront = 0.5
ret.steerKiBP, ret.steerKpBP = [[0.], [0.]]
ret.steerActuatorDelay = 0.12 # Default delay, Prius has larger delay

Expand Down
Binary file added selfdrive/controls/c
Binary file not shown.
6 changes: 3 additions & 3 deletions selfdrive/controls/lib/drive_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from selfdrive.config import Conversions as CV

# kph
V_CRUISE_MAX = 144
V_CRUISE_MIN = 8
V_CRUISE_DELTA = 8
V_CRUISE_MAX = 145
V_CRUISE_MIN = 10
V_CRUISE_DELTA = 5
V_CRUISE_ENABLE_MIN = 40


Expand Down
Loading