Skip to content

Commit

Permalink
fixing bodyControls pass through info
Browse files Browse the repository at this point in the history
  • Loading branch information
BogGyver committed Apr 21, 2021
1 parent b90961d commit 0ac9efa
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion selfdrive/car/tesla/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,8 @@ def update(self, enabled, CS, frame, actuators, cruise_cancel, hud_alert, audibl
CAN_CHASSIS[self.CP.carFingerprint], 1))

# send DAS_bodyControls
can_sends.append(self.tesla_can.create_body_controls_message(CS.msg_das_body_controls,
if self.IC_integration_counter in [20,70]:
can_sends.append(self.tesla_can.create_body_controls_message(CS.msg_das_body_controls,
CS.alca_direction, 1 if CS.needs_hazard else 0 , CAN_CHASSIS[self.CP.carFingerprint], 1))

# send DAS_warningMatrix0 at 1Hz
Expand Down
3 changes: 3 additions & 0 deletions selfdrive/car/tesla/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,13 +248,16 @@ def update(self, cp, cp_cam):
sw_a = copy.copy(cp.vl["STW_ACTN_RQ"])
if sw_a is not None:
self.msg_stw_actn_req = sw_a

if (self.CP.carFingerprint != CAR.PREAP_MODELS):
ap_s = copy.copy(cp_cam.vl["DAS_status"])
if ap_s is not None:
self.msg_autopilot_status = ap_s

bc = copy.copy(cp_cam.vl["DAS_bodyControls"])
if bc is not None:
self.msg_das_body_controls = bc

ap_s2 = copy.copy(cp_cam.vl["DAS_status2"])
if ap_s2 is not None:
self.msg_autopilot_status2 = ap_s2
Expand Down
2 changes: 2 additions & 0 deletions selfdrive/car/tesla/teslacan.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ def create_lead_car_object_message(self, objectId, vType1,vId1,relevant1,dx1,vxr
def create_body_controls_message(self,msg_das_body_controls,turn,hazard,bus,counter):
if msg_das_body_controls is not None:
values = copy.copy(msg_das_body_controls)
values["DAS_bodyControlsCounter"] = counter
values["DAS_bodyControlsChecksum"] = 0
else:
values = {
"DAS_headlightRequest" : 0,
Expand Down

0 comments on commit 0ac9efa

Please sign in to comment.