Skip to content

Commit

Permalink
fix panda for ibooster and typo in controlsd.py
Browse files Browse the repository at this point in the history
  • Loading branch information
BogGyver committed Apr 8, 2020
1 parent 1cc4019 commit a0a5f49
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
10 changes: 8 additions & 2 deletions panda/board/safety/safety_tesla.h
Original file line number Diff line number Diff line change
Expand Up @@ -983,8 +983,9 @@ static void do_EPB_epasControl(uint32_t RIR, uint32_t RDTR) {
MLB = MLB + (cksm << 16);
if (DAS_noEpasHarness == 0) {
send_fake_message(RIR,RDTR,3,0x214,2,MLB,MHB);
} // send also on 0 for monitoring
send_fake_message(RIR,RDTR,3,0x214,0,MLB,MHB);
} else {
send_fake_message(RIR,RDTR,3,0x214,0,MLB,MHB);
}
EPB_epasControl_idx++;
EPB_epasControl_idx = EPB_epasControl_idx % 16;
}
Expand Down Expand Up @@ -2007,6 +2008,11 @@ static int tesla_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd)
return ret_val;
}

if (addr == 0x214) {
//inhibit ibooster epas kill signal
return -1;
}

//forward everything else to CAN 2 unless claiming no harness
return ret_val;
}
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/tesla/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def update(self, enabled, CS, frame, actuators, \
if send_fake_msg:
if enable_steer_control and op_status == 3:
op_status = 0x5
park_brake_request = int(CS.ahbEnabled)
park_brake_request = 0 #experimental; disabled for now
if park_brake_request == 1:
print("Park Brake Request received")
adaptive_cruise = 1 if (not self.PCC.pcc_available and self.ACC.adaptive) or self.PCC.pcc_available else 0
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/controls/controlsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ def controlsd_thread(sm=None, pm=None, can_sock=None):
logAllAliveAndValidInfoToTinklad(sm=sm, tinklaClient=tinklaClient)
if not sm['pathPlan'].mpcSolutionValid:
events.append(create_event('plannerError', [ET.NO_ENTRY, ET.IMMEDIATE_DISABLE]))
if not sm['pathPlan'].sensorValid and os.getenf("NOSENSOR") is None:
if not sm['pathPlan'].sensorValid and os.getenv("NOSENSOR") is None:
events.append(create_event('sensorDataInvalid', [ET.NO_ENTRY, ET.PERMANENT]))
if not sm['pathPlan'].paramsValid:
events.append(create_event('vehicleModelInvalid', [ET.WARNING]))
Expand Down

0 comments on commit a0a5f49

Please sign in to comment.