Skip to content

Commit c8696e4

Browse files
committed
Ford: remove ramp type param
1 parent 979692e commit c8696e4

File tree

2 files changed

+6
-18
lines changed

2 files changed

+6
-18
lines changed

selfdrive/car/ford/carcontroller.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
from selfdrive.car.ford.values import CarControllerParams
77
from opendbc.can.packer import CANPacker
88

9-
DEBUG_RAMP_TYPE = False
10-
119
VisualAlert = car.CarControl.HUDControl.VisualAlert
1210

1311

@@ -38,8 +36,6 @@ def __init__(self, dbc_name, CP, VM):
3836
self.steer_alert_last = False
3937
self.generic_toggle_last = False
4038

41-
self.ramp_type = 1
42-
4339
def update(self, enabled, CS, frame, actuators, cruise_cancel, visual_alert):
4440
can_sends = []
4541
main_on = CS.out.cruiseState.available
@@ -57,14 +53,6 @@ def update(self, enabled, CS, frame, actuators, cruise_cancel, visual_alert):
5753
# cancel stock ACC
5854
can_sends.append(fordcan.spam_cancel_button(self.packer))
5955

60-
if CS.out.genericToggle and not self.generic_toggle_last:
61-
# ramp type experiment
62-
if DEBUG_RAMP_TYPE:
63-
# TODO: stock varies this with distance from center
64-
self.ramp_type += 1
65-
if self.ramp_type > 3:
66-
self.ramp_type = 0
67-
6856
if (frame % self.params.LKAS_STEER_STEP) == 0:
6957
lca_rq = 1 if enabled else 0
7058
apply_steer_rad = apply_steer * CV.DEG_TO_RAD
@@ -74,7 +62,7 @@ def update(self, enabled, CS, frame, actuators, cruise_cancel, visual_alert):
7462

7563
# send steering commands
7664
can_sends.append(fordcan.create_steer_command(self.packer, apply_steer, curvature))
77-
can_sends.append(fordcan.create_steer2_command(self.packer, lca_rq, self.ramp_type, apply_steer_rad, curvature))
65+
can_sends.append(fordcan.create_steer2_command(self.packer, lca_rq, apply_steer_rad, curvature))
7866

7967
# TODO: do we need to send when values change? is 1hz acceptable?
8068
if (frame % self.params.LKAS_UI_STEP) == 0 or (self.main_on_last != main_on) or (self.enabled_last != enabled) or \

selfdrive/car/ford/fordcan.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ def create_steer_command(packer, angle_deg: float, curvature: float):
1414
"LkaDrvOvrrd_D_Rq": 0, # driver override level? [0|3]
1515
"LkaActvStats_D2_Req": 0, # action [0|7]
1616
"LaRefAng_No_Req": angle_deg, # angle [-102.4|102.3] degrees
17-
"LaRampType_B_Req": 0, # ramp type [0|1]
17+
"LaRampType_B_Req": 0, # Ramp speed: 0=Smooth, 1=Quick
1818
"LaCurvature_No_Calc": curvature, # curvature [-0.01024|0.01023] 1/meter
1919
"LdwActvStats_D_Req": 0, # LDW status [0|7]
20-
"LdwActvIntns_D_Req": 0, # LDW intensity [0|3]
20+
"LdwActvIntns_D_Req": 0, # LDW intensity [0|3], shake alert strength
2121
}
2222
return packer.make_can_msg("Lane_Assist_Data1", 0, values)
2323

2424

25-
def create_steer2_command(packer, lca_rq: int, ramp_type: int, angle_rad: float, curvature: float):
25+
def create_steer2_command(packer, lca_rq: int, angle_rad: float, curvature: float):
2626
"""
2727
Creates a CAN message for the Ford LCA Command.
2828
@@ -44,8 +44,8 @@ def create_steer2_command(packer, lca_rq: int, ramp_type: int, angle_rad: float,
4444
"LatCtlRng_L_Max": 0, # [0|126] meter
4545
"HandsOffCnfm_B_Rq": 0, # [0|1]
4646
"LatCtl_D_Rq": lca_rq, # Mode: 0=None, 1=Continuous [0|7]
47-
"LatCtlRampType_D_Rq": ramp_type, # Ramp speed: 0=Slow, 1=Medium, 2=Fast, 3=Immediate
48-
"LatCtlPrecision_D_Rq": 0, # Precision: 0=Comfortable, 1=Precise [0|3]
47+
"LatCtlRampType_D_Rq": 3, # Ramp speed: 0=Slow, 1=Medium, 2=Fast, 3=Immediate
48+
"LatCtlPrecision_D_Rq": 1, # Precision: 0=Comfortable, 1=Precise [0|3]
4949
"LatCtlPathOffst_L_Actl": 0, # Path offset [-5.12|5.11] meter
5050
"LatCtlPath_An_Actl": angle_rad, # Path angle [-0.5|0.5235] radians
5151
"LatCtlCurv_NoRate_Actl": 0, # Curvature rate [-0.001024|0.00102375] 1/meter

0 commit comments

Comments
 (0)